summaryrefslogtreecommitdiff
path: root/Makefile
blob: 8418fccab3a5b6eeaff66039ffd4d7b99f775d25 (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
prefix = /usr
bindir = $(prefix)/bin
jh-bindir = $(prefix)/lib/jh

subcommands = help list-commands mvn-basename mvn-install mvn-localrepo checksource
dirs = $(DESTDIR)$(bindir) $(DESTDIR)$(jh-bindir)

####

subcommand_files = $(addprefix jh-,$(subcommands))
help_files = $(addsuffix .help.txt,$(subcommand_files))

all: PHONY build

####

build: PHONY jh $(subcommand_files)
install: PHONY $(DESTDIR)$(bindir)/jh $(addprefix $(DESTDIR)$(jh-bindir)/,$(subcommand_files) $(help_files))
clean: PHONY
	rm -f jh $(subcommand_files)

jh.sh: jh.sh.in
	sed 's|@jh-bindir@|$(jh-bindir)|g' < $< > $@

$(DESTDIR)$(jh-bindir)/%: % | $(DESTDIR)$(jh-bindir)
	cp '$<' '$@'

$(DESTDIR)$(bindir)/jh: jh | $(DESTDIR)$(bindir)
	cp '$<' '$@'

$(dirs):
	install -d '$@'

####

.PHONY: PHONY FORCE
PHONY FORCE: ; @: