aboutsummaryrefslogtreecommitdiff
path: root/Makefile
diff options
context:
space:
mode:
authorFrank Fischer <frank.fischer@mathematik.tu-chemnitz.de>2011-08-10 20:06:09 +0200
committerFrank Fischer <frank.fischer@mathematik.tu-chemnitz.de>2011-08-10 20:06:09 +0200
commit46048f1a05e90a48dc62d0a78518da1a7be1754d (patch)
tree024d61427e1893dc1f53e5f92b3d01a49c1b1b22 /Makefile
parent5426262e5e087fc792c018b07c1fe5e2b7955552 (diff)
Add generation of dependencies to Makefile
Dependencies of Emacs-Lisp files are generated automatically by following the (require evil-...) directives.
Diffstat (limited to 'Makefile')
-rw-r--r--Makefile11
1 files changed, 10 insertions, 1 deletions
diff --git a/Makefile b/Makefile
index 8d5f61f..a90f9d2 100644
--- a/Makefile
+++ b/Makefile
@@ -10,7 +10,9 @@ ELCFILES = $(FILES:.el=.elc)
# Byte-compile Evil.
all: compile
-compile: $(ELCFILES)
+compile: .depend $(ELCFILES)
+
+-include .depend
$(ELCFILES): %.elc: %.el
$(EMACS) --batch -Q -L . -L lib -f batch-byte-compile $<
@@ -20,11 +22,18 @@ $(ELCFILES): %.elc: %.el
compile-batch: clean
$(EMACS) --batch -Q -L . -L lib -f batch-byte-compile ${FILES}
+.depend: $(FILES)
+ rm -f .depend
+ for f in $(FILES); do \
+ sed -n "s/(require '\(evil-.*\))/$${f}c: \1.el/p" $$f >> .depend;\
+ done
+
# Delete byte-compiled files etc.
clean:
rm -f *~
rm -f \#*\#
rm -f *.elc
+ rm -f .depend
# Run tests.
# The TAG variable may specify a test tag or a test name: