summaryrefslogtreecommitdiff
path: root/rules
diff options
context:
space:
mode:
Diffstat (limited to 'rules')
-rw-r--r--rules/asm1/Makefile49
-rw-r--r--rules/asm2/Makefile50
l---------rules/asm31
l---------rules/ow-util-ant-tasks-bootstrap/Makefile1
-rw-r--r--rules/ow-util-ant-tasks-bootstrap/delete.list3
-rw-r--r--rules/ow-util-ant-tasks/Makefile26
-rw-r--r--rules/ow-util-ant-tasks/delete.list2
7 files changed, 132 insertions, 0 deletions
diff --git a/rules/asm1/Makefile b/rules/asm1/Makefile
new file mode 100644
index 0000000..32894c1
--- /dev/null
+++ b/rules/asm1/Makefile
@@ -0,0 +1,49 @@
+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
+TOUCH = touch
+
+artifactIds := $(patsubst archive/%.mf,%,$(wildcard archive/*.mf))
+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 || \
+ { $(RM) -r $@; $(FAIL); }
+ $(TOUCH) $@
+
+test/lib:
+ $(MKDIRS) $@
+
+install-base = $(DESTDIR)$(MAVEN_LOCAL_REPO)/$(subst .,/,$(groupId))/$(artifactId)/$(version)/$(artifactId)-$(version)
+install-jars = $(foreach artifactId,$(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-jars),$(eval $(target): output/dist/lib/$(notdir $(target)) ; $$(INSTALL) -Dm644 $$< $$@))
+$(foreach target,$(install-poms),$(eval $(target): output/dist/lib/$(patsubst %.pom,%.xml,$(notdir $(target))) ; $$(INSTALL) -Dm644 $$< $$@))
+$(addprefix output/dist/lib/,$(patsubst %.pom,%.xml,$(notdir $(install-targets)))): output
+ $(EXISTS) $@
+ $(TOUCH) $@
+
+
+clean: PHONY
+ $(RM) -r output
+
+.PHONY: PHONY
+.DELETE_ON_ERROR:
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:
diff --git a/rules/asm3 b/rules/asm3
new file mode 120000
index 0000000..d22cd68
--- /dev/null
+++ b/rules/asm3
@@ -0,0 +1 @@
+asm2 \ No newline at end of file
diff --git a/rules/ow-util-ant-tasks-bootstrap/Makefile b/rules/ow-util-ant-tasks-bootstrap/Makefile
new file mode 120000
index 0000000..8901f8e
--- /dev/null
+++ b/rules/ow-util-ant-tasks-bootstrap/Makefile
@@ -0,0 +1 @@
+../ow-util-ant-tasks/Makefile \ No newline at end of file
diff --git a/rules/ow-util-ant-tasks-bootstrap/delete.list b/rules/ow-util-ant-tasks-bootstrap/delete.list
new file mode 100644
index 0000000..5c63872
--- /dev/null
+++ b/rules/ow-util-ant-tasks-bootstrap/delete.list
@@ -0,0 +1,3 @@
+externals/*.jar
+output
+src/org/objectweb/util/ant/DependencyAnalyzer.java
diff --git a/rules/ow-util-ant-tasks/Makefile b/rules/ow-util-ant-tasks/Makefile
new file mode 100644
index 0000000..a93261b
--- /dev/null
+++ b/rules/ow-util-ant-tasks/Makefile
@@ -0,0 +1,26 @@
+DESTDIR ?=
+JAR_DIR ?= /usr/share/java
+
+ANT = ant
+EXISTS = test -e
+FAIL = exit 1
+FIND = find
+INSTALL = install
+RM = rm -f
+TOUCH = touch
+
+all: PHONY output/lib/ow_util_ant_tasks.jar
+
+output/lib/ow_util_ant_tasks.jar: $(shell $(FIND) src)
+ $(ANT) jar && $(EXISTS) $@ || { $(RM) -r output; $(FAIL); }
+
+install: PHONY $(DESTDIR)$(JAR_DIR)/ow_util_ant_tasks.jar
+
+$(DESTDIR)$(JAR_DIR)/ow_util_ant_tasks.jar: output/lib/ow_util_ant_tasks.jar
+ $(INSTALL) -Dm644 $< $@
+
+clean: PHONY
+ $(RM) -r output
+
+.PHONY: PHONY
+.DELETE_ON_ERROR:
diff --git a/rules/ow-util-ant-tasks/delete.list b/rules/ow-util-ant-tasks/delete.list
new file mode 100644
index 0000000..c8a023f
--- /dev/null
+++ b/rules/ow-util-ant-tasks/delete.list
@@ -0,0 +1,2 @@
+externals/*.jar
+output