-
Notifications
You must be signed in to change notification settings - Fork 7
Expand file tree
/
Copy pathmakefile
More file actions
executable file
·317 lines (255 loc) · 9.5 KB
/
Copy pathmakefile
File metadata and controls
executable file
·317 lines (255 loc) · 9.5 KB
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
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
#This file is part of SECONDO.
#
#Copyright (C) 2004, University in Hagen, Department of Computer Science,
#Database Systems for New Applications.
#
#SECONDO is free software; you can redistribute it and/or modify
#it under the terms of the GNU General Public License as published by
#the Free Software Foundation; either version 2 of the License, or
#(at your option) any later version.
#
#SECONDO is distributed in the hope that it will be useful,
#but WITHOUT ANY WARRANTY; without even the implied warranty of
#MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
#GNU General Public License for more details.
#
#You should have received a copy of the GNU General Public License
#along with SECONDO; if not, write to the Free Software
#Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
#
########################################################################
#
# SECONDO Makefile
#
#########################################################################
include ./makefile.env
ifneq ($(CURDIR),$(BUILDDIR))
$(error SECONDO_BUILD_DIR has another value than the current directory. \
Please check your environment setup! Go to the root of your SECONDO \
tree and enter the command setvar )
endif
BASH := "$(shell which bash)"
ifeq ($(BASH),"")
$(error bash not found. If you are using mingw -windows platform-, enter the following code: cd /bin\; ln sh.exe bash.exe\; cd ~ )
endif
# check if java compiler is working
include ./Javagui/makefile.inc
compileJava := "$(shell $(JAVAC) -help > /dev/null 2>&1; if [ $$? != 0 ]; then echo "false"; else echo "true"; fi)"
# The probe above quotes its answer while callers pass it unquoted
# (compileJava=false), so every comparison uses this normalized copy --
# otherwise "compileJava=true" would read as "not true" and skip the GUI.
compileJavaFlag := $(subst ",,$(compileJava))
# Whether the caller asked for the GUI to be skipped, as opposed to the probe
# above finding no working javac. Only the second is a fault, and java2 below
# turns it into a hard error rather than a message that scrolls past.
javaSkipRequested := $(if $(filter command line environment,\
$(origin compileJava)),yes)
define javac-msg
@echo ""
@echo "Error: The command \"$(JAVAC) -help\" returned an error!"
@echo " Please check your Java 2 SDK configuration and run again,"
@echo " or pass compileJava=false to skip the GUI on purpose."
endef
# Configuration files which will be created as a copy of example files
# The corresponding .example files are stored in the source repository
CONFIG_FILES = bin/SecondoConfig.ini \
bin/JNI.ini \
Javagui/gui.cfg \
Javagui/GBS.cfg \
bin/Replay.cfg
ALL_TARGETS = makedirs \
buildlibs \
buildAlgebras \
buildapps \
$(OPTIMIZER_SERVER) \
java2 \
tests \
update-config \
examples \
API
# The top-level build phases (makedirs -> buildlibs -> buildAlgebras ->
# buildapps -> tests/examples/...) are sequential by nature and must not run in
# parallel with each other.
.NOTPARALLEL:
.PHONY: all
all: $(ALL_TARGETS)
.PHONY: TTY
TTY: kernel buildapps examples
.PHONY: minTTY
minTTY: kernel minApps examples
.PHONY: android
android: kernel libapp secondo4android
.PHONY: libapp
libapp:
$(MAKE) -C android
$(MAKE) -C android/secondocore
# The Android SDK location; override if it is not under $(HOME).
ANDROID_SDK_HOME ?= $(HOME)/android-sdk
secondo4android:
$(ANDROID_SDK_HOME)/tools/android update project -p $(BUILDDIR)/android/Secondo4Android/ -l ../secondocore
ant clean debug -buildfile $(BUILDDIR)/android/Secondo4Android/build.xml
.PHONY: kernel
kernel: makedirs buildlibs buildAlgebras
.PHONY: linkonly
linkonly: buildapps
# The kernel used to check that every example parses at every startup, once per
# example, and discarded the result. It is a property of the .examples files,
# so bin/CheckExamples (built by buildapps) verifies them once here instead.
.PHONY: examples
examples: kernel buildapps
$(MAKE) -C Algebras examples
$(BINDIR)/CheckExamples$(EXEEXT) bin/tmp/*.examples
.PHONY: API
API: makedirs buildlibs buildAlgebras buildapps
$(MAKE) -C apis
.PHONY: javagui
javagui: java2
.PHONY: makedirs
makedirs:
@echo; echo " *** Building objects for Secondo libraries *** " ; echo
$(MAKE) -C ClientServer
$(MAKE) -C Tools
$(MAKE) -C StorageManager
$(MAKE) -C OptParser
$(MAKE) -C Algebras/Management
$(MAKE) -C QueryProcessor
$(MAKE) -C ParallelTransform
$(MAKE) -C UserInterfaces
.PHONY: libs
libs: makedirs buildlibs
.PHONY: buildAlgebras
buildAlgebras: buildlibs
$(MAKE) -C Algebras buildlibs
.PHONY: buildlibs
buildlibs: makedirs
@echo ; echo " *** Creating library files *** "; echo
$(MAKE) -f ./makefile.libs
.PHONY: java
java: java2 update-config
.PHONY: java2
java2:
ifeq ($(compileJavaFlag),true)
@echo ; echo " *** Compiling the java based GUI *** "; echo
$(MAKE) -C Javagui all
else ifeq ($(javaSkipRequested),yes)
@echo ; echo "The java based GUI was not compiled (compileJava=false)."
else
@echo ; echo "The java based GUI was not compiled!"
$(javac-msg)
@exit 1
endif
.PHONY: optimizer
optimizer: optimizer2 update-config
.PHONY: optimizer2
optimizer2: makedirs buildlibs buildAlgebras
$(MAKE) -C Optimizer optimizer
.PHONY: buildapps
buildapps: buildlibs buildAlgebras
@echo ; echo " *** Linking Applications *** "; echo
$(MAKE) -C UserInterfaces buildapp
$(MAKE) -C ClientServer buildapp
.PHONY: minApps
minApps:
@echo ; echo " *** Linking Applications *** "; echo
$(MAKE) -C UserInterfaces secondobdb
.PHONY: tests
tests: makedirs buildlibs
$(MAKE) -C Tests
.PHONY: clean
clean:
$(MAKE) -C ClientServer clean
$(MAKE) -C Tools clean
$(MAKE) -C Tests clean
$(MAKE) -C StorageManager clean
$(MAKE) -C Algebras/Management clean
$(MAKE) -C Algebras clean
$(MAKE) -C QueryProcessor clean
$(MAKE) -C UserInterfaces clean
$(MAKE) -C Javagui clean
$(MAKE) -C OptParser clean
$(MAKE) -C Optimizer clean
$(MAKE) -C apis clean
$(MAKE) -C ParallelTransform clean
$(MAKE) -f ./makefile.libs clean
$(RM) $(LIBDIR)/*.a $(LIBDIR)/*.o
# ant clean -buildfile $(HOME)/secondo/android/secondocore/build.xml
# ant clean -buildfile $(HOME)/secondo/android/Secondo4Android/build.xml
.PHONY: realclean
realclean: clean
$(MAKE) -C Algebras realclean
$(MAKE) -C Optimizer realclean
rm -f $(CONFIG_FILES) makefile.algebras
rm -rf bin/tmp
rm -rf Optimizer/tmp
.PHONY: runtests
runtests: ttytest
.PHONY: ttytest
ttytest:
cd CM-Scripts; ./run-tests.sh -tty /tmp/runtests-$(USER) 900
.PHONY: cstest
cstest:
cd CM-Scripts; ./run-tests.sh -cs
# makefile.cm is the legacy configuration-management tooling: SDK tarballs,
# install kits, ChangeLog handling, upload to the web server. It is pulled in
# only when one of its targets was actually asked for, because merely reading
# it has side effects -- it creates /tmp/make-$(USER) and touches marker files
# through parse-time $(shell ...), and it overwrites the VPATH that
# makefile.env set. Add new targets from makefile.cm to this list.
CM_TARGETS := addfiles backup backup-all backup.tgz changelog ChangeLog \
checkrootdir copy2web cp_deps cp_files cp_gui cp-sources cscope \
cscope.files demo demo2 doc-dist inst-kit isoimage mkcp1252 mkdemodir \
mkLat1 newfiles public-linux public-version removeLists remove-old-apps \
remove-old-config rmList sdk-cd sdk-scripts sdk-tars showdiff showpubtags \
show-separator showtags show-update-msg src-archive src-dist sync-now \
sync-test tag-version tar_demo updateChgLog update-environment
ifneq (,$(filter $(CM_TARGETS),$(MAKECMDGOALS)))
include ./makefile.cm
endif
######################################################
#
# Automatic creation of configuration files.
# This mechanism avoids that someone commits in his
# local configuration files.
#
######################################################
.PHONY: update-config
update-config: $(CONFIG_FILES)
bin/SecondoConfig.ini: bin/SecondoConfig.example
$(cp-config-file)
bin/JNI.ini: bin/JNI.ini.sample
$(cp-config-file)
$(BUILDDIR)/makefile.algebras: $(BUILDDIR)/makefile.algebras.sample
$(cp-config-file)
Javagui/gui.cfg: Javagui/gui.cfg.example
$(cp-config-file)
Javagui/GBS.cfg: Javagui/GBS.cfg.sample
$(cp-config-file)
bin/Replay.cfg: bin/Replay.cfg.example
$(cp-config-file)
.PHONY: DistributedVisualization
DistributedVisualization:
-npm --prefix Tools/DistributedVisualization/server install
-npm --prefix Tools/DistributedVisualization/server run build
-npm --prefix Tools/DistributedVisualization/client install
-npm --prefix Tools/DistributedVisualization/client run build_and_move
.PHONY: help
help:
@echo "*** Usage of the SECONDO makefile:"
@echo "*** "
@echo "*** make [TTY|android|optimizer|java|clean|realclean|TestRunner]"
@echo "*** [clean|realclean|runtests]"
@echo "*** "
@echo "*** The optional parameters or targets are explained below:"
@echo "*** ---------------------------------------------------------------------"
@echo "*** TTY : Compile only a single user version of Secondo."
@echo "*** android : Compile android version of Secondo."
@echo "*** optimizer : Create only SecondoPL and the embedded optimizer."
@echo "*** java : The Java-GUI will be created."
@echo "*** TestRunner: Compile only the TestRunner, a tool to automate tests."
@echo "*** "
@echo "*** without any Options every of the above applications will be compiled."
@echo "*** "
@echo "*** runtests : Run some automatic Tests. Useful to check if changes have side effects."
@echo "*** "
@echo "*** clean : Delete all created objects, libraries and applications."
@echo "*** realclean : Delete all like clean and the Java-GUI."