forked from amusecode/amuse
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Makefile
173 lines (140 loc) · 4.49 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
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
-include config.mk
PYTHON ?= python
VERSION ?= undefined
CLEAN ?= yes
CONFIGURE_ERROR=
export PYTHONPATH := $(PYTHONPATH):$(PWD)/src:$(PWD)/test
python_version_full := $(wordlist 2,4,$(subst ., ,$(shell $(PYTHON) --version 2>&1)))
python_version_major := $(word 1,${python_version_full})
python_version_minor := $(word 2,${python_version_full})
python_version_patch := $(word 3,${python_version_full})
all: build.py
@-mkdir -p test_results
$(PYTHON) setup.py generate_main
ifneq ($(python_version_major),2)
$(PYTHON) setup.py build
else
$(PYTHON) setup.py build_codes --inplace
endif
framework: build.py
@-mkdir -p test_results
$(PYTHON) setup.py generate_main
ifneq ($(python_version_major),2)
$(PYTHON) setup.py build_libraries
else
$(PYTHON) setup.py build_libraries --inplace
endif
build.py:
$(error the code is not configured, please run configure first)
allinbuild:
$(PYTHON) setup.py build
build:
$(PYTHON) setup.py build
# should pick up prefix from configure?
install:
$(PYTHON) setup.py install
docclean:
make -C doc clean
clean:
$(PYTHON) setup.py clean
$(PYTHON) setup.py clean_codes --inplace
oclean:
$(PYTHON) setup.py clean
$(PYTHON) setup.py clean_codes --inplace --codes-dir=src/omuse/community
distclean:
-rm -f support/config.py
-rm -f src/amuse/config.py
-rm -f amuse.sh
-rm -f iamuse.sh
-rm -f ibis-deploy.sh
-rm -f build.py
-rm -rf test_results src/amuse.egg-info
-rm -f test/*.000 test/fort.* test/perr test/pout test/test.h5 test/*.log
-rm -f test/codes_tests/perr test/codes_tests/pout
-rm -f test/core_tests/plummer_back_100.ini
-rm -f test/test_python_implementation test/twobody
$(PYTHON) setup.py clean
$(PYTHON) setup.py dist_clean
$(PYTHON) setup.py clean_codes --inplace
$(PYTHON) setup.py dist_clean --inplace
$(PYTHON) setup.py clean_codes --inplace --codes-dir=src/omuse/community
make -C doc clean
-find ./ -name "*.pyc" -exec rm \{} \;
-find ./ -type d -name "__pycache__" -exec rm -Rf \{} \;
-find ./ -type d -name "ccache" -exec rm -Rf \{} \;
-rm -Rf build
-rm -f config.mk
-rm -f config.log build.log config.status
-rm -f amuse.cfg
-rm -f test*.pickle test.csv
tests:
$(PYTHON) setup.py tests
doc:
$(PYTHON) setup.py -q build_latex
html:
make -C doc html
latexpdf:
make -C doc latexpdf
ctags:
find src -name "*.py" | xargs ctags
find src -name "*.cc" | xargs ctags -a
find src -name "*.[cCfFhH]" | xargs ctags -a
find src -name "*.cpp" | xargs ctags -a
release: distclean
sed 's/version = .*/version = "$(VERSION)",/' < setup.py > releasesetup.py
cp setup.py setup.py.bck
mv releasesetup.py setup.py
make -C doc release
python setup.py -q sdist
cp setup.py.bck setup.py
nightly:
make -C doc release
sed 's/version = .*/version = "$(VERSION)",/' < setup.py > nightlysetup.py
cp setup.py setup.py.bck
mv nightlysetup.py setup.py
python setup.py sdist
cp setup.py.bck setup.py
debian:
$(PYTHON) ./support/debian.py
%.code:
ifneq (,$(findstring s,$(MAKEFLAGS)))
ifeq ($(python_version_major),2)
$(PYTHON) setup.py build_code --inplace --clean=$(CLEAN) --code-name=$*
else
$(PYTHON) setup.py build_code --clean=$(CLEAN) --code-name=$*
endif
else
ifeq ($(python_version_major),2)
$(PYTHON) setup.py -v build_code --inplace --clean=$(CLEAN) --code-name=$*
else
$(PYTHON) setup.py -v build_code --clean=$(CLEAN) --code-name=$*
endif
endif
%.ocode: | src/omuse
ifneq (,$(findstring s,$(MAKEFLAGS)))
$(PYTHON) setup.py build_code --inplace --clean=$(CLEAN) --code-name=$* --codes-dir=src/omuse/community
else
$(PYTHON) setup.py -v build_code --inplace --clean=$(CLEAN) --code-name=$* --codes-dir=src/omuse/community
endif
omuse: build.py | src/omuse
@-mkdir -p test_results
$(PYTHON) setup.py generate_main
ifneq ($(python_version_major),3)
$(PYTHON) setup.py build_codes --inplace --codes-dir=src/omuse/community
else
$(error you cannot build the omuse codes in the source directories with Python 3 yet)
endif
src/omuse:
@echo "src/omuse not present"
@false
help:
@echo "brief overview of most important make options:"
@echo "make - build all AMUSE libraries and community codes "
@echo "make <name>.code - clean & build the community code <name> (or matching name*)"
@echo "make clean - clean codes and libraries"
@echo "make distclean - clean codes and libraries and all configuration files"
ifeq (src/omuse ,$(wildcard src/omuse))
@echo "make omuse - build OMUSE community codes"
@echo "make oclean - clean OMUSE community codes"
@echo "make <name>.ocode - build OMUSE community code <name>"
endif