2022-09-29 00:47:56 +08:00
|
|
|
VER=26
|
2012-06-18 17:07:37 +08:00
|
|
|
|
|
|
|
PREFIX = /usr/local
|
|
|
|
|
2012-06-19 01:06:17 +08:00
|
|
|
BINPROGS = \
|
|
|
|
arch-chroot \
|
|
|
|
genfstab \
|
|
|
|
pacstrap
|
2012-06-18 17:07:37 +08:00
|
|
|
|
2019-06-04 14:02:52 +08:00
|
|
|
MANS = \
|
|
|
|
doc/arch-chroot.8 \
|
|
|
|
doc/genfstab.8 \
|
|
|
|
doc/pacstrap.8
|
|
|
|
|
2014-12-15 21:38:43 +08:00
|
|
|
BASH = bash
|
2023-03-25 05:50:24 +08:00
|
|
|
ZSHCOMP := $(wildcard completion/zsh/*)
|
2023-03-25 03:12:32 +08:00
|
|
|
BASHCOMP := $(wildcard completion/bash/*)
|
2014-12-15 21:38:43 +08:00
|
|
|
|
2019-06-04 13:59:58 +08:00
|
|
|
all: $(BINPROGS) man
|
|
|
|
man: $(MANS)
|
2012-06-18 17:07:37 +08:00
|
|
|
|
2012-09-08 04:32:39 +08:00
|
|
|
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 $@
|
|
|
|
|
2012-12-12 22:04:45 +08:00
|
|
|
%: %.in common
|
2012-09-08 04:32:39 +08:00
|
|
|
$(edit)
|
2012-06-18 17:07:37 +08:00
|
|
|
|
2019-06-04 13:59:58 +08:00
|
|
|
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 $<
|
|
|
|
|
2012-06-18 17:07:37 +08:00
|
|
|
clean:
|
2019-06-04 13:59:58 +08:00
|
|
|
$(RM) $(BINPROGS) $(MANS)
|
2012-06-18 17:07:37 +08:00
|
|
|
|
2013-05-27 03:47:56 +08:00
|
|
|
check: all
|
2013-12-09 01:16:58 +08:00
|
|
|
@for f in $(BINPROGS); do bash -O extglob -n $$f; done
|
2014-12-15 21:38:43 +08:00
|
|
|
@r=0; for t in test/test_*; do $(BASH) $$t || { echo $$t fail; r=1; }; done; exit $$r
|
2013-05-27 03:47:56 +08:00
|
|
|
|
2023-03-25 03:22:04 +08:00
|
|
|
shellcheck: $(BINPROGS)
|
|
|
|
shellcheck -W 99 --color $(BINPROGS)
|
|
|
|
shellcheck -W 99 --color -x test/test_*
|
|
|
|
|
2012-07-15 22:07:26 +08:00
|
|
|
install: all
|
2023-03-25 03:12:32 +08:00
|
|
|
install -d $(DESTDIR)$(PREFIX)/bin
|
|
|
|
install -m 0755 $(BINPROGS) $(DESTDIR)$(PREFIX)/bin
|
|
|
|
install -d $(DESTDIR)$(PREFIX)/share/zsh/site-functions
|
2023-03-25 05:50:24 +08:00
|
|
|
install -m 0644 $(ZSHCOMP) $(DESTDIR)$(PREFIX)/share/zsh/site-functions
|
2023-03-25 03:12:32 +08:00
|
|
|
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
|
2012-06-18 17:07:37 +08:00
|
|
|
|
2023-03-25 03:22:04 +08:00
|
|
|
.PHONY: all man clean check shellcheck install
|