From: Olof-Joachim Frahm Date: Sun, 11 Jan 2015 15:45:18 +0000 (+0000) Subject: Add more targets to Makefile and document them. X-Git-Tag: 0.1.0~2^2~24 X-Git-Url: http://repo.macrolet.net/gitweb/?p=crypto-install.git;a=commitdiff_plain;h=2af219c661ec227fdf5dc28ddeb1110e29e60d2e Add more targets to Makefile and document them. --- diff --git a/Makefile b/Makefile index 676a09d..abcce2f 100644 --- 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 diff --git a/README.md b/README.md index cad778f..50a36c8 100644 --- 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.