diff options
Diffstat (limited to 'rules/cglib/Makefile')
-rw-r--r-- | rules/cglib/Makefile | 45 |
1 files changed, 45 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: |