summaryrefslogtreecommitdiff
path: root/Makefile
diff options
context:
space:
mode:
authorLuke Shumaker <lukeshu@sbcglobal.net>2014-07-25 21:24:37 -0400
committerLuke Shumaker <lukeshu@sbcglobal.net>2014-07-25 21:24:37 -0400
commite89a74700c8a7db01f07a405f583e6399ba7da16 (patch)
treed45b73bf49bf9f05b39d6ff0d73cf9fe9aa931f2 /Makefile
parent827be127213f3697f954dabf7cc67a5e075bed5e (diff)
Add janino. Required creating a 'union' type for sources.mk.
Diffstat (limited to 'Makefile')
-rw-r--r--Makefile22
1 files changed, 20 insertions, 2 deletions
diff --git a/Makefile b/Makefile
index 6435439..3a11d2c 100644
--- a/Makefile
+++ b/Makefile
@@ -35,13 +35,17 @@ dep_optdir = $(shell $(FIND) $1 2>/dev/null)
# configuration ################################################################
-packages := $(filter-out _%,$(shell $(SED) "s/[\# ].*//" conf/sources.mk))
+# Load conf/sources.mk
+variables := $(shell $(SED) "s/[\# ].*//" conf/sources.mk)
include conf/sources.mk
+# Load other configuration files
include conf/dependencies.mk
export MAVEN_LOCAL_REPO := $(shell $(CAT) conf/maven.local.repo.txt)
export JAR_DIR := $(shell $(CAT) conf/jardir.txt)
-specs := $(foreach package,$(packages),$($(package)))
+# Post-processing for conf/sources.mk
+packages := $(filter-out _%,$(variables))
+specs := $(foreach variable,$(variables),$(findstring |,$($(variable))))
tarbombs := $(addprefix build/extract/,$(call spec2,base,$(_tarbombs)))
# download #####################################################################
@@ -118,6 +122,12 @@ build/extract/tar/%: # magic foreach loop
( cd '$(_tar_basedir)' && $(TAR) -m $(if $(filter $(_tar_basedir),$(tarbombs)),,--strip-components 1) -xf '$(top)/$<' ); \
} || { $(RM) -r '$(_tar_basedir)'; $(FAIL); }
+# union
+build/extract/union/%: # magic foreach loop
+ $(RM) -r '$@'
+ $(MKDIRS) '$@' && $(CP) -a $(foreach d,$(filter build/extract/%,$^),'$d'/*) '$@/' || { $(RM) -r '$@'; $(FAIL); }
+ $(TOUCH) '$@'
+
# magic foreach loop (git, tar)
$(foreach spec,$(call specs_for,git tar), \
$(eval \
@@ -126,6 +136,14 @@ $(foreach spec,$(call specs_for,git tar), \
) \
)
+# magic foreach loop (union)
+$(foreach spec,$(call specs_for,union), \
+ $(eval \
+ build/extract/$(call spec2,file,$(spec)): \
+ $(addprefix build/extract/,$(call name2,file,$(subst :, ,$(call spec2,url,$(spec))))) \
+ ) \
+ )
+
# place (patch) ################################################################
place: PHONY $(addprefix build/workdir/,$(packages))