diff --git a/MMakefile b/MMakefile index ac2d21e77c8ae096c75a955c8077dd1b8b2c2227..18b7c9942e7377fb6e8216ae0e75695e95582c96 100644 --- a/MMakefile +++ b/MMakefile @@ -12,29 +12,54 @@ DIR_LIB = lib BIN_FILES := $(wildcard bin/mentat-*.py) +# +# Color code definitions for colored terminal output +# https://stackoverflow.com/questions/5947742/how-to-change-the-output-color-of-echo-in-linux +# +RED=\033[0;31m +GREEN=\033[0;32m +ORANGE=\033[0;33m +NC=\033[0m + +#------------------------------------------------------------------------------- + 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-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 ) +#@echo -e "\033[0;32m [OK] \033[0m \033[0;33m Compiling:\033[0m" $< + + @echo "" + @echo "${RED}LIST OF MAKE TARGETS:${NC}" + @echo "" + @echo " * ${GREEN}all${NC}: alias for help, you have to pick a target [default]" + @echo " * ${GREEN}help${NC}: print this help and exit" + @echo " * ${GREEN}deps${NC}: install various dependencies" + @echo " = ${ORANGE}deps-python${NC}: install Python dependencies with pip3" + @echo " * ${GREEN}docs${NC}: generate local project documentation" + @echo " = ${ORANGE}docs-sync${NC}: synchronize documentation from submodules" + @echo " = ${ORANGE}docs-sphinx${NC}: generate local project documentation " + @echo " * ${GREEN}check${NC}: perform extensive code checking" + @echo " = ${ORANGE}pyflakes${NC}: check source code with pyflakes" + @echo " - pyflakes-bin" + @echo " = ${ORANGE}pylint${NC}: check source code with pylint" + @echo " - pylint-bin" + @echo " = ${ORANGE}test${NC}: run unit tests with nosetest" + @echo "" + + +#------------------------------------------------------------------------------- + + +deps: deps-python + +deps-python: FORCE + @echo "\n${GREEN}*** Installing Python dependencies ***${NC}\n" + @pip3 install -r conf/requirements.pip --upgrade #------------------------------------------------------------------------------- @@ -43,17 +68,17 @@ help: docs: docs-sync docs-sphinx docs-sync: FORCE - 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 {} \; + @echo "\n${GREEN}*** Synchronizing documentation source code from submodules ***${NC}\n" + @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: FORCE - echo "*** Generating project documentation ***" - #cd $(DIR_DOC)/sphinx && make clean - #cd $(DIR_DOC)/sphinx && make apidoc - cd $(DIR_DOC)/sphinx && make html + @echo "\n${GREEN}*** Generating project documentation ***${NC}\n" + @#cd $(DIR_DOC)/sphinx && make clean + @#cd $(DIR_DOC)/sphinx && make apidoc + @cd $(DIR_DOC)/sphinx && make html #------------------------------------------------------------------------------- @@ -62,18 +87,18 @@ docs-sphinx: FORCE pyflakes: pyflakes-bin pyflakes-bin: $(DIR_BIN)/mentat-*.py - echo "*** Checking code with pyflakes ***" + @echo "\n${GREEN}*** Checking code with pyflakes ***${NC}\n" PYTHONPATH=$(DIR_LIB) python3 -m pyflakes $(DIR_BIN)/mentat-*.py pylint: pylint-bin pylint-bin: $(DIR_BIN)/mentat-*.py - echo "*** Checking code with pylint ***" + @echo "\n${GREEN}*** Checking code with pylint ***${NC}\n" PYTHONPATH=$(DIR_LIB) python3 -m pylint --rcfile .pylintrc-bin $(DIR_BIN) test: - echo "*** Checking code with nosetests ***" + @echo "\n${GREEN}*** Checking code with nosetests ***${NC}\n" nosetests $(DIR_LIB)