summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--Makefile29
-rw-r--r--conf/dependencies.mk9
-rw-r--r--makefiles/xbean-reflect.mk2
3 files changed, 31 insertions, 9 deletions
diff --git a/Makefile b/Makefile
index 8e2d008..bceb9a1 100644
--- a/Makefile
+++ b/Makefile
@@ -1,8 +1,12 @@
top := $(shell pwd)
all: package
+
+# configuration ################################################################
+
packages := $(filter-out _%,$(shell sed "s/[\# ].*//" conf/sources.mk))
include conf/sources.mk
+include conf/dependencies.mk
export MAVEN_LOCAL_REPO := $(shell cat conf/maven.local.repo.txt)
# download #####################################################################
@@ -64,7 +68,7 @@ build/extract/tar/%: build/download/tar/%
cd '$@' && bsdtar --strip-components 1 -xf '$(top)/$<'
cd '$@' && git init && git add . && git commit -q -m 'extracted $(shell utils/file2url 'tar/$*')' # XXX
-# place ########################################################################
+# place (patch) ################################################################
place: PHONY $(addprefix,build/compile/,$(packages))
@@ -95,13 +99,24 @@ package: PHONY $(addprefix build/packages/,$(packages))
package_specific=$(filter $(patsubst makefiles/%.mk,%,$(wildcard makefiles/*.mk)),$(packages))
package_generic =$(filter-out $(patsubst makefiles/%.mk,%,$(wildcard makefiles/*.mk)),$(packages))
-$(addprefix build/packages/,$(package_specific)): build/packages/%: RECURSIVE build/compile/% makefiles/%.mk
- $(MAKE) -C build/compile/$* -f "$(top)/makefiles/$*.mk" install DESTDIR="$(top)/$@"
- mkdir -p build/packages/dest && lndir -silent "$(top)/$@" build/packages/dest
+dirs2jars = $(if $1,$(shell find $1 -name '*.jar'))
+deps2jars = $(filter %.jar,$1) $(call dirs2jars,$(filter build/packages/%,$1))
+deps2classpath = $(shell echo $(abspath $(call deps2jars,$1)) | tr ' ' :)
+
+$(addprefix build/packages/,$(package_specific)): \
+build/packages/%: RECURSIVE build/compile/% makefiles/%.mk
+ $(MAKE) -C build/compile/$* -f '$(top)/makefiles/$*.mk' install
+ DESTDIR='$(top)/$@' \
+ CLASSPATH='$(call deps2classpath,$^)'
+ mkdir -p build/packages/dest && lndir -silent '$(top)/$@' build/packages/dest
+
-$(addprefix build/packages/,$(package_generic)): build/packages/%: RECURSIVE build/compile/% makefiles/mvn-simple.mk
- $(MAKE) -C build/compile/$* -f "$(top)/makefiles/mvn-simple.mk" install DESTDIR="$(top)/$@"
- mkdir -p build/packages/dest && lndir -silent "$(top)/$@" build/packages/dest
+$(addprefix build/packages/,$(package_generic)): \
+build/packages/%: RECURSIVE build/compile/% makefiles/mvn-simple.mk
+ $(MAKE) -C build/compile/$* -f '$(top)/makefiles/mvn-simple.mk' install \
+ DESTDIR='$(top)/$@' \
+ CLASSPATH='$(call deps2classpath,$^)'
+ mkdir -p build/packages/dest && lndir -silent '$(top)/$@' build/packages/dest
# dependencies #################################################################
diff --git a/conf/dependencies.mk b/conf/dependencies.mk
new file mode 100644
index 0000000..9149007
--- /dev/null
+++ b/conf/dependencies.mk
@@ -0,0 +1,9 @@
+build/packages/modello: \
+ build/packages/maven-plugin-tools
+
+build/packages/maven-plugin-tools: \
+ build/packages/plexus-component-annotations
+
+build/packages/xbean-reflect: \
+ /usr/share/java/commons-logging/commons-logging.jar \
+ /usr/share/java/asm-all-2.jar
diff --git a/makefiles/xbean-reflect.mk b/makefiles/xbean-reflect.mk
deleted file mode 100644
index 2a16169..0000000
--- a/makefiles/xbean-reflect.mk
+++ /dev/null
@@ -1,2 +0,0 @@
-CLASSPATH=/usr/share/java/commons-logging/commons-logging.jar:/usr/share/java/asm-all-2.jar
-include $(dir $(abspath $(lastword $(MAKEFILE_LIST))))/mvn-simple.mk