Makefile
1.29 KB
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
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
SUBCOMMANDS = random \
rand_printable \
amngrdbinit \
amngrdbdestroy \
amngradd \
amngrcreate \
amngrcrypt \
amngrdelete \
amngrgen \
amngrgetoldpass \
amngrgetolduser \
amngrgetpass \
amngrgetuser \
amngrid \
amngrlist \
amngrrename \
amngrsearch
PREFIX ?= /usr
DESTDIR ?=
export PREFIX DESTDIR
PROGRAM = accountmanager.sh
DIST_FILES = doc/Makefile \
doc/accountmanager.1 \
$(PROGRAM) \
Makefile \
README.md \
LICENSE \
VERSION \
AUTHORS
all: doc
README_new.md: doc/accountmanager.1
groff -D utf8 -mandoc -Thtml "$<" |\
pandoc -f html -t markdown_strict >"$@"
.PHONY: clean install doc dist
dist: ARCHIVE_NAME = $(basename $(PROGRAM))-`cat VERSION`
dist: clean $(DIST_FILES)
tar cvf - --xform="s/^/$(ARCHIVE_NAME)\//" $(DIST_FILES) | \
bzip2 -9 -c >$(ARCHIVE_NAME).tar.bz2
doc:
+make -C doc
install_doc: doc
+make -C doc install
install_$(PROGRAM):
@+install -D "$(PROGRAM)" "$(DESTDIR)/$(PREFIX)/bin/$(PROGRAM)"
install_%: install_$(PROGRAM)
@+ln -s "$(realpath ${DESTDIR}/${PREFIX}/bin/$(PROGRAM))" \
"${DESTDIR}/$(PREFIX)/bin/$(subst install_,,$@)"
install: $(patsubst %,install_%,$(SUBCOMMANDS)) install_doc
clean:
+make -C doc clean