diff options
Diffstat (limited to 'Makefile')
-rw-r--r-- | Makefile | 45 |
1 files changed, 16 insertions, 29 deletions
@@ -1,34 +1,24 @@ # Copyright 2016 Luke Shumaker # License: WTFPLv2 -prefix = /usr/local -bindir = $(prefix)/bin -systemddir = $(prefix)/lib/systemd/system -sysconfdir = $(prefix)/etc +PACKAGE = httpconnectd +VERSION = 20161004 + pkgconfdir = $(sysconfdir)/httpconnectd -DESTDIR = Q = @ ######################################################################## - MAKEFLAGS += -r -vars = $(patsubst .var.%,%,$(filter .var.%,$^)) -build_targets += httpconnectd httpconnectd@.service httpconnectd.socket -build_targets += httpsconnectd httpsconnectd.service -build_targets += basicauth.conf-sample -install_targets += $(DESTDIR)$(bindir)/httpconnectd $(DESTDIR)$(systemddir)/httpconnectd@.service $(DESTDIR)$(systemddir)/httpconnectd.socket -install_targets += $(DESTDIR)$(bindir)/httpsconnectd $(DESTDIR)$(systemddir)/httpsconnectd.service $(DESTDIR)$(pkgconfdir)/https.conf -install_targets += $(DESTDIR)$(pkgconfdir)/basicauth.conf-sample - -all: $(build_targets) -install: $(install_targets) -clean: - rm -f -- httpconnectd httpconnectd.sh httpconnectd@.service - rm -f -- httpsconnectd httpsconnectd.sh httpsconnectd.service -uninstall: - rm -f -- $(install_targets) - rmdir -p -- $(dir $(install_targets)) -.PHONY: all install clean uninstall +topsrcdir ?= . +topoutdir ?= . +include $(topsrcdir)/build-aux/Makefile.head.mk + +files.out.all += httpconnectd httpconnectd@.service # httpconnectd.socket +files.out.all += httpsconnectd httpsconnectd.service +files.out.int += *.sh +files.sys.all += $(bindir)/httpconnectd $(systemddir)/httpconnectd@.service $(systemddir)/httpconnectd.socket +files.sys.all += $(bindir)/httpsconnectd $(systemddir)/httpsconnectd.service $(pkgconfdir)/https.conf +files.sys.all += $(pkgconfdir)/basicauth.conf-sample httpconnectd@.service: .var.bindir httpconnectd.sh: .var.pkgconfdir @@ -36,11 +26,10 @@ httpconnectd.sh: .var.pkgconfdir httpsconnectd.service: .var.bindir httpsconnectd.sh: .var.pkgconfdir -######################################################################## - %: %.sh install -m755 $< $@ +vars = $(patsubst .var.%,%,$(filter .var.%,$^)) %: %.in $(if $(Q),$(Q)echo 'EDIT < $< > $@';)$(if $(vars),sed $(foreach v,$(vars), -e 's|@$(v)@|$($(v))|g' ),cat) < $< > $@ @@ -51,9 +40,7 @@ $(DESTDIR)$(systemddir)/%: % $(DESTDIR)$(pkgconfdir)/%: % install -Dm644 $< $@ -.var.%: FORCE - $(Q)printf '%s' '$($*)' > .tmp$@ && { cmp -s .tmp$@ $@ && rm -f -- .tmp$@ || mv -Tf .tmp$@ $@; } || { rm -f -- .tmp$@; false; } - .DELETE_ON_ERROR: .SECONDARY: -.PHONY: FORCE + +include $(topsrcdir)/build-aux/Makefile.tail.mk |