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

ANT = ant
EXISTS = test -e
FAIL = exit 1
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; $(FAIL); }
	$(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)
	$(EXISTS) $@
	$(TOUCH) $@ 

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

.PHONY: PHONY
.DELETE_ON_ERROR:
.SECONDARY: