From 1ae12873c97fcae5c67216709d58e335f0cfd599 Mon Sep 17 00:00:00 2001 From: tengel Date: Sun, 8 Mar 2015 09:48:35 -0500 Subject: [PATCH] building all targets --- Makefile | 45 +++++++++++++++++++++++++++++++++++++++++---- 1 file changed, 41 insertions(+), 4 deletions(-) diff --git a/Makefile b/Makefile index 53f9787..baeb74c 100644 --- a/Makefile +++ b/Makefile @@ -3,8 +3,13 @@ VERSION := $(shell grep '^\#\# Version:' petrified | cut -d' ' -f3) PREFIX ?= /usr/local +BINPREFIX ?= $(PREFIX)/bin +LIBPREFIX ?= $(PREFIX)/lib MANPREFIX ?= $(PREFIX)/share/man +DOCPREFIX ?= $(PREFIX)/share/doc ETCPREFIX ?= /etc +VARPREFIX ?= /var +DESTDIR ?= MANPAGES = \ petrified.1 @@ -16,15 +21,47 @@ petrified.1: README.pod pod2man -s 1 -c "Petrified Manual" -n "PETRIFIED" \ -r "petrified $(VERSION)" $< $@ -install: all - install -Dm0755 petrified "$(DESTDIR)$(PREFIX)/bin/petrified" +install: all install-main install-doc +uninstall: uninstall-main uninstall-doc + +install-main: + install -Dm0755 petrified "$(DESTDIR)$(BINPREFIX)/petrified" install -Dm0644 petrified.1 "$(DESTDIR)$(MANPREFIX)/man1/petrified.1" install -Dm0600 petrified.conf "$(DESTDIR)$(ETCPREFIX)/petrified.conf" + install -dm0755 "$(DESTDIR)$(VARPREFIX)/cache/petrified" -uninstall: - $(RM) "$(DESTDIR)$(PREFIX)/bin/petrified" \ +install-doc: + install -dm0755 "$(DESTDIR)$(DOCPREFIX)/petrified/extra" + install -Dm0644 README.pod LICENSE "$(DESTDIR)$(DOCPREFIX)/petrified" + install -Dm0644 extra/petrified.crontab extra/petrified.dispatch \ + extra/petrified.logrotate "$(DESTDIR)$(DOCPREFIX)/petrified/extra" + +install-systemd: + install -dm0755 "$(DESTDIR)$(LIBPREFIX)/systemd/system" + install -Dm0644 systemd/petrified.target \ + systemd/petrified.timer \ + systemd/petrified@.service \ + "$(DESTDIR)$(LIBPREFIX)/systemd/system" + +uninstall-main: + $(RM) "$(DESTDIR)$(BINPREFIX)/petrified" \ "$(DESTDIR)$(MANPREFIX)/man1/petrified.1" \ "$(DESTDIR)$(ETCPREFIX)/petrified.conf" + rmdir "$(DESTDIR)$(VARPREFIX)/cache/petrified" + +uninstall-doc: + $(RM) "$(DESTDIR)$(DOCPREFIX)/petrified/README.pod" \ + "$(DESTDIR)$(DOCPREFIX)/petrified/LICENSE" \ + "$(DESTDIR)$(DOCPREFIX)/petrified/extra/petrified.crontab" \ + "$(DESTDIR)$(DOCPREFIX)/petrified/extra/petrified.dispatch" \ + "$(DESTDIR)$(DOCPREFIX)/petrified/extra/petrified.logrotate" + rmdir "$(DESTDIR)$(DOCPREFIX)/petrified/extra" \ + "$(DESTDIR)$(DOCPREFIX)/petrified" \ + +uninstall-systemd: + $(RM) "$(DESTDIR)$(LIBPREFIX)/systemd/system/petrified.target" \ + "$(DESTDIR)$(LIBPREFIX)/systemd/system/petrified.timer" \ + "$(DESTDIR)$(LIBPREFIX)/systemd/system/petrified@.service" clean: $(RM) $(MANPAGES)