diff options
author | Luke Shumaker <LukeShu@sbcglobal.net> | 2014-06-23 20:58:18 -0400 |
---|---|---|
committer | Luke Shumaker <LukeShu@sbcglobal.net> | 2014-06-23 20:58:18 -0400 |
commit | 213a1ffca123ab7bf30ba3af57fff3c5e99f54ea (patch) | |
tree | c05b8b4e94365b8ae9b3e6da33d75d88e4a78ea4 /Makefile | |
parent | 07bbca11bee7e0ddae32f9e5db8bf03b72def4ab (diff) |
clean up the build system
Diffstat (limited to 'Makefile')
-rw-r--r-- | Makefile | 59 |
1 files changed, 37 insertions, 22 deletions
@@ -1,44 +1,59 @@ -prefix = /usr +DESTDIR = + +#prefix = /usr/local +prefix = /usr exec_prefix = $(prefix) -sbindir = $(exec_prefix)/sbin -libexecdir = $(exec_prefix)/lib -systemddir = $(prefix)/lib/systemd/system -confdir = /etc/conf.d +bindir = $(exec_prefix)/bin +#sbindir = $(exec_prefix)/sbin +sbindir = $(bindir) +#libexecdir = $(exec_prefix)/libexec +libexecdir = $(exec_prefix)/lib +#sysconfdir = $(prefix)/etc +sysconfdir = /etc/conf.d +systemddir = $(prefix)/lib/systemd/system pkglibexecdir = $(libexecdir)/parabolaweb-utils +pkgconffile = $(sysconfdir)/parabolaweb CFLAGS += -std=c99 -Wall -Wextra -Werror -Wno-unused-parameter CPPFLAGS += -DSCRIPT_LOCATION='"$(pkglibexecdir)/parabolaweb-changepassword.real"' -all: depends.txt parabolaweb-changepassword - -install: \ +targets = \ $(DESTDIR)$(sbindir)/parabolaweb-changepassword \ $(DESTDIR)$(sbindir)/parabolaweb-fcgi \ $(DESTDIR)$(sbindir)/parabolaweb-reporead-inotify \ $(DESTDIR)$(sbindir)/parabolaweb-update \ - $(DESTDIR)$(confdir)/parabolaweb \ $(DESTDIR)$(pkglibexecdir)/parabolaweb-changepassword.real \ $(DESTDIR)$(systemddir)/parabolaweb.service \ $(DESTDIR)$(systemddir)/parabolaweb-reporead-inotify.service -depends.txt: list-depends depends_static.txt - bash $< > $@ +all: depends.txt $(notdir $(targets)) parabolaweb.conf -%.service: %.service.in - sed 's|@sbindir@|$(sbindir)|' < $< > $@ +install: $(targets) $(sysconffile) -$(DESTDIR)$(sbindir)/%: % - install -Dm755 $< $@ +# Pattern rules -$(DESTDIR)$(sbindir)/parabolaweb-changepassword: parabolaweb-changepassword - install -Dm6755 $< $@ +%: %.in + sed -e 's|@sbindir@|$(sbindir)|' -e 's|@pkgconffile@|$(pkgconffile)|' < $< > $@ + +$(DESTDIR)$(sbindir)/%: % + $(INSTALL) -Dm755 $< $@ -$(DESTDIR)$(pkglibexecdir)/parabolaweb-changepassword.real: parabolaweb-changepassword.sh - install -Dm755 $< $@ +$(DESTDIR)$(pkglibexecdir)/%: % + $(INSTALL) -Dm755 $< $@ $(DESTDIR)$(systemddir)/%.service: %.service - install -Dm644 $< $@ + $(INSTALL) -Dm644 $< $@ + +# Specific rules + +depends.txt: list-depends depends_static.txt + $< > $@ + +$(DESTDIR)$(sbindir)/parabolaweb-changepassword: parabolaweb-changepassword + $(INSTALL) -Dm6755 $< $@ + +$(DESTDIR)(pkgconffile): parabolaweb.conf + $(INSTALL) -Dm644 $< $@ -$(DESTDIR)$(confdir)/%: %.conf - install -Dm644 $< $@ +.DELETE_ON_ERROR: |