-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathMakefile
More file actions
56 lines (41 loc) · 1.46 KB
/
Makefile
File metadata and controls
56 lines (41 loc) · 1.46 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
VER=26
PREFIX = /usr/local
BINPROGS = \
termux-arch-chroot \
profile
# MANS = \
# doc/termux-arch-chroot.8 \
# doc/unchroot.8
BASH = bash
ZSHCOMP := $(wildcard completion/zsh/*)
BASHCOMP := $(wildcard completion/bash/*)
all: $(BINPROGS) man
man: $(MANS)
V_GEN = $(_v_GEN_$(V))
_v_GEN_ = $(_v_GEN_0)
_v_GEN_0 = @echo " GEN " $@;
edit = $(V_GEN) m4 -P $@.in >$@ && chmod go-w,+x $@
termux-arch-chroot: termux-arch-chroot.in common fstab-helpers.sh
$(edit)
profile: profile.in common
$(edit)
doc/%: doc/%.asciidoc doc/asciidoc.conf doc/footer.asciidoc
$(V_GEN) a2x --no-xmllint --asciidoc-opts="-f doc/asciidoc.conf" -d manpage -f manpage -D doc $<
clean:
$(RM) $(BINPROGS) $(MANS)
check: all
@for f in $(BINPROGS); do bash -O extglob -n $$f; done
@r=0; for t in test/test_*; do $(BASH) $$t || { echo $$t fail; r=1; }; done; exit $$r
shellcheck: $(BINPROGS)
shellcheck -W 99 --color $(BINPROGS)
shellcheck -W 99 --color -x test/test_*
install: all
install -d $(DESTDIR)$(PREFIX)/bin
install -m 0755 $(BINPROGS) $(DESTDIR)$(PREFIX)/bin
install -d $(DESTDIR)$(PREFIX)/share/zsh/site-functions
install -m 0644 $(ZSHCOMP) $(DESTDIR)$(PREFIX)/share/zsh/site-functions
install -d $(DESTDIR)$(PREFIX)/share/bash-completion/completions
install -m 0644 $(BASHCOMP) $(DESTDIR)$(PREFIX)/share/bash-completion/completions
install -d $(DESTDIR)$(PREFIX)/share/man/man8
install -m 0644 $(MANS) $(DESTDIR)$(PREFIX)/share/man/man8
.PHONY: all man clean check shellcheck install