Add more targets to Makefile and document them.
authorOlof-Joachim Frahm <olof@macrolet.net>
Sun, 11 Jan 2015 15:45:18 +0000 (15:45 +0000)
committerOlof-Joachim Frahm <olof@macrolet.net>
Sun, 11 Jan 2015 15:45:39 +0000 (15:45 +0000)
Makefile
README.md

index 676a09d..abcce2f 100644 (file)
--- a/Makefile
+++ b/Makefile
@@ -1,9 +1,24 @@
-all: build
-       @sed \
+all: check test build/crypto-install.py
+
+run: build/crypto-install.py
+       build/crypto-install.py
+
+check:
+       pep8 .
+
+test:
+       ./setup.py test
+
+build:
+       mkdir build
+
+build/crypto-install.py: crypto-install.py build
+       sed \
                -e "s/GIT-TAG/`git describe --abbrev=0 --tags`/g" \
                -e "s/GIT-COMMIT/`git rev-parse --short=7 HEAD`/g" \
                -e "s/GIT-BRANCH/`git rev-parse --abbrev-ref HEAD`/g" \
-               crypto-install.py > build/crypto_install.py
+               crypto-install.py > build/crypto-install.py
+       chmod a+rx build/crypto-install.py
 
-build:
-       mkdir build
+clean:
+       rm -rf build
index cad778f..50a36c8 100644 (file)
--- a/README.md
+++ b/README.md
@@ -33,3 +33,17 @@ Until I set up a better routine:
 
 Simply copy the built file into your path and possibly ensure execution
 permissions.
+
+# DEVELOPMENT
+
+There is a `Makefile` available to run common commands, e.g.:
+
+    make # checks PEP8, runs tests, builds final file
+    make run # run the built program
+    make clean # remove build folder
+
+If you have [`git-hooks`](https://github.com/icefox/git-hooks)
+installed, then the two hooks in `git_hooks` will run the tests and
+check for PEP8 compatibility before committing as well.  Run
+`git hooks --install` in the checked out folder to register the hooks
+initially.