nirv.git

Makefile

espurr
# nirv - music player
# Copyright (C) 2023 ArcNyxx
# see LICENCE file for licensing information

.POSIX:

include config.mk

SRC = nirv.c
OBJ = $(SRC:.c=.o)

$(OBJ): config.mk

.c.o:
	$(CC) $(CFLAGS) -c $<

nirv: $(OBJ)
	$(CC) $(OBJ) -o $@ $(LDFLAGS)

all: nirv

clean:
	rm -f nirv $(OBJ)

install: all
	mkdir -p $(PREFIX)/bin $(MANPREFIX)/man1
	cp -f nirv $(PREFIX)/bin
	cp -f nctl.sh $(PREFIX)/bin/nctl
	chmod 755 $(PREFIX)/bin/nirv $(PREFIX)/bin/nctl
	sed 's/VERSION/$(VERSION)/g' < nirv.1 > $(MANPREFIX)/man1/nirv.1
	sed 's/VERSION/$(VERSION)/g' < nctl.1 > $(MANPREFIX)/man1/nctl.1
	chmod 644 $(MANPREFIX)/man1/nirv.1 $(MANPREFIX)/man1/nctl.1

uninstall:
	rm -f $(PREFIX)/bin/nirv $(PREFIX)/bin/nctl $(MANPREFIX)/man1/nirv.1 \
		$(MANPREFIX)/man1/nctl.1

.PHONY: all clean install uninstall