summaryrefslogtreecommitdiff
path: root/Makefile
diff options
context:
space:
mode:
authorLuke Shumaker <lukeshu@sbcglobal.net>2016-06-08 21:53:02 -0400
committerLuke Shumaker <lukeshu@sbcglobal.net>2016-06-08 21:53:02 -0400
commit482ff021e313131af25eb6c8d70bd4d414c32105 (patch)
treef89d8d6c9031b1afd770d526e273f5a8f1436faf /Makefile
parentc652d729a4be79911ffe11b75cda62b675f1c12a (diff)
Use autothing, touch up buildsystem
Diffstat (limited to 'Makefile')
-rw-r--r--Makefile40
1 files changed, 25 insertions, 15 deletions
diff --git a/Makefile b/Makefile
index bbb19d1..96fcd9a 100644
--- a/Makefile
+++ b/Makefile
@@ -3,34 +3,44 @@ prefix=/usr/local
exec_prefix=$(prefix)
bindir=$(exec_prefix)/bin
-bash=/bin/bash
+bash=/usr/bin/env bash
-EDIT = { m4 -P | sed 's|@bash@|$(bash)|g'; }
+EDIT = { m4 -P | sed -e 's|@bash@|$(bash)|g' -e 's|@VERSION@|$(VERSION)|'; }
INSTALL_PROGRAM = install -Dm755
RM = rm -f
+PACKAGE = emacsutils
+VERSION = 0.9
+
+topoutdir=.
+topsrcdir=.
+include $(topoutdir)/build-aux/Makefile.head.mk
-targets = ediff emacsmail emacsterm
-all: PHONY $(targets)
-install: PHONY $(addprefix $(DESTDIR)$(bindir)/,$(targets))
-uninstall: PHONY
- $(RM) -- $(addprefix $(DESTDIR)$(bindir)/,$(targets))
-clean: PHONY
- $(RM) -- $(addsuffix .sh,$(targets))
-distclean: PHONY clean
- $(RM) -- $(targets)
+ifeq ($(wildcard .git/),)
+include .srcfiles.mk
+else
+.srcfiles.mk: FORCE
+ @git ls-files | sed 's|^|std.src_files += |' | $(WRITE_IFCHANGED) $@
+-include .srcfiles.mk
+endif
-
+std.out_files = ediff emacsmail emacsterm
+std.sys_files = $(addprefix $(bindir)/,$(std.out_files))
+std.clean_files += *.sh
-%.sh: %.sh.in common.sh
+%.sh: %.sh.in common.sh.in .var.bash .var.VERSION
$(EDIT) < $< > $@
$(DESTDIR)$(bindir)/%: %
$(INSTALL_PROGRAM) $< $@
-
+.var.%: FORCE
+ @printf '%s' '$($*)' | sed 's|^|#|' | $(WRITE_IFCHANGED) '$@'
+-include $(wildcard .var.*)
-.PHONY: PHONY
+.PHONY: PHONY FORCE
.DELETE_ON_ERROR:
+.SECONDARY:
+include $(topoutdir)/build-aux/Makefile.tail.mk