#!/usr/bin/make 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 $(EMACS) -q -no-site-file -L . --no-site-file -batch -f batch-byte-compile $<; clean: rm -f *.elc .PHONY: clean all