prefix = /usr bindir = $(prefix)/bin # pkgdatadir is hardcoded into jh.sh pkgdatadir = /usr/share/jh subcommands = help list-commands mvn-basename mvn-install mvn-localrepo checksource dirs = $(DESTDIR)$(bindir) $(DESTDIR)$(pkgdatadir) #### 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)$(pkgdatadir)/,$(subcommand_files) $(help_files)) clean: PHONY rm -f jh $(subcommand_files) $(DESTDIR)$(pkgdatadir)/%: % | $(DESTDIR)$(pkgdatadir) cp '$<' '$@' $(DESTDIR)$(bindir)/jh: jh | $(DESTDIR)$(bindir) cp '$<' '$@' $(dirs): install -d '$@' #### .PHONY: PHONY FORCE PHONY FORCE: ; @: