-
Notifications
You must be signed in to change notification settings - Fork 55
/
Makefile
93 lines (76 loc) · 3.53 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
# No files with these names in top-level directory
.PHONY: docs test debug opt profile optprof clean coverage sanitize
GITVERSION := $(shell git describe --tags --abbrev=40 --always)
UNAME_S := $(shell uname -s)
ifeq ($(UNAME_S),Linux)
GCC_FLAGS1 = -fPIC -Wl,-Bsymbolic-functions -c
GCC_FLAGS2 = -shared -Wl,-Bsymbolic-functions,-soname,vplanetlib.so
endif
ifeq ($(UNAME_S),Darwin)
GCC_FLAGS1 = -fPIC -c
GCC_FLAGS2 = -shared -Wl,-install_name,vplanetlib.so
endif
default:
-python setup.py clean --all
-python setup.py develop
legacy:
-gcc -o bin/vplanet src/*.c -lm -DGITVERSION=\"$(GITVERSION)\"
@echo ""
@echo "=========================================================================================================="
@echo 'To add vplanet to your $$PATH, please run the appropriate command for your shell type:'
@echo '( You can see your shell by typing: echo $$0 )'
@echo 'bash: export PATH=$$PATH:$(CURDIR)/bin'
@echo 'tsch: set path=($$path $(CURDIR)/bin)'
@echo 'csh : set path=($$path $(CURDIR)/bin)'
@echo 'or permanently add the VPLanet directory to the $$PATH by editing the appropriate environment file. e.g.:'
@echo 'bash: echo '"'"'export PATH=$$PATH:$(CURDIR)/bin'"'"' >> ~/.bashrc'
@echo "=========================================================================================================="
debug:
-gcc -g -D DEBUG -o bin/vplanet src/*.c -lm -DGITVERSION=\"$(GITVERSION)\"
debug_no_AE:
-gcc -g -o bin/vplanet src/*.c -lm -DGITVERSION=\"$(GITVERSION)\"
opt:
-gcc -o bin/vplanet src/*.c -lm -O3 -DGITVERSION=\"$(GITVERSION)\"
@echo ""
@echo "=========================================================================================================="
@echo 'To add vplanet to your $$PATH, please run the appropriate command for your shell type:'
@echo '( You can see your shell by typing: echo $$0 )'
@echo 'bash: export PATH=$$PATH:$(CURDIR)/bin'
@echo 'tsch: set path=($$path $(CURDIR)/bin)'
@echo 'csh : set path=($$path $(CURDIR)/bin)'
@echo 'or permanently add the VPLanet directory to the $$PATH by editing the appropriate environment file. e.g.:'
@echo 'bash: echo '"'"'export PATH=$$PATH:$(CURDIR)/bin'"'"' >> ~/.bashrc'
@echo "=========================================================================================================="
cpp:
g++ -o bin/vplanet src/*.c -lm -O3 -fopenmp -fpermissive -w -DGITVERSION=\"$(GITVERSION)\"
warnings:
-gcc -g -D DEBUG -Wunused-but-set-variable -Wunused-variable -Wfloat-equal -o bin/vplanet src/*.c -lm -DGITVERSION=\"$(GITVERSION)\"
parallel:
gcc -o bin/vplanet src/*.c -lm -O3 -fopenmp -DGITVERSION=\"$(GITVERSION)\"
profile:
-gcc -pg -o bin/vplanet src/*.c -lm -DGITVERSION=\"$(GITVERSION)\"
optprof:
-gcc -pg -o bin/vplanet src/*.c -lm -O3 -DGITVERSION=\"$(GITVERSION)\"
sanitize:
-gcc -g -fsanitize=address -o bin/vplanet src/*.c -lm -DGITVERSION=\"$(GITVERSION)\"
test:
-gcc -o bin/vplanet src/*.c -lm -O3 -DGITVERSION=\"$(GITVERSION)\"
-pytest --tb=short
coverage:
-rm -f ./gcov/*.gcda ./gcov/*.gcno ./.coverage
-mkdir -p ./gcov
-cd gcov && gcc -coverage -o ./../bin/vplanet ./../src/*.c -lm
-python -m pytest --tb=short tests --junitxml=./junit/test-results.xml
-lcov --capture --directory ./gcov --output-file ./.coverage
-genhtml ./.coverage --output-directory ./gcov/html
docs:
-make -C docs html && echo 'Documentation available at `docs/.build/html/index.html`.'
shared:
-gcc ${GCC_FLAGS1} src/*.c
-gcc ${GCC_FLAGS2} -o bin/vplanetlib.so *.o -lc
clean:
rm -f bin/vplanet
rm -rf gcov
rm -rf .pytest_cache
rm -f src/*.o
rm -f bin/vplanetlib.so