DESTDIR ?= ANT = ant EXISTS = test -e FAIL = exit 1 FIND = find RM = rm -f XMLSTARLET = xml export MODELLO_CLASSPATH := $(shell modello-classpath) export PMDG_CLASSPATH := $(shell plexus-metadata-generator-classpath) export M2_HOME = $(DESTDIR)/opt/maven dep_dir = $1 $(shell $(FIND) $1 2>/dev/null) dep_optdir = $(shell $(FIND) $1 2>/dev/null) pom_get = $(shell $(XMLSTARLET) sel -T -t $(foreach xpath,$1, -v '$(subst /,/_:,$(xpath))' -n) pom.xml) version := $(call pom_get,/project/version) maven_assembly = apache-maven/target/apache-maven-$(version)-bin.zip install: PHONY $(ANT) -Dskip.pull=true extract-assembly || { $(RM) -r bootstrap/target; $(FAIL); } $(EXISTS) '$@' $(TOUCH) '$@' #### # install: extract-assembly # all: apache-maven/target/apache-maven-$(version)-bin.zip # bootstrap/target/generated-sources: $(call dep_dir,$(wildcard */src/main/mdo)) # $(ANT) -Dskip.pull=true generate-sources || { $(RM) -r '$@'; $(FAIL); } # $(TOUCH) '$@' # bootstrap/target/classes: $(call dep_dir,bootstrap/target/generated-sources $(wildcard */src/main/java)) # $(ANT) -Dskip.pull=true compile-boot || { $(RM) -r '$@'; $(FAIL); } # $(TOUCH) '$@' # bootstrap/target/classes/META-INF/plexus/components.xml: \ # $(call dep_dir,maven-compat/src/main/java) \ # $(call dep_dir,maven-core/src/main/resources/META-INF/plexus) \ # bootstrap/target/classes $(shell $(FIND) bootstrap/target/classes -name '*.class' -o -type d) # $(ANT) -Dskip.pull=true process-classes # $(EXISTS) '$@' # $(TOUCH) '$@' # modules = $(call pom_get,/project/modules/module) # apache-maven/target/apache-maven-$(version)-bin.zip: \ # bootstrap/target/classes/META-INF/plexus/components.xml \ # $(foreach module,. $(modules),$(module)/pom.xml $(call dep_dir,$(module)/src)) # $(ANT) -Dskip.pull=true maven-assembly # $(EXISTS) '$@' # $(TOUCH) '$@' .PHONY: PHONY .SECONDARY: .DELETE_ON_ERROR: