summaryrefslogtreecommitdiff
path: root/rules/jsr305/Makefile
blob: 70c4a513d6d79ba4c3a35679c8113a05345a3590 (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
DESTDIR ?=
JAR_DIR ?= /usr/share/java

ANT = ant
EXISTS = test -e
FAIL = exit 1
FIND = find
INSTALL = install
RM = rm -f
TOUCH = touch

all: PHONY build

build: $(shell $(FIND) src)
	$(ANT) jars || { $(RM) -r build; $(FAIL); }
	$(TOUCH) $@

install-dir = $(DESTDIR)$(JAR_DIR)/jsr305
install-targets = $(addprefix $(install-dir)/jsr305,.jar -pure.jar -src.jar)
install: PHONY $(install-targets)

$(install-targets): $(install-dir)/%: build/%
	$(INSTALL) -Dm644 $< $@

$(patsubst $(install-dir)/%,build/%,$(install-targets)): build/%: build
	$(EXISTS) $@
	$(TOUCH) $@

clean: PHONY
	$(RM) -r build

.PHONY: PHONY
.DELETE_ON_ERROR:
.SECONDARY: