-
Notifications
You must be signed in to change notification settings - Fork 8
/
Makefile
184 lines (148 loc) · 5.06 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
174
175
176
177
178
179
180
181
182
183
###################################################
# #
# LICHEM: Layered Interacting CHEmical Models #
# #
# Symbiotic Computational Chemistry #
# #
###################################################
### Standard compiler settings ###
CXX=g++
CXXFLAGS=-static -Ofast -fopenmp
### Libarary settings ###
#The local copy of Eigen is located in ./Eigen3/
LDFLAGS=-I./Eigen3/
### Python settings ###
PYPATH=/usr/bin/python
### Sed commands ###
#In-place flag (GNU: -i, OSX: -i "")
SEDI=-i
### LaTeX settings ###
#For OSX these can be replaced with dummy calls to cat
TEX=pdflatex
BIB=bibtex
### Settings for doxygen ###
DOXY=doxygen
### Advanced compiler settings for developers ###
DEVFLAGS=-g -Wall -std=c++14
#####################################################
### Compile rules for users and devs ###
install: title binary testexe manual compdone
Dev: title devbin devtest manual stats compdone
clean: title delbin compdone
#####################################################
### Combine settings variables ###
# NB: Do not modify this section
FLAGSBIN=$(CXXFLAGS) $(LDFLAGS) -I./src/ -I./include/
FLAGSDEV=$(CXXFLAGS) $(DEVFLAGS) $(LDFLAGS) -I./src/ -I./include/
#####################################################
### Rules for building various parts of the code ###
binary:
@echo ""; \
echo "### Compiling the LICHEM binary ###"; \
mkdir -p bin
$(CXX) ./src/LICHEM.cpp -o ./bin/lichem $(FLAGSBIN)
@strip ./bin/lichem
devbin:
@echo ""; \
echo "### Compiling the LICHEM development binary ###"; \
mkdir -p bin
$(CXX) ./src/LICHEM.cpp -o ./bin/lichem $(FLAGSDEV)
testexe:
@echo ""; \
echo "### Creating test suite executable ###"
@echo 'echo "#!$(PYPATH)" > ./tests/runtests'; \
echo "!!$(PYPATH)" > ./tests/runtests
cat ./src/runtests.py >> ./tests/runtests
@sed $(SEDI) 's/\#.*//g' ./tests/runtests; \
sed $(SEDI) 's/[[:space:]]*$$//g' ./tests/runtests; \
sed $(SEDI) '/^$$/d' ./tests/runtests; \
sed $(SEDI) 's/\!\!/\#\!/g' ./tests/runtests; \
chmod a+x ./tests/runtests
devtest:
@echo ""; \
echo "### Creating development test suite executable ###"
@echo 'echo "#!$(PYPATH)" > ./tests/runtests'; \
echo "!!$(PYPATH)" > ./tests/runtests
cat ./src/runtests.py >> ./tests/runtests
@sed $(SEDI) 's/\#.*//g' ./tests/runtests; \
sed $(SEDI) 's/[[:space:]]*$$//g' ./tests/runtests; \
sed $(SEDI) '/^$$/d' ./tests/runtests; \
sed $(SEDI) 's/\!\!/\#\!/g' ./tests/runtests; \
sed $(SEDI) 's/updateResults = 0/updateResults = 1/g' ./tests/runtests; \
sed $(SEDI) 's/forceAll = 0/forceAll = 1/g' ./tests/runtests; \
chmod a+x ./tests/runtests
checksyntax: title
@echo ""; \
echo "### Checking for warnings and syntax errors ###"
$(CXX) -fsyntax-only ./src/LICHEM.cpp -o lichem $(FLAGSDEV)
@echo ""; \
echo "### Source code statistics ###"; \
echo "Number of LICHEM source code files:"; \
ls -al include/* src/* | wc -l; \
echo "Total length of LICHEM (lines):"; \
cat include/* src/* | wc -l; \
manual:
@echo ""; \
echo "### Compiling the documentation ###"; \
cd src/; \
echo "$(TEX) manual"; \
$(TEX) manual > doclog.txt; \
$(BIB) manual > doclog.txt; \
$(TEX) manual > doclog.txt; \
$(TEX) manual > doclog.txt; \
$(TEX) manual > doclog.txt; \
$(TEX) manual > doclog.txt; \
echo "$(BIB) manual"; \
$(BIB) manual > doclog.txt; \
$(TEX) manual > doclog.txt; \
$(TEX) manual > doclog.txt; \
$(TEX) manual > doclog.txt; \
mv manual.pdf ../doc/LICHEM_manual.pdf; \
rm -f manual.aux manual.bbl manual.blg; \
rm -f manual.log manual.out manual.toc; \
rm -f doclog.txt
doxygen:
@echo ""; \
echo "### Compiling the documentation ###"; \
echo "$(DOXY) ./src/doxygen.cfg"; \
$(DOXY) ./src/doxygen.cfg
title:
@echo ""; \
echo "###################################################"; \
echo "# #"; \
echo "# LICHEM: Layered Interacting CHEmical Models #"; \
echo "# #"; \
echo "# Symbiotic Computational Chemistry #"; \
echo "# #"; \
echo "###################################################"
stats:
@echo ""; \
echo "### Source code statistics ###"; \
echo "Number of LICHEM source code files:"; \
ls -al include/* src/* | wc -l; \
echo "Total length of LICHEM (lines):"; \
cat include/* src/* | wc -l
compdone:
@echo ""; \
echo "Done."; \
echo ""
delbin:
@echo ""; \
if grep -q "JOKES = 1" include/LICHEM_options.h; then \
echo ' ___'; \
echo ' |_ |'; \
echo ' \ \'; \
echo ' |\ \'; \
echo ' | \ \'; \
echo ' \ \ \'; \
echo ' \ \ \'; \
echo ' \ \ \ <wrrr vroooom wrrr> '; \
echo ' \__\ \________'; \
echo ' |_________\'; \
echo ' |__________| .., ,.,. .,.,, ,..'; \
echo ""; \
fi; \
echo ""; \
echo "Removing binary and manual..."; \
rm -rf lichem ./doc/LICHEM_manual.pdf ./tests/runtests ./bin; \
rm -rf doc/doxygen