47 lines
1.7 KiB
Makefile
47 lines
1.7 KiB
Makefile
MAKESELF:=makeself
|
|
LICENSE:=$(shell cat ./license.txt)
|
|
#VERSION:=$(shell cd src && python -c "import msspec; print(msspec.__version__)")
|
|
VERSION:=$(shell git describe|sed 's/-\([[:digit:]]\+\)-.*/\.post\1/')
|
|
SETUPFILE:=pymsspec-$(VERSION).setup
|
|
|
|
.PHONY: clean purge version
|
|
|
|
|
|
clean:
|
|
@rm -rf *.setup
|
|
|
|
version:
|
|
@python ./CI/update_version.py
|
|
|
|
|
|
purge: clean
|
|
@echo "Purging all..."
|
|
@find ./src -type f -name '*.pyc' -exec rm {} +
|
|
@find ./src -type d -name '__pycache__' -exec rm -r {} +
|
|
+$(MAKE) -C src/ clean
|
|
|
|
selfex: purge
|
|
@echo "Creating the self-extractible setup program... "
|
|
# update the version
|
|
@cp ./src/msspec/version.py ./src/msspec/version.py.bak
|
|
@echo "__version__ = \"$(VERSION)\"" > ./src/msspec/version.py
|
|
# create the *.lsm file
|
|
@echo "Begin4" > pymsspec.lsm
|
|
@echo "Title: Python MsSpec" >> pymsspec.lsm
|
|
@echo "Version: $(VERSION)" >> pymsspec.lsm
|
|
@echo "Entered-date: `date +%Y-%m-%d`" >> pymsspec.lsm
|
|
@echo "Description: A multiple scattering package for spectroscopies using electrons to probe materials" >> pymsspec.lsm
|
|
@echo "Keywords: " >> pymsspec.lsm
|
|
@echo "Author: sylvain.tricot@univ-rennes1.fr (Sylvain Tricot), didier.sebilleau@univ-rennes1.fr (Didier Sébilleau)" >> pymsspec.lsm
|
|
@echo "Maintained-by: sylvain.tricot@univ-rennes1.fr (Sylvain Tricot)" >> pymsspec.lsm
|
|
@echo "Primary-site: https://msspec.cnrs.fr" >> pymsspec.lsm
|
|
@echo "Alternate-site:" >> pymsspec.lsm
|
|
@echo "Original-site:" >> pymsspec.lsm
|
|
@echo "Platforms:" >> pymsspec.lsm
|
|
@echo "Copying-policy: Gnu Library General Public License (GLPL) 2.0" >> pymsspec.lsm
|
|
@echo "End" >> pymsspec.lsm
|
|
$(MAKESELF) --license ./license.txt --lsm ./pymsspec.lsm ./src $(SETUPFILE) "Python MsSpec" ./install.sh
|
|
@mv ./src/msspec/version.py.bak ./src/msspec/version.py
|
|
@rm ./pymsspec.lsm
|
|
|