.POSIX: pod2man = \ share/man/man1/z.1 \ lisp-images = \ $(XDG_DATA_HOME)/lisp-cli/clisp.image \ $(XDG_DATA_HOME)/lisp-cli/sbcl.image \ derived-assets = \ $(pod2man) \ $(XDG_CONFIG_HOME)/ssh/id_rsa.pub \ $(XDG_DATA_HOME)/common-lisp/source \ $(XDG_DATA_HOME)/euandreh/e.list.txt \ $(lisp-images) all: $(derived-assets) share/man/man1/z.1: bin/z pod2man bin/z > $@ $(XDG_DATA_HOME)/common-lisp/source: ln -s $(SRC)/libre $@ $(XDG_CONFIG_HOME)/ssh/id_rsa.pub: gpg --export-ssh-key eu@euandre.org > $@ chmod 600 $@ $(XDG_DATA_HOME)/euandreh/e.list.txt: ~/Documents/txt/ opt/aux/gen-e-list.sh sh opt/aux/gen-e-list.sh > $@ $(lisp-images): $(XDG_CONFIG_HOME)/lisp-cli/init.lisp bin/cl I=`echo $@ | awk -F/ '$$0=$$(NF)' | cut -d. -f1` && cl \ -I $$I \ -v \ -e '(ql:quickload :trivial-dump-core)' \ -e '(trivial-dump-core:dump-image "$@")' \ -e '(uiop:quit)' check-shellcheck: git ls-files | \ xargs awk '/^#!\/bin\/sh$$/ { print FILENAME } { nextfile }' | \ xargs shellcheck -x check-perlcritic: git ls-files | \ xargs awk '/^#!\/usr\/bin\/env perl$$/ { print FILENAME } { nextfile }' | \ xargs perlcritic --exclude=subroutine check-fixme: if git grep FIXME -- ':(exclude)Makefile' ':(exclude)etc/git/ignore'; then \ printf 'Leftover FIXME markers.\n' >&2; \ exit 1; \ fi check-dirty-public: if ! git diff --quiet || ! git diff --quiet --staged; then \ printf 'Dirty tilde repository.\n' >&2; \ exit 1; \ fi check-dirty-private: if ! git -C $(PRIV_CONFIG) diff --quiet || \ ! git -C $(PRIV_CONFIG) diff --quiet --staged; then \ printf 'Dirty private tilde repository.\n' >&2; \ exit 1; \ fi check-opt: find opt/tests/ -name '*.sh' -exec {} + check-pod: podchecker bin/z check-sync: if git status --short --branch --porcelain | head -n1 | grep -E '(ahead|behind)'; then \ printf 'Out of sync with origin.\n' >&2; \ exit 1; \ fi check: check-shellcheck check-perlcritic check-fixme check-dirty-public \ check-dirty-private check-opt check-pod check-sync clean: rm -f $(derived-assets)