diff options
author | Luke Shumaker <LukeShu@sbcglobal.net> | 2014-06-12 21:06:09 -0400 |
---|---|---|
committer | Luke Shumaker <LukeShu@sbcglobal.net> | 2014-06-12 21:06:09 -0400 |
commit | 8c3608efb3feb10a1b1d32b9df3efa768d6f467f (patch) | |
tree | cf956783c269fb9599c4926ac99dffed8d7236e8 /rules/asm2 | |
parent | e1095b1afad2ab585326a85bf0ed58137878f6f4 (diff) |
add asm{1..3}
Diffstat (limited to 'rules/asm2')
-rw-r--r-- | rules/asm2/Makefile | 50 |
1 files changed, 50 insertions, 0 deletions
diff --git a/rules/asm2/Makefile b/rules/asm2/Makefile new file mode 100644 index 0000000..156651e --- /dev/null +++ b/rules/asm2/Makefile @@ -0,0 +1,50 @@ +DESTDIR ?= +MAVEN_LOCAL_REPO ?= ~/.m2 + +ANT = ant +EXISTS = test -e +FAIL = exit 1 +FIND = find +INSTALL = install +MKDIRS = mkdir -p +RM = rm -f +SED = sed +SYMLINK = ln -sf +TOUCH = touch + +artifactIds := $(patsubst archive/%.xml,%,$(wildcard archive/asm*.xml)) +version := $(shell $(SED) -n 's/^product\.version\s\s*//p' build.properties) +groupId := asm + +findjar = $(firstword $(foreach path,$(subst :, ,$(CLASSPATH)),$(if $(findstring $1,$(path)),$(path))) /notfound.jar) +ow_util_ant_tasks_jar = $(call findjar,ow_util_ant_tasks) + +all: PHONY output + +output: $(shell $(FIND) src) | test/lib + $(SED) -i -e '/^objectweb.ant.tasks.path/d' -e '$$aobjectweb.ant.tasks.path $(ow_util_ant_tasks_jar)' build.properties && \ + $(ANT) dist && \ + ( cd output/dist/lib && $(SYMLINK) all/* . ) || \ + { $(RM) -r $@; $(FAIL); } + $(TOUCH) $@ + +test/lib: + $(MKDIRS) $@ + +install-base = $(DESTDIR)$(MAVEN_LOCAL_REPO)/$(subst .,/,$(groupId))/$(artifactId)/$(version)/$(artifactId)-$(version) +install-jars = $(foreach artifactId,$(filter-out %-parent,$(artifactIds)),$(install-base).jar) +install-poms = $(foreach artifactId, $(artifactIds) ,$(install-base).pom) +install-targets = $(install-jars) $(install-poms) +install: PHONY $(install-targets) + +$(foreach target,$(install-targets),$(eval $(target): output/dist/lib/$(notdir $(target)) ; $$(INSTALL) -Dm644 $$< $$@)) +$(addprefix output/dist/lib/,$(notdir $(install-targets))): output + $(EXISTS) $@ + $(TOUCH) $@ + + +clean: PHONY + $(RM) -r output + +.PHONY: PHONY +.DELETE_ON_ERROR: |