]> git.donarmstrong.com Git - lib.git/blobdiff - emacs_el/Makefile
fix missing ) for org-mode
[lib.git] / emacs_el / Makefile
index ddf9fdbeea0d6a095657e2dca982279f5b8b12c9..cfd61b4fb23320b9d376de10b5d9ebc81a491790 100644 (file)
@@ -1,14 +1,33 @@
 #!/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
+
+SUBDIRS=
+LIBOPTS=-L .
+ifeq ($(strip $(WHICH_EMACS)),)
+SUBDIRS=configuration helm org-ref
+LIBDIRS=-L . -L helm
+endif
+
+
+all: $(ELC_FILES) $(SUBDIRS)
+
+EMACS=emacs
+
+$(SUBDIRS): %: 
+       $(MAKE) -C $@
 
 %.elc: %.el
-       echo $<|emacs -q -no-site-file --no-site-file -batch -f byte-compile-file;
+       $(EMACS) -q -no-site-file $(LIBDIRS) --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
+.PHONY: clean all $(SUBDIRS)