2019-11-15 11:16:06 +01:00
|
|
|
MAKESELF:=makeself
|
2019-11-18 00:37:34 +01:00
|
|
|
VERSION:=$(shell git describe|sed 's/-\([[:digit:]]\+\)-.*/\.post\1/')
|
2019-11-21 17:09:19 +01:00
|
|
|
SETUPFILE:=MsSpec-$(VERSION).setup
|
2019-11-15 11:16:06 +01:00
|
|
|
|
|
|
|
|
2019-11-28 18:35:37 +01:00
|
|
|
VERBOSE:=0
|
|
|
|
ifeq ($(VERBOSE),0)
|
|
|
|
SUPPRESS_OUPUT:=1>/dev/null 2>/dev/null
|
|
|
|
MAKEFLAGS += --no-print-directory
|
|
|
|
else
|
|
|
|
SUPPRESS_OUPUT:=
|
|
|
|
endif
|
2019-11-16 00:38:17 +01:00
|
|
|
|
2019-11-15 11:16:06 +01:00
|
|
|
|
2019-11-29 13:20:40 +01:00
|
|
|
.PHONY: clean version selfex venv doc
|
2019-11-15 14:26:16 +01:00
|
|
|
|
|
|
|
|
2019-12-12 16:45:12 +01:00
|
|
|
selfex: results
|
2019-11-15 11:16:06 +01:00
|
|
|
@echo "Creating the self-extractible setup program... "
|
2019-12-12 16:45:12 +01:00
|
|
|
# copy the src folder and purge it
|
|
|
|
@cp -r src src_
|
|
|
|
@+$(MAKE) -C ./src_ purge
|
2019-11-28 18:35:37 +01:00
|
|
|
# update the version
|
2020-03-12 16:16:28 +01:00
|
|
|
@echo "$(VERSION)" > ./src_/VERSION
|
|
|
|
# distribute the README.md file
|
|
|
|
@cp README.md ./src_/
|
2019-11-28 18:35:37 +01:00
|
|
|
# create the package folder
|
|
|
|
@mkdir -p package
|
|
|
|
# create the *.lsm file
|
2019-11-21 17:09:19 +01:00
|
|
|
@echo "Begin4" > msspec.lsm
|
|
|
|
@echo "Title: Python MsSpec" >> msspec.lsm
|
|
|
|
@echo "Version: $(VERSION)" >> msspec.lsm
|
|
|
|
@echo "Entered-date: `date +%Y-%m-%d`" >> msspec.lsm
|
|
|
|
@echo "Description: A multiple scattering package for spectroscopies using electrons to probe materials" >> msspec.lsm
|
|
|
|
@echo "Keywords: " >> msspec.lsm
|
|
|
|
@echo "Author: sylvain.tricot@univ-rennes1.fr (Sylvain Tricot), didier.sebilleau@univ-rennes1.fr (Didier Sébilleau)" >> msspec.lsm
|
|
|
|
@echo "Maintained-by: sylvain.tricot@univ-rennes1.fr (Sylvain Tricot)" >> msspec.lsm
|
|
|
|
@echo "Primary-site: https://msspec.cnrs.fr" >> msspec.lsm
|
|
|
|
@echo "Alternate-site:" >> msspec.lsm
|
|
|
|
@echo "Original-site:" >> msspec.lsm
|
|
|
|
@echo "Platforms:" >> msspec.lsm
|
|
|
|
@echo "Copying-policy: Gnu Library General Public License (GLPL) 2.0" >> msspec.lsm
|
|
|
|
@echo "End" >> msspec.lsm
|
2019-11-28 18:35:37 +01:00
|
|
|
# create the self-extractible archive
|
2019-12-12 16:45:12 +01:00
|
|
|
@$(MAKESELF) --license "./license.txt" --lsm ./msspec.lsm ./src_ package/$(SETUPFILE) "Python MsSpec" ./install.sh $(SUPPRESS_OUPUT)
|
|
|
|
# remove *.lsm file and src_
|
2019-11-21 17:09:19 +01:00
|
|
|
@rm ./msspec.lsm
|
2019-12-12 16:45:12 +01:00
|
|
|
@rm -rf ./src_
|
2019-11-15 11:16:06 +01:00
|
|
|
|
2019-11-29 13:20:40 +01:00
|
|
|
|
2019-11-28 18:35:37 +01:00
|
|
|
version:
|
|
|
|
@python ./CI/update_version.py
|
|
|
|
|
2019-11-29 13:20:40 +01:00
|
|
|
|
2019-11-28 18:35:37 +01:00
|
|
|
clean:
|
|
|
|
@echo "Cleaning all..."
|
|
|
|
@find ./src -type f -name '*.pyc' -exec rm -f {} +
|
|
|
|
@find ./src -type d -name '__pycache__' -exec rm -rf {} +
|
|
|
|
@rm -rf src/dist
|
|
|
|
@rm -rf src/*.egg*
|
|
|
|
@+$(MAKE) -C src/ clean $(SUPPRESS_OUPUT)
|
|
|
|
@+$(MAKE) -C doc/ clean $(SUPPRESS_OUPUT)
|
|
|
|
@rm -rf package
|
|
|
|
|
2019-12-06 13:26:22 +01:00
|
|
|
purge: clean
|
|
|
|
@echo "Removing also shared objects..."
|
|
|
|
@find ./src -type f -name '*.so' -exec rm -f {} +
|
|
|
|
|
|
|
|
results:
|
|
|
|
@+$(MAKE) -C src results
|
|
|
|
|
2019-11-29 13:20:40 +01:00
|
|
|
|
|
|
|
venv:
|
2019-11-29 13:47:52 +01:00
|
|
|
@virtualenv --python=python3 --system-site-packages ci_venv $(SUPPRESS_OUPUT)
|
2020-03-12 16:16:28 +01:00
|
|
|
@. "./ci_venv/bin/activate" && pip install --upgrade pip && pip install --upgrade -r requirements.txt $(SUPPRESS_OUPUT)
|
2019-11-29 13:20:40 +01:00
|
|
|
|
|
|
|
doc:
|
|
|
|
@echo "Building pdf and html documentation..."
|
|
|
|
@mkdir -p package/
|
|
|
|
@+$(MAKE) -C doc/ latexpdf $(SUPPRESS_OUPUT)
|
|
|
|
@rm -rf package/*.pdf
|
|
|
|
@cp "doc/build/latex/MsSpec-python.pdf" "./package/MsSpec-${VERSION}.pdf"
|
|
|
|
@+$(MAKE) -C doc/ html $(SUPPRESS_OUPUT)
|