forked from szberes/titan.core
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Makefile.cfg
406 lines (320 loc) · 10 KB
/
Makefile.cfg
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
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
###############################################################################
# Copyright (c) 2000-2018 Ericsson Telecom AB
# All rights reserved. This program and the accompanying materials
# are made available under the terms of the Eclipse Public License v2.0
# which accompanies this distribution, and is available at
# https://www.eclipse.org/org/documents/epl-2.0/EPL-2.0.html
#
# Contributors:
# Baji, Laszlo
# Balasko, Jeno
# Baranyi, Botond
# Beres, Szabolcs
# Delic, Adam
# Feher, Csaba
# Forstner, Matyas
# Kovacs, Ferenc
# Kremer, Peter
# Lovassy, Arpad
# Ormandi, Matyas
# Pandi, Krisztian
# Raduly, Csaba
# Szabados, Kristof
# Szabo, Janos Zoltan – initial implementation
# Szalai, Endre
# Zalanyi, Balazs Andor
#
###############################################################################
ifndef TOP
$(error please define TOP)
endif
# Configurations for the Free Open Source Software version, if available
ifneq ($(wildcard $(TOP)/MakefileFOSS.cfg), )
include $(TOP)/MakefileFOSS.cfg
else
# Set whether licensing is enabled: (yes or no)
LICENSING := yes
# Set whether to send usage statistics: (yes or no)
USAGE_STATS := yes
endif
# Define SRCDIR to the root of Titan sources to enable out-of-tree build
#SRCDIR := ${HOME}/workspace/TTCNv3
# Set these variables to fit your system:
# The target directory where the Test Executor will be installed to:
TTCN3_DIR := ${TOP}/Install
# New installed files are run from make install, so they are added to the PATH
PATH := ${PATH}:${TTCN3_DIR}/bin
# Set it to 'yes' for developing or 'no' for release.
DEBUG := no
# Set it to 'yes' to generate coverage data (requires DEBUG=yes)
COVERAGE := no
# Set it to 'yes' to enable extra features for the debugger UI in single mode
# (this requires an extra library when linking the generated code).
# Set it to 'no' to use a simplified debugger UI.
ADVANCED_DEBUGGER_UI := no
# Your platform. Allowed values: SOLARIS, SOLARIS8, LINUX, FREEBSD,
# WIN32. Decided automagically if not defined (recommended).
# PLATFORM :=
# Uncomment the following for "native" Win32
#MINGW := -DMINGW -mno-cygwin
# Utility for building lexical analyzers (tokenizers):
FLEX := flex
# Utility for building parsers:
BISON := bison
# The C compiler used for building:
CC := gcc
# The C++ compiler used for building:
CXX := g++
# generate userguide at install ('make release' always generates it)
GEN_PDF := no
# Set whether to build the CLI for MC: (yes or no)
CLI := yes
# set whether to build the JNI native library: (yes or no)
JNI := yes
# Build the LTTng-UST logger plugin
LTTNGUSTLOGGER := no
# Path of the Java Developement Kit installation
# (must be at least version 1.5.0_10)
JDKDIR := /usr/lib/jvm/default-java
# Path of OpenSSL installation: (always required)
OPENSSL_DIR := default
# Location of libxml2
XMLDIR := default
# Flags for the C(++) preprocessor:
# Prevent a warning about yyinput being defined but not used
CPPFLAGS += -DYY_NO_INPUT
# Flags shared between C and C++
COMPILERFLAGS := -Wall
# 'Hardcore' settings
# Unlikely to work for GCC below 4.x
#COMPILERFLAGS += -Werror -pedantic -W -Wno-unused-parameter -O1
# Flags for the C compiler.
# std=gnu9x shuts up warnings about long long and variadic macros
CCFLAGS += $(COMPILERFLAGS) -std=gnu9x
# Flags for the C++ compiler:
CXXFLAGS += $(COMPILERFLAGS) -Wno-long-long
# The command for maintaining static libraries:
AR := ar
# The command for building the shared libraries:
# It shall be set to either "$(CXX) -G" or "$(CXX) -shared" depending
# on the linker you use.
LD = $(CXX) -shared
# Flags for linking binary executables (e.g. for profiling):
LDFLAGS += $(MINGW)
# The command for removing symbol table from the executables:
STRIP := strip
# Flags for flex:
FLEXFLAGS := -B -s -Cr
# Flags for bison:
BISONFLAGS := -d
# Override common settings with personal preferences if needed
-include $(TOP)/Makefile.personal
## ## ## ## ## Variables below are automatically set ## ## ## ## ##
ifeq ($(DEBUG), yes)
CPPFLAGS += -DMEMORY_DEBUG -DFATAL_DEBUG
else
CPPFLAGS += -DNDEBUG
endif
# MingW flags need to be passed to the preprocessor during ctags configure
CPPFLAGS += $(MINGW)
ifeq ($(DEBUG), yes)
CCFLAGS += -g
CCFLAGS += -Wshadow -Wpointer-arith -Wcast-qual -Wcast-align \
-Wstrict-prototypes
else
ifeq ($(COVERAGE), yes)
CCFLAGS += -O0
else
CCFLAGS += -O2
endif
endif
# Only the default Cygwin compiler can be used for Mingw.
# Its version is 3.4.4, too low.
ifndef MINGW
# Only GCC 4.x understands -Wno-variadic-macros, comment out for lower versions
#CXXFLAGS += -Wno-variadic-macros
endif
ifeq ($(DEBUG), yes)
CXXFLAGS += -g
CXXFLAGS += -Wshadow -Wpointer-arith -Wcast-qual -Wcast-align
else
ifeq ($(COVERAGE), yes)
CXXFLAGS += -O0
else
CXXFLAGS += -O2
endif
endif
# Flags for the C/C++ compilers to generate dependency list (-M or -MM
# for gcc or clang, -xM or -xM1 for Sun C compiler).
ifneq ($(filter gcc% clang%, $(notdir $(CC))),)
CCDEPFLAG := -MM
CXXDEPFLAG := -MM
else
# Let's hope it's the Sun compiler
CCDEPFLAG := -xM1
CXXDEPFLAG := -xM1
endif
ifeq ($(DEBUG), yes)
LDFLAGS += -g
endif
ifeq ($(DEBUG), yes)
FLEXFLAGS += -b -p
# FLEXFLAGS += -d
else
# Comment out the line below if flex version 2.5.4[a] is used.
# This version does not support optimized tables together with yylineno.
FLEXFLAGS += -Cfe
endif
ifeq ($(DEBUG), yes)
BISONFLAGS += -t -v
endif
ifeq ($(COVERAGE), yes)
CPPFLAGS += -DCOVERAGE_BUILD
COMPILERFLAGS += -fprofile-arcs -ftest-coverage
LDFLAGS += -fprofile-arcs -ftest-coverage -lgcov
endif
ifeq ($(ADVANCED_DEBUGGER_UI), yes)
CPPFLAGS += -DADVANCED_DEBUGGER_UI
endif
# Directory which contains the code for POSIX regular expression handling.
# It is needed on platforms where the system's libc does not support POSIX
# regexps. This is the case for Mingw.
ifdef MINGW
# If your platform isn't Mingw but lacks POSIX regular expressions,
# comment out the ifdef/endif
REGEX_DIR := /mnt/TTCN/Tools/CPP/regex-glibc-2.5.1
endif
# Warning! Never set the above directories to /usr.
# If your OpenSSL, Qt is installed under /usr you'd better set
# these variables to a fake (non-existent) directory. If this is the case,
# gcc will find the required headers and libs anyway, but -I/usr/include
# might confuse it.
# This is especially true on Windows with Mingw installed as a Cygwin package.
# -mno-cygwin alters the include serach path to find the Mingw headers.
# Passing -I/usr/include would cause the Mingw compiler to read the Cygwin
# headers, and the compilation will fail.
# The path name where the LaTeX binaries can be found. (optional)
# If this variable is not defined the User Documentation will not be built
# or installed.
TEXPATH := /usr/local/teTeX2.0.2/bin/sparc-sun-solaris2.8
###########################################################################
# You don't have to alter anything below this line.
# Setting PLATFORM automagically if it is not defined.
ifndef PLATFORM
PLATFORM1 := $(shell uname -s)
PLATFORM2 := $(shell uname -r)
PLATFORM3 := $(shell uname -m)
ifeq ($(PLATFORM1), SunOS)
ifneq ($(PLATFORM2), 5.6)
PLATFORM := SOLARIS8
PLATSUFFIX = -sol8
else
PLATFORM := SOLARIS
PLATSUFFIX = -sol6
endif # 5.8
endif # SunOS
ifeq ($(PLATFORM1), Linux)
PLATFORM := LINUX
PLATSUFFIX = -linux
endif # Linux
ifeq ($(PLATFORM1), FreeBSD)
PLATFORM := FREEBSD
endif # FreeBSD
ifeq ($(findstring CYGWIN, $(PLATFORM1)), CYGWIN)
PLATFORM := WIN32
PLATSUFFIX = -cygwin
endif # CYGWIN
endif # ifndef PLATFORM
ifndef PLATFORM
PLATFORM := $(error PLEASE CHECK THE PLATFORM SETTINGS)
endif # ifndef PLATFORM
# Derived variables, which you should never change.
ifdef MINGW
# Target directory for binaries:
BINDIR := $(TTCN3_DIR)/programs
# Target directory for manual pages:
MANDIR := $(TTCN3_DIR)/manuals
# Target directory for other files (nedit/xemacs additions, etc.)
ETCDIR := $(TTCN3_DIR)
else
# Target directory for binaries:
BINDIR := $(TTCN3_DIR)/bin
# Target directory for manual pages:
MANDIR := $(TTCN3_DIR)/man
# Target directory for other files (nedit/xemacs additions, etc.)
ETCDIR := $(TTCN3_DIR)/etc
endif
# Target directory for header files:
INCDIR := $(TTCN3_DIR)/include
# Target directory for libraries:
LIBDIR := $(TTCN3_DIR)/lib
# Target directory for html help pages:
HELPDIR := $(TTCN3_DIR)/help
# Target directory for the documentation:
DOCDIR := $(TTCN3_DIR)/doc
# Target directory for the demo "Hello World!"
DEMODIR := $(TTCN3_DIR)/demo
CPPFLAGS += -D$(PLATFORM)
ifeq ($(LICENSING), yes)
CPPFLAGS += -DLICENSE
LICENSE_LIBS = -L$(OPENSSL_DIR)/lib -lcrypto
else
LICENSE_LIBS :=
endif
ifeq ($(USAGE_STATS), yes)
CPPFLAGS += -DUSAGE_STATS
endif
# Windows/Cygwin specific settings
ifeq ($(PLATFORM), WIN32)
EXESUFFIX := .exe
LDFLAGS += -Wl,--enable-auto-import,--enable-runtime-pseudo-reloc
ifdef MINGW
MINGW_LIBS := -lgdi32
endif
else
EXESUFFIX :=
ifdef MINGW
$(error MingW not supported on $(PLATFORM))
endif
CCFLAGS += -fPIC
CXXFLAGS += -fPIC
LDFLAGS += -fPIC
endif
# Try to use -isystem for Qt headers (this is a GCC feature).
# This avoids the myriads of warnings issued for the Qt headers.
ifneq (,$(findstring SOLARIS,$(PLATFORM)))
# Avoid using it on Solaris, because
# -isystem puts an implicit "extern C" around every system header,
# which causes compilation of Qt headers to fail miserably :-(
# (this could be fixed by recompiling GCC)
INCLUDEQT := -I
else
# Not Solaris
INCLUDEQT := -isystem
endif
# Setting EPOLL usage - It is Linux specific
ifeq ($(PLATFORM), LINUX)
CPPFLAGS += -DUSE_EPOLL
endif
ifdef ALPINE_LINUX
CPPFLAGS += -DALPINE_LINUX
endif
#not useful in compiler2/asn1, for example
#REL_DIR := $(notdir $(CURDIR))
export ABS_TOP := $(abspath $(TOP))/
ifeq "$(ABS_TOP)" "/"
# abspath only from GNU make 3.81, here's a replacement
ABS_TOP := $(shell cd $(TOP); pwd)/
endif
ifdef SRCDIR
REL_DIR := $(subst $(ABS_TOP),,$(CURDIR))
ABS_SRC := $(SRCDIR)/$(REL_DIR)
CPPFLAGS += -I. -I$(ABS_SRC)
SRC_TOP := $(SRCDIR)
else
ABS_SRC := $(abspath $(CURDIR))
ifeq "$(ABS_SRC)" ""
ABS_SRC := $(shell cd $(CURDIR); pwd)
endif
SRC_TOP := $(TOP)
endif