general: Adjust makefile

This commit is contained in:
Dylan Araps 2018-05-03 15:05:42 +10:00
parent 64fa49c0f1
commit f6d93420f8

View file

@ -1,5 +1,4 @@
PREFIX ?= /usr PREFIX ?= /usr
SYSCONFDIR ?= /etc
MANDIR ?= $(PREFIX)/share/man MANDIR ?= $(PREFIX)/share/man
all: all:
@ -8,22 +7,15 @@ all:
install: install:
@echo 'Making directories...' @echo 'Making directories...'
@mkdir -p $(DESTDIR)$(PREFIX)/bin @mkdir -p $(DESTDIR)$(PREFIX)/bin
@mkdir -p $(DESTDIR)$(PREFIX)/share/neofetch/ascii/distro
@mkdir -p $(DESTDIR)$(MANDIR)/man1 @mkdir -p $(DESTDIR)$(MANDIR)/man1
@mkdir -p $(DESTDIR)$(SYSCONFDIR)/neofetch
@echo 'Installing binaries...' @echo 'Installing binaries...'
@sed "s|ASCIIDIR|$(PREFIX)/share/neofetch/ascii/distro|g;s|CONFDIR|$(SYSCONFDIR)/neofetch|g" < neofetch > $(DESTDIR)$(PREFIX)/bin/neofetch
@chmod 755 $(DESTDIR)$(PREFIX)/bin/neofetch @chmod 755 $(DESTDIR)$(PREFIX)/bin/neofetch
@echo 'Installing ASCII files, man page and config file...' @echo 'Installing man page...'
@cp -p ascii/distro/* $(DESTDIR)$(PREFIX)/share/neofetch/ascii/distro
@cp -p neofetch.1 $(DESTDIR)$(MANDIR)/man1 @cp -p neofetch.1 $(DESTDIR)$(MANDIR)/man1
@cp -p config/config.conf $(DESTDIR)$(SYSCONFDIR)/neofetch/config.conf
uninstall: uninstall:
@echo 'Removing files...' @echo 'Removing files...'
@rm -rf $(DESTDIR)$(PREFIX)/bin/neofetch @rm -rf $(DESTDIR)$(PREFIX)/bin/neofetch
@rm -rf $(DESTDIR)$(MANDIR)/man1/neofetch.1* @rm -rf $(DESTDIR)$(MANDIR)/man1/neofetch.1*
@rm -rf $(DESTDIR)$(PREFIX)/share/neofetch
@rm -rf $(DESTDIR)$(SYSCONFDIR)/neofetch