Skip to content
Snippets Groups Projects
Commit 357464b9 authored by Jan Mach's avatar Jan Mach
Browse files

Refactoring: Renamed master makefile to support automated build system.

(Redmine issue: #3387)
parent 8c6542f4
No related branches found
No related tags found
No related merge requests found
...@@ -13,64 +13,73 @@ DIR_LIB = lib ...@@ -13,64 +13,73 @@ DIR_LIB = lib
BIN_FILES := $(wildcard bin/mentat-*.py) BIN_FILES := $(wildcard bin/mentat-*.py)
all: help all: help
check: pyflakes pylint test check: pyflakes pylint test
#------------------------------------------------------------------------------- #-------------------------------------------------------------------------------
help: help:
$(info List of possible make targets:) $(info List of possible make targets:)
$(info ) $(info )
$(info * all: alias for help, you have to pick a target [default]) $(info * all: alias for help, you have to pick a target [default])
$(info * help: print this help and exit) $(info * help: print this help and exit)
$(info * docs: generate all local project documentation) $(info * docs: generate all local project documentation)
$(info - docs-sphinx) $(info = docs-sync)
$(info * pyflakes: check source code with pyflakes) $(info = docs-sphinx)
$(info - pyflakes-bin) $(info * check: perform extensive code checking)
$(info * pylint: check source code with pylint) $(info = pyflakes: check source code with pyflakes)
$(info - pylint-bin) $(info - pyflakes-bin)
$(info * test: run unit tests with nosetest) $(info = pylint: check source code with pylint)
$(info - pylint-bin)
$(info = test: run unit tests with nosetest)
$(info ) $(info )
#------------------------------------------------------------------------------- #-------------------------------------------------------------------------------
docs: docs-sync docs-sphinx docs: docs-sync docs-sphinx
# Synchronize directory contents
docs-sync: FORCE 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/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/pyzenkit/doc/_doclib/_inc*.rst ./doc/sphinx/_doclib/
rsync -r --progress --archive --update --delete --force ./submodules/pynspect/doc/_doclib/api_*.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 {} \; #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 clean
#cd $(DIR_DOC)/sphinx && make apidoc #cd $(DIR_DOC)/sphinx && make apidoc
cd $(DIR_DOC)/sphinx && make html cd $(DIR_DOC)/sphinx && make html
echo "Generated local project documentation"
#------------------------------------------------------------------------------- #-------------------------------------------------------------------------------
pyflakes: pyflakes-bin pyflakes: pyflakes-bin
pyflakes-bin: $(DIR_BIN)/mentat-*.py pyflakes-bin: $(DIR_BIN)/mentat-*.py
echo "*** Checking code with pyflakes ***"
PYTHONPATH=$(DIR_LIB) python3 -m pyflakes $(DIR_BIN)/mentat-*.py PYTHONPATH=$(DIR_LIB) python3 -m pyflakes $(DIR_BIN)/mentat-*.py
#-------------------------------------------------------------------------------
pylint: pylint-bin pylint: pylint-bin
pylint-bin: $(DIR_BIN)/mentat-*.py pylint-bin: $(DIR_BIN)/mentat-*.py
# Run pylint for each binary file separatelly echo "*** Checking code with pylint ***"
for fln in $(BIN_FILES); do \ PYTHONPATH=$(DIR_LIB) python3 -m pylint --rcfile .pylintrc-bin $(DIR_BIN)
PYTHONPATH=$(DIR_LIB) python3 -m pylint $$fln --rcfile .pylintrc-bin; \
done
#-------------------------------------------------------------------------------
test: test:
echo "*** Checking code with nosetests ***"
nosetests $(DIR_LIB) nosetests $(DIR_LIB)
#-------------------------------------------------------------------------------
# Empty rule as dependency wil force make to always perform target # Empty rule as dependency wil force make to always perform target
# Source: https://www.gnu.org/software/make/manual/html_node/Force-Targets.html # Source: https://www.gnu.org/software/make/manual/html_node/Force-Targets.html
FORCE: FORCE:
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment