]> git.donarmstrong.com Git - lib.git/blobdiff - emacs_el/Makefile
make this simpler so it works
[lib.git] / emacs_el / Makefile
index a044ede50978229c9bb53864c6f495bc14475703..b85c3cc588282a4e76dfcfe70235d1281a728f62 100644 (file)
@@ -1,9 +1,19 @@
 #!/usr/bin/make
 
-all: $(patsubst %.el,%.elc,$(wildcard *.el))
+
+WHICH_EMACS:=$(shell which emacs >/dev/null 2>&1 || echo "fail")
+
+ELC_FILES=
+ifeq ($(strip $(WHICH_EMACS)),)
+ELC_FILES=$(patsubst %.el,%.elc,$(wildcard *.el))
+endif
+
+all: $(ELC_FILES)
+
+EMACS=emacs
 
 %.elc: %.el
-       emacs -q -no-site-file -L . --no-site-file -batch -f batch-byte-compile $<;
+       $(EMACS) -q -no-site-file -L . --no-site-file -batch -f batch-byte-compile $<;
 
 clean: 
        rm -f *.elc