-
Notifications
You must be signed in to change notification settings - Fork 14
/
Makefile
executable file
·164 lines (146 loc) · 4.03 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
# Copyright © 1990 The Portland State University OCCAM Project Team
# [This program is licensed under the GPL version 3 or later.]
# Please see the file LICENSE in the source
# distribution of this software for license terms.
SHELL = /bin/sh
INSTALL_ROOT = install
WEB_ROOT = $(INSTALL_ROOT)/web
CL_ROOT = $(INSTALL_ROOT)/cl
HEADERS = \
include/attrDescs.h \
include/AttributeList.h \
include/Constants.h \
include/_Core.h \
include/Globals.h \
include/Input.h \
include/Key.h \
include/ManagerBase.h \
include/Math.h \
include/ModelCache.h \
include/Model.h \
include/Options.h \
include/Relation.h \
include/RelCache.h \
include/Report.h \
include/SBMManager.h \
include/SearchBase.h \
include/Search.h \
include/StateConstraint.h \
include/Table.h \
include/Types.h \
include/Variable.h \
include/VariableList.h \
include/VarIntersect.h \
include/VBMManager.h
CPP_FILES = \
cpp/AttributeList.cpp \
cpp/_Core.cpp \
cpp/Input.cpp \
cpp/Key.cpp \
cpp/Makefile \
cpp/ManagerBase.cpp \
cpp/Math.cpp \
cpp/ModelCache.cpp \
cpp/Model.cpp \
cpp/occ.cpp \
cpp/Options.cpp \
cpp/pyoccam.cpp \
cpp/Relation.cpp \
cpp/RelCache.cpp \
cpp/Report.cpp \
cpp/ReportPrintConditionalDV.cpp \
cpp/ReportPrintResiduals.cpp \
cpp/ReportQsort.cpp \
cpp/SBMManager.cpp \
cpp/SearchBase.cpp \
cpp/Search.cpp \
cpp/StateConstraint.cpp \
cpp/Table.cpp \
cpp/VariableList.cpp \
cpp/VBMManager.cpp \
CORE_FILES = \
cpp/occam.so \
py/occammail.py \
py/common.py \
py/ocutils.py \
py/distanceFunctions.py \
py/ocGraph.py
CL_FILES = \
cpp/occ \
py/basic.py \
py/fit.py \
py/sbfit.py \
py/sbsearch.py
WEB_FILES = \
html/.htaccess \
html/occam_logo.jpg \
html/base.css \
html/footer.html \
html/header.html \
html/index.html \
py/OpagCGI.py \
py/jobcontrol.py \
py/weboccam.py \
html/switchform.html \
html/header.txt \
html/formheader.html \
html/fitbatchform.html \
html/compareform.html \
html/logform.html \
html/weboccam.cgi \
html/output.template.html \
html/cached_data.template.html \
html/data.template.html \
html/fit.template.html \
html/fit.footer.html \
html/search.template.html \
html/search.footer.html \
html/SBfit.template.html \
html/SBfit.footer.html \
html/SBsearch.template.html \
html/SBsearch.footer.html \
html/compare.template.html \
html/compare.footer.html \
html/occambatch
install: $(WEB_FILES) $(CORE_FILES) $(CL_FILES)
-@ [ -d $(WEB_ROOT) ] && echo "warning: existing web installation"
-@ [ -d $(CL_ROOT) ] && echo "warning: existing cli installation"
mkdir -p $(INSTALL_ROOT) && \
mkdir -p $(WEB_ROOT) && \
mkdir -p $(CL_ROOT) && \
cp $(WEB_FILES) $(WEB_ROOT) && \
cp $(CORE_FILES) $(WEB_ROOT) && \
cp $(CORE_FILES) $(CL_ROOT) && \
cp $(CL_FILES) $(CL_ROOT) && \
mkdir -p $(WEB_ROOT)/data
web:
cp $(WEB_FILES) $(WEB_ROOT) && \
cp $(CORE_FILES) $(WEB_ROOT)
cli:
cp $(CORE_FILES) $(CL_ROOT) && \
cp $(CL_FILES) $(CL_ROOT)
cpp/occam.so: $(HEADERS) $(CPP_FILES)
cd cpp && $(MAKE)
GTEST_DIR = tests/googletest/googletest
GTEST_INCLUDE_DIR = $(GTEST_DIR)/include
GTEST_LIB_DIR = $(GTEST_DIR)/lib
$(GTEST_DIR):
git submodule init
git submodule update
$(GTEST_LIB_DIR)/libgtest.a: $(GTEST_DIR)
g++ -std=c++14 -isystem $(GTEST_INCLUDE_DIR) -I$(GTEST_DIR) -pthread -c $(GTEST_DIR)/src/gtest-all.cc && \
mkdir -p $(GTEST_LIB_DIR)
ar -rv $(GTEST_LIB_DIR)/libgtest.a gtest-all.o
tests/test_ocReadFile: cpp/occam.so tests/test_ocReadFile.cpp $(GTEST_LIB_DIR)/libgtest.a
g++ -std=c++14 -isystem $(GTEST_INCLUDE_DIR) -pthread tests/test_ocReadFile.cpp -L./cpp -loccam3 $(GTEST_LIB_DIR)/libgtest.a -o tests/test_ocReadFile
tests/test_csa: cpp/occam.so tests/test_csa.cpp $(GTEST_LIB_DIR)/libgtest.a
g++ -std=c++14 -isystem $(GTEST_INCLUDE_DIR) -pthread tests/test_csa.cpp -L./cpp -loccam3 $(GTEST_LIB_DIR)/libgtest.a -o tests/test_csa
tests: tests/test_ocReadFile tests/test_csa
./tests/test_ocReadFile
./tests/test_csa
clean:
cd cpp && $(MAKE) clean
-rm -rf $(INSTALL_ROOT)
-rm -rf $(GTEST_LIB_DIR)
-rm -f tests/test_ocReadFile
$(CXX) $(CXXFLAGS) -c $< -o $@