blob: ace89cf5ab7a0e0a6ee22d9be4a4e680e77b6bbf (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
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:
|