summaryrefslogtreecommitdiff
path: root/rules
diff options
context:
space:
mode:
authorLuke Shumaker <lukeshu@sbcglobal.net>2014-07-22 14:38:01 -0400
committerLuke Shumaker <lukeshu@sbcglobal.net>2014-07-22 14:38:01 -0400
commitbe92521ffff0964ad6ab7583fa61279098540256 (patch)
treeee59dd60c75e9b493e86182ee453e80c9ce4c424 /rules
parent3e636fad315b719b880655e3eec039b45204f14c (diff)
get cglib to build
Diffstat (limited to 'rules')
-rw-r--r--rules/cglib/Makefile45
-rw-r--r--rules/jarjar/Makefile60
-rw-r--r--rules/jarjar/delete.list1
3 files changed, 106 insertions, 0 deletions
diff --git a/rules/cglib/Makefile b/rules/cglib/Makefile
new file mode 100644
index 0000000..38c91f6
--- /dev/null
+++ b/rules/cglib/Makefile
@@ -0,0 +1,45 @@
+DESTDIR ?=
+JAR_DIR ?= /usr/share/java
+
+ANT = ant
+EGREP = grep -E
+EXISTS = test -e
+FAIL = exit 1
+FIND = find
+INSTALL = install
+PRINTF = printf
+RM = rm -f
+TOUCH = touch
+
+version = 3.1
+
+dep_dir = $1 $(shell $(FIND) $1 2>/dev/null)
+findjar = $(firstword $(shell IFS=:; $(PRINTF) '%s\n' $$CLASSPATH | $(EGREP) '/$1(-[0-9.-]*)?\.jar$$') /notfound.jar)
+asm_jar = $(call findjar,asm)
+
+all: PHONY dist
+
+dist: $(call dep_dir,src xdocs) lib/asm-4.2.jar
+ $(RM) -r $@ build
+ $(ANT) dist || { $(RM) -r $@ build; $(FAIL); }
+ $(EXISTS) $@
+ $(TOUCH) $@
+
+dist/%.jar: dist
+ $(EXISTS) $@
+ $(TOUCH) $@
+
+lib/asm-4.2.jar: $(asm_jar)
+ $(INSTALL) -Dm644 $< $@
+
+install: PHONY dist $(foreach n,cglib cglib-docs cglib-nodep cglib-src,$(DESTDIR)$(JAR_DIR)/$n-$(version).jar)
+
+$(DESTDIR)$(JAR_DIR)/%.jar: dist/%.jar
+ $(INSTALL) -Dm644 $< $@
+
+clean: PHONY
+ $(RM) -r dist build lib/*.jar
+
+.PHONY: PHONY
+.DELETE_ON_ERROR:
+.SECONDARY:
diff --git a/rules/jarjar/Makefile b/rules/jarjar/Makefile
new file mode 100644
index 0000000..ace89cf
--- /dev/null
+++ b/rules/jarjar/Makefile
@@ -0,0 +1,60 @@
+DESTDIR ?=
+JAR_DIR ?= /usr/share/java
+MAVEN_LOCAL_REPO ?= ~/.m2
+
+ANT = ant
+EGREP = grep -E
+EXISTS = test -e
+FAIL = exit 1
+FIND = find
+INSTALL = install
+PRINTF = printf
+RM = rm -f
+TOUCH = touch
+
+artifactId = jarjar-plugin
+version = 1.4
+groupId = com.tonicsystems.jarjar
+
+dep_dir = $1 $(shell $(FIND) $1 2>/dev/null)
+
+findjar = $(firstword $(shell IFS=:; $(PRINTF) '%s\n' $$CLASSPATH | $(EGREP) '/$1(-[0-9.-]*)?\.jar$$') /notfound.jar)
+asm_jar = $(call findjar,asm)
+asm_commons_jar = $(call findjar,asm-commons)
+
+all: PHONY dist
+
+dist: $(call dep_dir,src maven) lib/asm-4.0.jar lib/asm-commons-4.0.jar
+ $(RM) -r $@ build
+ # javadoc doesn't work; hence using 'jar' instead of 'dist'
+ $(ANT) jar mojo || { $(RM) -r $@ build; $(FAIL); }
+ $(TOUCH) $@
+
+lib/asm-4.0.jar: $(asm_jar)
+ $(INSTALL) -Dm644 $< $@
+lib/asm-commons-4.0.jar: $(asm_commons_jar)
+ $(INSTALL) -Dm644 $< $@
+
+dist/%.jar: dist
+ $(EXISTS) $@
+ $(TOUCH) $@
+dist/maven/pom.xml: dist
+ $(EXISTS) $@
+ $(TOUCH) $@
+
+install-base = $(DESTDIR)$(MAVEN_LOCAL_REPO)/$(subst .,/,$(groupId))/$(artifactId)/$(version)/$(artifactId)-$(version)
+install: PHONY $(install-base).pom $(install-base).jar $(DESTDIR)$(JAR_DIR)/jarjar-$(version).jar
+
+$(install-base).pom: dist/maven/pom.xml
+ $(INSTALL) -Dm644 $< $@
+$(install-base).jar: dist/jarjar-plugin-$(version).jar
+ $(INSTALL) -Dm644 $< $@
+$(DESTDIR)$(JAR_DIR)/jarjar-$(version).jar: dist/jarjar-$(version).jar
+ $(INSTALL) -Dm644 $< $@
+
+clean: PHONY
+ $(RM) -r dist build lib/*.jar
+
+.PHONY: PHONY
+.DELETE_ON_ERROR:
+.SECONDARY:
diff --git a/rules/jarjar/delete.list b/rules/jarjar/delete.list
new file mode 100644
index 0000000..8c5987b
--- /dev/null
+++ b/rules/jarjar/delete.list
@@ -0,0 +1 @@
+lib/*.jar