Commit 8a20eca3ab667b079f0fcaf52b5e4cf8bb066460

Authored by Georg Hopp
1 parent adf3b693

Add installation of man page

Showing 2 changed files with 29 additions and 5 deletions
@@ -16,21 +16,31 @@ SUBCOMMANDS = random \ @@ -16,21 +16,31 @@ SUBCOMMANDS = random \
16 amngrrename \ 16 amngrrename \
17 amngrsearch 17 amngrsearch
18 18
19 -PREFIX ?= /usr/local 19 +PREFIX ?= /usr
  20 +DESTDIR ?=
  21 +
  22 +export PREFIX DESTDIR
20 23
21 PROGRAM := accountmanager.sh 24 PROGRAM := accountmanager.sh
22 25
23 -all: 26 +all: doc
  27 +
  28 +.PHONY: clean install doc
  29 +
  30 +doc:
  31 + make -C doc
24 32
25 -.PHONY: clean install 33 +install_doc: doc
  34 + make -C doc install
26 35
27 install_$(PROGRAM): 36 install_$(PROGRAM):
28 - @install "$(PROGRAM)" "$(DESTDIR)/$(PREFIX)/bin/$(PROGRAM)" 37 + @install -D "$(PROGRAM)" "$(DESTDIR)/$(PREFIX)/bin/$(PROGRAM)"
29 38
30 install_%: 39 install_%:
31 @ln -s "$(realpath ${DESTDIR}/${PREFIX}/bin/$(PROGRAM))" \ 40 @ln -s "$(realpath ${DESTDIR}/${PREFIX}/bin/$(PROGRAM))" \
32 "${DESTDIR}/$(PREFIX)/bin/$(subst install_,,$@)" 41 "${DESTDIR}/$(PREFIX)/bin/$(subst install_,,$@)"
33 42
34 -install: install_$(PROGRAM) $(patsubst %,install_%,$(SUBCOMMANDS)) 43 +install: install_$(PROGRAM) $(patsubst %,install_%,$(SUBCOMMANDS)) install_doc
35 44
36 clean: 45 clean:
  46 + make -C doc clean
  1 +all: doc
  2 +
  3 +accountmanager.1.bz2: accountmanager.1
  4 + bzip2 -c -9 $< >$@
  5 +
  6 +.PHONY: all clean install doc
  7 +
  8 +doc: accountmanager.1.bz2
  9 +
  10 +install: accountmanager.1.bz2
  11 + @install -D -m 0644 "$<" "$(DESTDIR)/$(PREFIX)/share/man/man1/$<"
  12 +
  13 +clean:
  14 + @rm -f accountmanager.1.bz2
Please register or login to post a comment