X-Git-Url: https://git.donarmstrong.com/?p=lib.git;a=blobdiff_plain;f=emacs_el%2FMakefile;h=cfd61b4fb23320b9d376de10b5d9ebc81a491790;hp=a044ede50978229c9bb53864c6f495bc14475703;hb=bb6f856e564fafbcb00d953c5d5ac534430e2e7a;hpb=44d1504fedff6c2d3eb4d4ef160a70715b53f589 diff --git a/emacs_el/Makefile b/emacs_el/Makefile index a044ede..cfd61b4 100644 --- a/emacs_el/Makefile +++ b/emacs_el/Makefile @@ -1,12 +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 - emacs -q -no-site-file -L . --no-site-file -batch -f batch-byte-compile $<; + $(EMACS) -q -no-site-file $(LIBDIRS) --no-site-file -batch -f batch-byte-compile $<; clean: rm -f *.elc -.PHONY: clean all +.PHONY: clean all $(SUBDIRS)