-
Notifications
You must be signed in to change notification settings - Fork 0
/
Makefile
157 lines (137 loc) · 6.9 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
TREESCAN := /prj/treescan/build.area/treescan
CC := g++
M_CFLAGS :=
APPLICATION := TreeScan
MAC_APPLICATION := TreeScan_mac
LINUX_LIBRARY := libtreescan.linux.so
SOLARIS_LIBRARY := libtreescan.solaris.so
MAC_LIBRARY := libtreescan.jnilib
DEBUG := -ggdb
COMPILATION := -m32
OPTIMIZATION := -O3
CALCULATION := $(TREESCAN)/calculation
RUNNER := $(TREESCAN)/calculation/runner
OUTPUT := $(TREESCAN)/calculation/output
PRINT := $(TREESCAN)/calculation/print
UTILITY := $(TREESCAN)/calculation/utility
RANDOMIZER := $(TREESCAN)/calculation/randomization
LOGLIKELIHOOD := $(TREESCAN)/calculation/loglikelihood
ZLIB := $(TREESCAN)/zlib/zlib-1.2.7
ZLIB_MINIZIP := $(TREESCAN)/zlib/zlib-1.2.7/contrib/minizip
JNI :=
JNI_PLAT :=
BOOSTDIR := $(TREESCAN)/../boost/boost_1_46_0
INCLUDEDIRS := -I$(CALCULATION) -I$(UTILITY) -I$(OUTPUT) -I$(PRINT) -I$(UTILITY) -I$(RANDOMIZER) -I$(LOGLIKELIHOOD) -I$(RUNNER) -I$(BOOSTDIR) -I$(ZLIB) -I$(ZLIB_MINIZIP) -I$(JNI) -I$(JNI_PLAT)
DEFINES := -DBOOST_ALL_NO_LIB -DBOOST_FILESYSTEM_NO_CXX20_ATOMIC_REF $(PLAT_DEFINES)
INFOPLIST_FILE :=
CFLAGS := -c $(M_CFLAGS) $(COMPILATION) -std=c++11 -Wno-deprecated -Wno-unknown-pragmas -Wall $(OPTIMIZATION) $(DEBUG) $(INCLUDEDIRS) $(DEFINES) $(THREAD_DEFINE)
LFLAGS := $(COMPILATION) -L$(ZLIB) -L$(ZLIB_MINIZIP) -Wl,-Bstatic -lz -lm -Wl,-Bdynamic -lrt -lpthread
# Linux link flags
L_DLFLAGS := -shared $(COMPILATION) -Wl,-soname,$(LINUX_LIBRARY).x.x -o $(LINUX_LIBRARY).x.x.0
# Solaris link flags
S_DLFLAGS := -shared $(COMPILATION) -z text -o $(SOLARIS_LIBRARY).x.x.0
# Mac OS X flags
M_LFLAGS := $(COMPILATION) -sectcreate __TEXT __info_plist $(INFOPLIST_FILE) -L$(ZLIB) -L$(ZLIB_MINIZIP) -Wl,-dynamic -lz -lstdc++ -lm
M_DLFLAGS := -shared -sectcreate __TEXT __info_plist $(INFOPLIST_FILE) $(COMPILATION) -install_name $(MAC_LIBRARY)
SRC := $(RUNNER)/ScanRunner.cpp \
$(RUNNER)/DataSource.cpp \
$(RUNNER)/DataTimeRanges.cpp \
$(RUNNER)/RelativeRiskAdjustment.cpp \
$(OUTPUT)/DataFileWriter.cpp \
$(OUTPUT)/ResultsFileWriter.cpp \
$(OUTPUT)/ChartGenerator.cpp \
$(PRINT)/BasePrint.cpp \
$(PRINT)/PrintScreen.cpp \
$(PRINT)/PrintQueue.cpp \
$(RANDOMIZER)/Randomization.cpp \
$(RANDOMIZER)/DenominatorDataRandomizer.cpp \
$(RANDOMIZER)/BernoulliRandomizer.cpp \
$(RANDOMIZER)/PoissonRandomizer.cpp \
$(RANDOMIZER)/TemporalRandomizer.cpp \
$(RANDOMIZER)/AlternativeHypothesisRandomizer.cpp \
$(RANDOMIZER)/PermutationDataRandomizer.cpp \
$(LOGLIKELIHOOD)/Loglikelihood.cpp \
$(LOGLIKELIHOOD)/CriticalValues.cpp \
$(UTILITY)/RandomDistribution.cpp \
$(UTILITY)/RandomNumberGenerator.cpp \
$(UTILITY)/PrjException.cpp \
$(UTILITY)/UtilityFunctions.cpp \
$(UTILITY)/MonteCarloSimFunctor.cpp \
$(UTILITY)/MCSimJobSource.cpp \
$(UTILITY)/FileName.cpp \
$(UTILITY)/TimeStamp.cpp \
$(UTILITY)/FieldDef.cpp \
$(UTILITY)/contractor.cpp \
$(UTILITY)/AsynchronouslyAccessible.cpp \
$(UTILITY)/AsciiPrintFormat.cpp \
$(UTILITY)/Ini.cpp \
$(UTILITY)/ZipUtils.cpp \
$(CALCULATION)/Parameters.cpp \
$(CALCULATION)/ParametersPrint.cpp \
$(CALCULATION)/ParameterFileAccess.cpp \
$(CALCULATION)/ParametersValidate.cpp \
$(CALCULATION)/Toolkit.cpp \
$(CALCULATION)/IniParameterFileAccess.cpp \
$(CALCULATION)/IniParameterSpecification.cpp \
$(BOOSTDIR)/libs/thread/src/pthread/once.cpp \
$(BOOSTDIR)/libs/thread/src/pthread/thread.cpp \
$(BOOSTDIR)/libs/regex/src/posix_api.cpp \
$(BOOSTDIR)/libs/regex/src/regex.cpp \
$(BOOSTDIR)/libs/regex/src/regex_debug.cpp \
$(BOOSTDIR)/libs/regex/src/static_mutex.cpp \
$(BOOSTDIR)/libs/regex/src/wide_posix_api.cpp \
$(BOOSTDIR)/libs/program_options/src/cmdline.cpp \
$(BOOSTDIR)/libs/program_options/src/config_file.cpp \
$(BOOSTDIR)/libs/program_options/src/convert.cpp \
$(BOOSTDIR)/libs/program_options/src/options_description.cpp \
$(BOOSTDIR)/libs/program_options/src/positional_options.cpp \
$(BOOSTDIR)/libs/program_options/src/split.cpp \
$(BOOSTDIR)/libs/program_options/src/utf8_codecvt_facet.cpp \
$(BOOSTDIR)/libs/program_options/src/value_semantic.cpp \
$(BOOSTDIR)/libs/program_options/src/variables_map.cpp \
$(BOOSTDIR)/libs/system/src/error_code.cpp \
$(BOOSTDIR)/libs/filesystem/src/codecvt_error_category.cpp \
$(BOOSTDIR)/libs/filesystem/src/directory.cpp \
$(BOOSTDIR)/libs/filesystem/src/exception.cpp \
$(BOOSTDIR)/libs/filesystem/src/operations.cpp \
$(BOOSTDIR)/libs/filesystem/src/path.cpp \
$(BOOSTDIR)/libs/filesystem/src/path_traits.cpp \
$(BOOSTDIR)/libs/filesystem/src/portability.cpp \
$(BOOSTDIR)/libs/filesystem/src/unique_path.cpp \
$(BOOSTDIR)/libs/filesystem/src/utf8_codecvt_facet.cpp
APP_SRC := $(TREESCAN)/batch_application/TreeScan.cpp \
$(TREESCAN)/batch_application/ParameterProgramOptions.cpp
LIB_SRC := $(TREESCAN)/library/SharedLibrary.cpp \
$(TREESCAN)/library/JNIPrintWindow.cpp \
$(TREESCAN)/library/ParametersUtility.cpp \
$(TREESCAN)/library/JNIException.cpp \
$(TREESCAN)/library/PrintCallback.cpp
OBJS := $(SRC:.cpp=.o)
APP_OBJS := $(APP_SRC:.cpp=.o)
LIB_OBJS := $(LIB_SRC:.cpp=.o)
.PHONY: clean all thin
all : $(APPLICATION) $(LINUX_LIBRARY)
thin : all
strip $(APPLICATION)
strip $(LINUX_LIBRARY).x.x.0
$(APPLICATION) : $(OBJS) $(APP_OBJS)
$(CC) $(OBJS) $(APP_OBJS) $(LFLAGS) -o $@
$(MAC_APPLICATION) : $(OBJS) $(APP_OBJS)
$(CC) $(OBJS) $(APP_OBJS) $(M_LFLAGS) -o $@
$(LINUX_LIBRARY) : $(OBJS) $(LIB_OBJS)
$(CC) $(L_DLFLAGS) $(OBJS) $(LIB_OBJS) -L$(ZLIB) -L$(ZLIB_MINIZIP) -lz -lm -lrt -lpthread
$(SOLARIS_LIBRARY) : $(OBJS) $(LIB_OBJS)
$(CC) $(S_DLFLAGS) $(OBJS) $(LIB_OBJS) -L$(ZLIB) -L$(ZLIB_MINIZIP) -lz -lm -lrt -lpthread
$(MAC_LIBRARY) : $(OBJS) $(LIB_OBJS)
$(CC) $(M_DLFLAGS) $(OBJS) $(LIB_OBJS) -L$(ZLIB) -L$(ZLIB_MINIZIP) -lz -lstdc++ -lm -o $@
%.o : %.cpp
$(CC) $(CFLAGS) $< -o $@
clean :
rm -f core $(OBJS)
rm -f $(APPLICATION)
rm -f core $(APP_OBJS)
rm -f $(LINUX_LIBRARY).x.x.0
rm -f $(SOLARIS_LIBRARY).x.x.0
rm -f core $(LIB_OBJS)
rm -f $(MAC_APPLICATION)
rm -f $(MAC_LIBRARY)