]> git.donarmstrong.com Git - lib.git/blobdiff - emacs_el/Makefile
only build elc files if emacs is installed
[lib.git] / emacs_el / Makefile
index ddf9fdbeea0d6a095657e2dca982279f5b8b12c9..8f48010536b2418c5cb1ec9a8b7f515aab1f9698 100644 (file)
@@ -1,14 +1,22 @@
 #!/usr/bin/make
 
-all: $(patsubst %.el,%.elc,$(wildcard *.el))
+
+WHICH_EMACS=
+
+ELC_FILES=
+ifneq ($(shell (which emacs >/dev/null 2>&1 || echo -n "fail") && echo -n "success"),"fail")
+ELC_FILES=$(patsubst %.el,%.elc,$(wildcard *.el))
+endif
+
+all: $(ELC_FILES)
+
+EMACS=emacs
 
 %.elc: %.el
-       echo $<|emacs -q -no-site-file --no-site-file -batch -f byte-compile-file;
+       $(EMACS) -q -no-site-file -L . --no-site-file -batch -f batch-byte-compile $<;
 
 clean: 
-       rubber -d --clean *.tex
-       rm -f *.tmp
-       rm -f figures/*.pdf
+       rm -f *.elc
 
 .PHONY: clean all