summaryrefslogtreecommitdiff
path: root/rules/jdom1/Makefile
blob: f92bc292d7265b6cb54139cc07ec70ebd3ae2b30 (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
DESTDIR ?=
MAVEN_LOCAL_REPO ?= ~/.m2

ANT = ant
FIND = find
INSTALL = install
RM = rm -f
TOUCH = touch

artifactIds = jdom jdom-contrib
version     = 1.1.3
groupId     = org.jdom

all: PHONY dist-$(version)

dist-$(version): $(shell $(FIND) core contrib test -mindepth 1 \( -name build -o -name tmp \) -prune -o -print)
	$(ANT) -Dgpg=echo -Dversion=$(version) maven || { $(RM) -r $@ */build; exit 1; }
	$(TOUCH) $@

install-dir = $(DESTDIR)$(MAVEN_LOCAL_REPO)/$(subst .,/,$(groupId))/$(artifactId)/$(version)
install-targets = $(foreach artifactId,$(artifactIds),$(addprefix $(install-dir)/$(artifactId)-$(version),.pom .jar -sources.jar -javadoc.jar))
install: PHONY $(install-targets)

$(foreach target,$(install-targets),$(eval $(target): dist-$$(version)/$(notdir $(target)) ; $$(INSTALL) -Dm644 $$< $$@))
$(addprefix dist-$(version)/,$(notdir $(install-targets))): dist-$(version)
	test -e $@
	$(TOUCH) $@ 

clean: PHONY
	$(RM) -r dist-$(version) */build

.PHONY: PHONY