summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAchim Gratz <Stromeko@Stromeko.DE>2012-08-22 08:04:56 +0200
committerBastien Guerry <bzg@altern.org>2012-08-23 12:32:38 +0200
commita90ff91350904de6692864ed43da1c161260b461 (patch)
treed36866aa6f5ab2f65f7355ffe6a0e086617b574e
parent85d6b781e49f5e8c674c02b3c06b2ff1cde99f84 (diff)
downloadorg-mode-a90ff91350904de6692864ed43da1c161260b461.tar.gz
Makefile: adding files from contrib
* default.mk: Add customizatin variable ORG_ADD_CONTRIB with descriptiona and commented example. * targets.mk: Strip leading path and trailing suffix from all elements of ORG_ADD_CONTRIB, then prefix with contrib/lisp and do wildcard expansion (this will also remove any invalid names); store the result in ORG_FROM_CONTRIB. Strip /contrib from ORG_FROM_CONTRIB and store the result in ORG_TO_LISP. If these are non-empty, copy the files from contrib/lisp/ into lisp/ before compilation and remove them when cleanlisp is called.
-rw-r--r--default.mk4
-rw-r--r--targets.mk19
2 files changed, 23 insertions, 0 deletions
diff --git a/default.mk b/default.mk
index 27d4879..483d1de 100644
--- a/default.mk
+++ b/default.mk
@@ -22,6 +22,10 @@ infodir = $(prefix)/info
# Define if you only need info documentation, the default includes html and pdf
#ORG_MAKE_DOC = info # html pdf
+# Define if you want to include some (or all) files from contrib/lisp
+# just the filename please (no path prefix, no .el suffix), maybe with globbing
+#ORG_ADD_CONTRIB = org-e-* org-md org-export # e.g. the new exporter
+
# Where to create temporary files for the testsuite
# respect TMPDIR if it is already defined in the environment
TMPDIR ?= /tmp
diff --git a/targets.mk b/targets.mk
index c1c6c42..b69e55b 100644
--- a/targets.mk
+++ b/targets.mk
@@ -10,6 +10,13 @@ SUBDIRS = $(OTHERDIRS) $(LISPDIRS)
INSTSUB = $(SUBDIRS:%=install-%)
ORG_MAKE_DOC ?= info html pdf
+ORG_FROM_CONTRIB = $(wildcard \
+ $(addsuffix .el, \
+ $(addprefix contrib/lisp/, \
+ $(basename \
+ $(notdir $(ORG_ADD_CONTRIB))))))
+ORG_TO_LISP = $(ORG_FROM_CONTRIB:contrib/%=%)
+
ifneq ($(wildcard .git),)
GITVERSION ?= $(shell git describe --abbrev=6 HEAD)
ORGVERSION ?= $(subst release_,,$(shell git describe --abbrev=0 HEAD))
@@ -44,6 +51,9 @@ config config-all::
$(info ========= Emacs executable and Installation paths)
$(foreach var,$(CONF_BASE),$(info $(var) = $($(var))$(EOL)))
$(foreach var,$(CONF_DEST),$(info $(var) = $(DESTDIR)$($(var))$(EOL)))
+ $(info ========= Additional files from contrib/lisp)
+ $(info ORG_FROM_CONTRIB =)
+ $(info $(ORG_TO_LISP:lisp/%=%))
config-test config-all::
$(info )
$(info ========= Test configuration)
@@ -78,6 +88,9 @@ local.mk:
-@$(MAKE_LOCAL_MK)
all compile::
+ifneq ($(ORG_FROM_CONTRIB),)
+ $(CP) $(ORG_FROM_CONTRIB) lisp/
+endif
$(foreach dir, doc lisp, $(MAKE) -C $(dir) clean;)
compile compile-dirty::
$(MAKE) -C lisp $@
@@ -127,6 +140,12 @@ cleanall: cleandirs cleantest
$(CLEANDIRS:%=clean%):
-$(FIND) $(@:clean%=%) \( -name \*~ -o -name \*.elc \) -exec $(RM) {} \;
+ifneq ($(ORG_TO_LISP),)
+cleanlisp: cleanaddcontrib
+cleanaddcontrib:
+ $(RM) $(ORG_TO_LISP)
+endif
+
cleanutils: cleanUTILITIES
cleanrel: