# GNU coding standards prefix ?= /usr/local exec_prefix ?= $(prefix) bindir ?= $(exec_prefix)/bin sbindir ?= $(exec_prefix)/sbin libdir ?= $(exec_prefix)/lib libexecdir ?= $(exec_prefix)/libexec sysconfdir ?= $(prefix)/etc srcdir ?= src datarootdir ?= $(prefix)/share COPY=cp --reflink=auto all: $(MAKE) -C sjbin all clean: $(MAKE) -C sjbin clean install: # TODO use install and wildcard ? $(COPY) -v -r --no-clobber etc/* $(DESTDIR)$(sysconfdir) $(COPY) -v -r usr/bin/* $(DESTDIR)$(bindir) # $(COPY) -v -r usr/share/* $(DESTDIR)$(datarootdir) $(COPY) -v -r usr/lib/* $(DESTDIR)$(libdir) sed -i 's|/usr/local|$(prefix)|' $(DESTDIR)$(libdir)/systemd/system/argeo*.service sed -i 's|/usr/local|$(prefix)|' $(DESTDIR)$(libdir)/systemd/user/argeo*.service sed -i 's|/usr/local|$(prefix)|' $(DESTDIR)$(libdir)/argeo/*.args $(COPY) -v -r usr/libexec/* $(DESTDIR)$(libexecdir) # $(MAKE) -C sjbin install systemctl daemon-reload uninstall: $(foreach f, $(shell cd usr/bin/ && find . -type f), $(RM) $(DESTDIR)$(bindir)/$(f);) # $(foreach f, $(shell find usr/share/ -type f), $(RM) $(DESTDIR)$(datarootdir)/$(f);) $(foreach f, $(shell cd usr/lib/ && find . -type f), $(RM) $(DESTDIR)$(libdir)/$(f);) $(foreach f, $(shell cd usr/libexec/ && find . -type f), $(RM) $(DESTDIR)$(libexecdir)/$(f);) purge: uninstall $(foreach f, $(shell cd etc/ && find . -type f), $(RM) $(DESTDIR)$(sysconfdir)/$(f);)