-
Notifications
You must be signed in to change notification settings - Fork 5
/
Makefile
88 lines (66 loc) · 2.8 KB
/
Makefile
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
VER=$(shell cat smodels/version)
HAS_FC := $(shell smodels/lib/check_fortran_compiler.sh 2> /dev/null)
HAS_CXX := $(shell command -v $(CXX) 2> /dev/null)
all: resolve_deps # make all just resolves dependencies
check_compilers: .PHONY
ifndef HAS_FC
$(error "Fortran compiler not found. Cannot compile external tools. You may try to give the explicit path to the compiler via the FC variable (make FC=... smodels). Alternatively, you can still build smodels proper, via 'make smodels_noexternaltools'" )
endif
ifndef HAS_CXX
$(error "C++ compiler not found. Cannot compile external tools. You may try to give the explicit path to the compiler via the CXX variable (make CXX=... smodels). Alternatively, you can still build smodels proper, via 'make smodels_noexternaltools'" )
endif
resolve_deps: ## resolve the deps via pip
@echo "trying to resolve the python dependencies via pip:"
@smodels/installation.py -R
smodels_externaltools: resolve_deps externaltools
@echo
@echo "done. you can now run the software directly from this source directory.\n"
@echo "Try e.g. \n\n ./runSModelS.py --help\n"
@echo "The latest SModelS documentation can be found at: http://smodels.readthedocs.io/en/latest/"
@echo "For this version documentation go to: https://smodels.readthedocs.io/en/v$(VER)"
smodels: resolve_deps
smodels_noexternaltools: resolve_deps
@echo
@echo "done. you can now run the software directly from this source directory.\n"
@echo "Try e.g. \n\n ./runSModelS.py --help\n"
@echo "The latest SModelS documentation can be found at: http://smodels.readthedocs.io/en/latest/"
@echo "For this version documentation go to: https://smodels.readthedocs.io/en/v$(VER)"
tidy:
# tidy up the directory, remove files not needed for users
yes | rm -rf build dist test docs apt.txt environment.yml .git .gitattributes .gitignore smodels.egg*
version:
@echo $(VER)
externaltools: check_compilers
cd smodels/lib && make -j 4
pythia6:
cd smodels/lib && make pythia6
pythia8:
cd smodels/lib && make pythia8
resummino:
cd smodels/lib && make resummino
nllfast:
cd smodels/lib && make nllfast
cpp: .PHONY
cd cpp && make
clean:
yes | rm -rf build dist
cd smodels/lib && make clean
buildrpm:
$(PYTHON) setup.py bdist_rpm --force-arch x86_64
builddeb: buildrpm
cd dist && fakeroot alien smodels-$(VER)-1.x86_64.rpm
pypi: clean
## pypi user is walten, repository is https://upload.pypi.org/legacy/
rm -rf dist
python3 setup.py sdist bdist_wheel
twine upload dist/smodels-*.tar.gz
testpypi: clean
## testpypi user is smodels, repository is https://test.pypi.org/legacy/
# to install from testpypi:
# pip3 install --user --upgrade --index-url https://test.pypi.org/simple/ smodels
rm -rf dist
python3 setup.py sdist bdist_wheel
twine upload -r pypitest dist/smodels-*.tar.gz
tarballs:
cd distribution && make tarballs
.PHONY: