Add Makefile
This commit is contained in:
parent
5c546104cf
commit
13a31da9a0
|
@ -0,0 +1,56 @@
|
||||||
|
.phony: all setup tangle compile lint clean
|
||||||
|
|
||||||
|
all: setup tangle compile lint
|
||||||
|
|
||||||
|
setup:
|
||||||
|
emacs --batch --eval="(package-initialize)" \
|
||||||
|
--eval="(mapcar #'package-install '(indent-lint package-lint relint))"
|
||||||
|
|
||||||
|
# No -q or -Q without ORG_PATH - if the user has a newer version of
|
||||||
|
# Org, we want to use it.
|
||||||
|
init-org.el:
|
||||||
|
if [ -z "${ORG_PATH}" ]; then \
|
||||||
|
echo ; \
|
||||||
|
echo "[WARNING] ORG_PATH is unset. Org versions older than 9.3.8 have a bug" ; \
|
||||||
|
echo "which result in them always using absolute paths in comment links in" ; \
|
||||||
|
echo "tangled source files. If your Org version is older than 9.3.8, please" ; \
|
||||||
|
echo "upgrade it before tangling." ; \
|
||||||
|
echo ; \
|
||||||
|
emacs --batch \
|
||||||
|
--eval="(require 'ob-tangle)" \
|
||||||
|
--eval='(org-babel-tangle-file "init.org")' ; \
|
||||||
|
else \
|
||||||
|
emacs -q -Q --batch \
|
||||||
|
--eval="(add-to-list 'load-path \"${ORG_PATH}\")" \
|
||||||
|
--eval="(require 'ob-tangle)" \
|
||||||
|
--eval='(org-babel-tangle-file "init.org")' ; \
|
||||||
|
fi
|
||||||
|
|
||||||
|
tangle: init-org.el
|
||||||
|
|
||||||
|
compile: tangle
|
||||||
|
emacs -q -Q --batch --eval='(byte-compile-file "init-org.el")' ; \
|
||||||
|
|
||||||
|
lint-check-declare: tangle
|
||||||
|
emacs -q -Q --batch --eval='(check-declare-file "init-org.el")'
|
||||||
|
|
||||||
|
lint-checkdoc: tangle
|
||||||
|
emacs -q -Q --batch --eval='(checkdoc-file "init-org.el")'
|
||||||
|
|
||||||
|
lint-package-lint: setup tangle
|
||||||
|
emacs -Q --batch --eval='(package-initialize)' \
|
||||||
|
--eval="(require 'package-lint)" \
|
||||||
|
-f 'package-lint-batch-and-exit' init-org.el
|
||||||
|
|
||||||
|
lint-relint: setup tangle
|
||||||
|
emacs -q -Q --batch --eval='(relint-file "init-org.el")'
|
||||||
|
|
||||||
|
lint: lint-check-declare lint-checkdoc lint-package-lint lint-relint
|
||||||
|
|
||||||
|
clean-tangle:
|
||||||
|
-rm init-org.el
|
||||||
|
|
||||||
|
clean-elc:
|
||||||
|
-rm *.elc
|
||||||
|
|
||||||
|
clean: clean-elc
|
Loading…
Reference in New Issue