+
+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 org-ref
+LIBDIRS=-L .
+endif
+
+
+all: $(ELC_FILES) $(SUBDIRS)
+
+EMACS=emacs
+
+$(SUBDIRS): %:
+ $(MAKE) -C $@