diff --git a/Makefile b/MMakefile similarity index 68% rename from Makefile rename to MMakefile index a551c2f5d10c5136f7a59785843f207df7792f54..ac2d21e77c8ae096c75a955c8077dd1b8b2c2227 100644 --- a/Makefile +++ b/MMakefile @@ -13,64 +13,73 @@ DIR_LIB = lib BIN_FILES := $(wildcard bin/mentat-*.py) all: help + check: pyflakes pylint test + #------------------------------------------------------------------------------- + help: $(info List of possible make targets:) $(info ) - $(info * all: alias for help, you have to pick a target [default]) - $(info * help: print this help and exit) - $(info * docs: generate all local project documentation) - $(info - docs-sphinx) - $(info * pyflakes: check source code with pyflakes) - $(info - pyflakes-bin) - $(info * pylint: check source code with pylint) - $(info - pylint-bin) - $(info * test: run unit tests with nosetest) + $(info * all: alias for help, you have to pick a target [default]) + $(info * help: print this help and exit) + $(info * docs: generate all local project documentation) + $(info = docs-sync) + $(info = docs-sphinx) + $(info * check: perform extensive code checking) + $(info = pyflakes: check source code with pyflakes) + $(info - pyflakes-bin) + $(info = pylint: check source code with pylint) + $(info - pylint-bin) + $(info = test: run unit tests with nosetest) $(info ) + #------------------------------------------------------------------------------- + docs: docs-sync docs-sphinx -# Synchronize directory contents docs-sync: FORCE - $(info Syncing documentation source code) + echo "*** Synchronizing documentation source code from submodules ***" rsync -r --progress --archive --update --delete --force ./submodules/pyzenkit/doc/_doclib/api_*.rst ./doc/sphinx/_doclib/ rsync -r --progress --archive --update --delete --force ./submodules/pyzenkit/doc/_doclib/_inc*.rst ./doc/sphinx/_doclib/ rsync -r --progress --archive --update --delete --force ./submodules/pynspect/doc/_doclib/api_*.rst ./doc/sphinx/_doclib/ #find ./ -type f -name *.pyc -exec rm -f {} \; -docs-sphinx: +docs-sphinx: FORCE + echo "*** Generating project documentation ***" #cd $(DIR_DOC)/sphinx && make clean #cd $(DIR_DOC)/sphinx && make apidoc cd $(DIR_DOC)/sphinx && make html - echo "Generated local project documentation" + #------------------------------------------------------------------------------- + pyflakes: pyflakes-bin pyflakes-bin: $(DIR_BIN)/mentat-*.py + echo "*** Checking code with pyflakes ***" PYTHONPATH=$(DIR_LIB) python3 -m pyflakes $(DIR_BIN)/mentat-*.py -#------------------------------------------------------------------------------- pylint: pylint-bin pylint-bin: $(DIR_BIN)/mentat-*.py - # Run pylint for each binary file separatelly - for fln in $(BIN_FILES); do \ - PYTHONPATH=$(DIR_LIB) python3 -m pylint $$fln --rcfile .pylintrc-bin; \ - done - -#------------------------------------------------------------------------------- + echo "*** Checking code with pylint ***" + PYTHONPATH=$(DIR_LIB) python3 -m pylint --rcfile .pylintrc-bin $(DIR_BIN) test: + echo "*** Checking code with nosetests ***" nosetests $(DIR_LIB) + +#------------------------------------------------------------------------------- + + # Empty rule as dependency wil force make to always perform target # Source: https://www.gnu.org/software/make/manual/html_node/Force-Targets.html FORCE: