future-install-scripts/Makefile

62 lines
1.5 KiB
Makefile
Raw Permalink Normal View History

VER=26
PREFIX = /usr
2012-06-19 01:06:17 +08:00
BINPROGS = \
future-chroot \
2012-06-19 01:06:17 +08:00
genfstab \
pacstrap
2019-06-04 14:02:52 +08:00
MANS = \
doc/future-chroot.8 \
2019-06-04 14:02:52 +08:00
doc/genfstab.8 \
doc/pacstrap.8
BASH = bash
ZSHCOMP := $(wildcard completion/zsh/*)
BASHCOMP := $(wildcard completion/bash/*)
2019-06-04 13:59:58 +08:00
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 $@
future-chroot: future-chroot.in common
$(edit)
genfstab: genfstab.in fstab-helpers
$(edit)
pacstrap: pacstrap.in common
$(edit)
doc/%: doc/%.asciidoc doc/asciidoc.conf
2019-06-04 13:59:58 +08:00
$(V_GEN) a2x --no-xmllint --asciidoc-opts="-f doc/asciidoc.conf" -d manpage -f manpage -D doc $<
clean:
2019-06-04 13:59:58 +08:00
$(RM) $(BINPROGS) $(MANS)
check: all
2013-12-09 01:16:58 +08:00
@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)/sbin
install -m 0755 $(BINPROGS) $(DESTDIR)$(PREFIX)/sbin
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