From a90ff91350904de6692864ed43da1c161260b461 Mon Sep 17 00:00:00 2001 From: Achim Gratz Date: Wed, 22 Aug 2012 08:04:56 +0200 Subject: [PATCH] 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. --- default.mk | 4 ++++ targets.mk | 19 +++++++++++++++++++ 2 files changed, 23 insertions(+) diff --git a/default.mk b/default.mk index 27d487936..483d1de39 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 c1c6c4281..b69e55b48 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: -- 2.11.4.GIT