diff options
author | Luke Shumaker <lukeshu@sbcglobal.net> | 2016-05-17 18:49:42 -0400 |
---|---|---|
committer | Luke Shumaker <lukeshu@sbcglobal.net> | 2016-05-17 18:49:42 -0400 |
commit | c9cfc9bc4451a6219f71407b9a6e00b51defc713 (patch) | |
tree | eee260ac1b6ff37b5fba45b89204864d810dfe67 | |
parent | 733636464ea990d96d38edefff9ca326e8195cf4 (diff) |
Use automake.mk
-rw-r--r-- | .gitignore | 1 | ||||
-rw-r--r-- | Makefile | 32 | ||||
-rw-r--r-- | common.each.head.mk | 0 | ||||
-rw-r--r-- | common.each.tail.mk | 0 | ||||
-rw-r--r-- | common.once.head.mk | 0 | ||||
-rw-r--r-- | common.once.tail.mk | 0 | ||||
-rwxr-xr-x | write-ifchanged | 11 |
7 files changed, 33 insertions, 11 deletions
@@ -1,4 +1,5 @@ depends.txt +.srcfiles.mk parabolaweb* !parabolaweb*.in @@ -1,3 +1,10 @@ +topoutdir ?= . +topsrcdir ?= . +include $(topsrcdir)/automake.head.mk + +PACKAGE = parabolaweb-utils +VERSION = 20160517 + DESTDIR = #prefix = /usr/local @@ -20,6 +27,14 @@ pkgconffile = $(sysconfdir)/parabolaweb CFLAGS += -std=c99 -Wall -Wextra -Werror -Wno-unused-parameter CPPFLAGS += -DSCRIPT_LOCATION='"$(pkglibexecdir)/parabolaweb-changepassword.real"' +ifeq ($(wildcard .git),) +include .srcfiles.mk +else +.srcfiles.mk: FORCE + @echo am_src_files = $(shell git ls-files) | ./write-ifchanged $@ +-include $(srcdir)/.srcfiles.mk +endif + targets = \ $(sbindir)/parabolaweb-changepassword \ $(sbindir)/parabolaweb-reporead-inotify \ @@ -28,16 +43,9 @@ targets = \ $(systemddir)/parabolaweb-reporead-inotify.service \ $(uwsgidir)/parabolaweb.ini.example -all: PHONY depends.txt $(notdir $(targets)) parabolaweb.conf - -install: PHONY $(addprefix $(DESTDIR),$(targets) $(pkgconffile)) - -uninstall: PHONY - $(RM) $(addprefix $(DESTDIR),$(targets) $(pkgconffile)) - rmdir -p -- $(wildcard $(sort $(dir $(addprefix $(DESTDIR),$(targets) $(pkgconffile))))) 2>/dev/null || true - -clean: PHONY - $(RM) $(notdir $(targets)) depends.txt +am_gen_files = .srcfiles.mk +am_out_files = depends.txt $(notdir $(targets)) parabolaweb.conf +am_sys_files = $(targets) $(pkgconffile) # Pattern rules @@ -65,4 +73,6 @@ $(DESTDIR)$(pkgconffile): parabolaweb.conf install -Dm644 $< $@ .DELETE_ON_ERROR: -.PHONY: PHONY +.PHONY: FORCE + +include $(topsrcdir)/automake.tail.mk diff --git a/common.each.head.mk b/common.each.head.mk new file mode 100644 index 0000000..e69de29 --- /dev/null +++ b/common.each.head.mk diff --git a/common.each.tail.mk b/common.each.tail.mk new file mode 100644 index 0000000..e69de29 --- /dev/null +++ b/common.each.tail.mk diff --git a/common.once.head.mk b/common.once.head.mk new file mode 100644 index 0000000..e69de29 --- /dev/null +++ b/common.once.head.mk diff --git a/common.once.tail.mk b/common.once.tail.mk new file mode 100644 index 0000000..e69de29 --- /dev/null +++ b/common.once.tail.mk diff --git a/write-ifchanged b/write-ifchanged new file mode 100755 index 0000000..c65fa16 --- /dev/null +++ b/write-ifchanged @@ -0,0 +1,11 @@ +#!/usr/bin/env bash + +outfile=$1 +tmpfile="$(dirname "$outfile")/.tmp${outfile##*/}" + +cat > "$tmpfile" || exit $? +if cmp -s "$tmpfile" "$outfile"; then + rm -f "$tmpfile" || : +else + mv -f "$tmpfile" "$outfile" +fi |