Commit | Line | Data |
---|---|---|
970ed795 | 1 | ############################################################################### |
d44e3c4f | 2 | # Copyright (c) 2000-2016 Ericsson Telecom AB |
970ed795 EL |
3 | # All rights reserved. This program and the accompanying materials |
4 | # are made available under the terms of the Eclipse Public License v1.0 | |
5 | # which accompanies this distribution, and is available at | |
6 | # http://www.eclipse.org/legal/epl-v10.html | |
d44e3c4f | 7 | # |
8 | # Contributors: | |
9 | # > | |
10 | # Baji, Laszlo | |
11 | # Balasko, Jeno | |
12 | # Baranyi, Botond | |
13 | # Beres, Szabolcs | |
14 | # Delic, Adam | |
15 | # Feher, Csaba | |
16 | # Forstner, Matyas | |
17 | # Kovacs, Ferenc | |
18 | # Kremer, Peter | |
19 | # Lovassy, Arpad | |
20 | # Ormandi, Matyas | |
21 | # Pandi, Krisztian | |
22 | # Raduly, Csaba | |
23 | # Szabados, Kristof | |
24 | # Szabo, Janos Zoltan – initial implementation | |
25 | # Szalai, Endre | |
26 | # Zalanyi, Balazs Andor | |
27 | # | |
970ed795 EL |
28 | ############################################################################### |
29 | ifndef TOP | |
30 | $(error please define TOP) | |
31 | endif | |
32 | ||
33 | # Configurations for the Free Open Source Software version, if available | |
34 | ifneq ($(wildcard $(TOP)/MakefileFOSS.cfg), ) | |
35 | include $(TOP)/MakefileFOSS.cfg | |
36 | else | |
37 | # Set whether licensing is enabled: (yes or no) | |
38 | LICENSING := yes | |
39 | ||
40 | # Set whether to send usage statistics: (yes or no) | |
41 | USAGE_STATS := yes | |
42 | endif | |
43 | ||
44 | # Define SRCDIR to the root of Titan sources to enable out-of-tree build | |
45 | #SRCDIR := ${HOME}/workspace/TTCNv3 | |
46 | ||
47 | # Set these variables to fit your system: | |
48 | ||
49 | # The target directory where the Test Executor will be installed to: | |
50 | TTCN3_DIR := ${TOP}/Install | |
51 | ||
52 | # New installed files are run from make install, so they are added to the PATH | |
53 | PATH := ${PATH}:${TTCN3_DIR}/bin | |
54 | ||
55 | # Set it to 'yes' for developing or 'no' for release. | |
56 | DEBUG := no | |
57 | ||
58 | # Set it to 'yes' to generate coverage data (requires DEBUG=yes) | |
59 | COVERAGE := no | |
60 | ||
61 | # Your platform. Allowed values: SOLARIS, SOLARIS8, LINUX, FREEBSD, | |
62 | # WIN32. Decided automagically if not defined (recommended). | |
63 | # PLATFORM := | |
64 | ||
65 | # Uncomment the following for "native" Win32 | |
66 | #MINGW := -DMINGW -mno-cygwin | |
67 | ||
68 | # Utility for building lexical analyzers (tokenizers): | |
69 | FLEX := flex | |
70 | ||
71 | # Utility for building parsers: | |
72 | BISON := bison | |
73 | ||
74 | # The C compiler used for building: | |
75 | CC := gcc | |
76 | ||
77 | # The C++ compiler used for building: | |
78 | CXX := g++ | |
79 | ||
80 | # generate userguide at install ('make release' always generates it) | |
81 | GEN_PDF := no | |
82 | ||
83 | # Set whether to build the CLI for MC: (yes or no) | |
84 | CLI := yes | |
85 | ||
86 | # set whether to build the JNI native library: (yes or no) | |
87 | JNI := yes | |
88 | ||
89 | # Path of the Java Developement Kit installation | |
90 | # (must be at least version 1.5.0_10) | |
19700695 | 91 | <<<<<<< HEAD |
92 | JDKDIR := /usr/lib/jvm/default-java | |
93 | ======= | |
26d873cb | 94 | JDKDIR := /usr/lib/jvm/default-java |
19700695 | 95 | >>>>>>> 4a0c4186d3c98f51d0735e21cca5918568a7082b |
970ed795 EL |
96 | |
97 | # Path of OpenSSL installation: (always required) | |
98 | OPENSSL_DIR := default | |
99 | ||
100 | # Location of libxml2 | |
101 | XMLDIR := default | |
102 | ||
970ed795 EL |
103 | # Flags for the C(++) preprocessor: |
104 | # Prevent a warning about yyinput being defined but not used | |
105 | CPPFLAGS := -DYY_NO_INPUT | |
970ed795 EL |
106 | |
107 | # Flags shared between C and C++ | |
108 | COMPILERFLAGS := -Wall | |
109 | ||
110 | # 'Hardcore' settings | |
111 | # Unlikely to work for GCC below 4.x | |
112 | #COMPILERFLAGS += -Werror -pedantic -W -Wno-unused-parameter -O1 | |
113 | ||
114 | # Flags for the C compiler. | |
115 | # std=gnu9x shuts up warnings about long long and variadic macros | |
116 | CCFLAGS = $(COMPILERFLAGS) -std=gnu9x | |
3abe9331 | 117 | |
118 | # Flags for the C++ compiler: | |
119 | CXXFLAGS = $(COMPILERFLAGS) -Wno-long-long | |
120 | ||
121 | # The command for maintaining static libraries: | |
122 | AR := ar | |
123 | ||
124 | # The command for building the shared libraries: | |
125 | # It shall be set to either "$(CXX) -G" or "$(CXX) -shared" depending | |
126 | # on the linker you use. | |
127 | LD = $(CXX) -shared | |
128 | ||
129 | # Flags for linking binary executables (e.g. for profiling): | |
130 | LDFLAGS = $(MINGW) | |
131 | ||
132 | # The command for removing symbol table from the executables: | |
133 | STRIP := strip | |
134 | ||
135 | # Flags for flex: | |
136 | FLEXFLAGS := -B -s -Cr | |
137 | ||
138 | # Flags for bison: | |
139 | BISONFLAGS := -d | |
140 | ||
141 | # Override common settings with personal preferences if needed | |
142 | -include $(TOP)/Makefile.personal | |
143 | ||
144 | ## ## ## ## ## Variables below are automatically set ## ## ## ## ## | |
145 | ||
146 | ifeq ($(DEBUG), yes) | |
147 | CPPFLAGS += -DMEMORY_DEBUG -DFATAL_DEBUG | |
148 | else | |
149 | CPPFLAGS += -DNDEBUG | |
150 | endif | |
151 | ||
152 | # MingW flags need to be passed to the preprocessor during ctags configure | |
153 | CPPFLAGS += $(MINGW) | |
154 | ||
970ed795 EL |
155 | ifeq ($(DEBUG), yes) |
156 | CCFLAGS += -g | |
157 | CCFLAGS += -Wshadow -Wpointer-arith -Wcast-qual -Wcast-align \ | |
158 | -Wstrict-prototypes | |
3abe9331 | 159 | else |
160 | ifeq ($(COVERAGE), yes) | |
161 | CCFLAGS += -O0 | |
970ed795 EL |
162 | else |
163 | CCFLAGS += -O2 | |
164 | endif | |
3abe9331 | 165 | endif |
970ed795 EL |
166 | |
167 | # Only the default Cygwin compiler can be used for Mingw. | |
168 | # Its version is 3.4.4, too low. | |
169 | ifndef MINGW | |
170 | # Only GCC 4.x understands -Wno-variadic-macros, comment out for lower versions | |
171 | #CXXFLAGS += -Wno-variadic-macros | |
172 | endif | |
173 | ||
174 | ifeq ($(DEBUG), yes) | |
175 | CXXFLAGS += -g | |
176 | CXXFLAGS += -Wshadow -Wpointer-arith -Wcast-qual -Wcast-align | |
3abe9331 | 177 | else |
178 | ifeq ($(COVERAGE), yes) | |
179 | CXXFLAGS += -O0 | |
970ed795 EL |
180 | else |
181 | CXXFLAGS += -O2 | |
182 | endif | |
3abe9331 | 183 | endif |
970ed795 EL |
184 | |
185 | # Flags for the C/C++ compilers to generate dependency list (-M or -MM | |
186 | # for gcc or clang, -xM or -xM1 for Sun C compiler). | |
187 | ||
188 | ifneq ($(filter gcc% clang%, $(notdir $(CC))),) | |
189 | CCDEPFLAG := -MM | |
190 | CXXDEPFLAG := -MM | |
191 | else | |
192 | # Let's hope it's the Sun compiler | |
193 | CCDEPFLAG := -xM1 | |
194 | CXXDEPFLAG := -xM1 | |
195 | endif | |
196 | ||
970ed795 EL |
197 | ifeq ($(DEBUG), yes) |
198 | LDFLAGS += -g | |
199 | endif | |
200 | ||
970ed795 | 201 | |
970ed795 EL |
202 | ifeq ($(DEBUG), yes) |
203 | FLEXFLAGS += -b -p | |
204 | # FLEXFLAGS += -d | |
205 | else | |
206 | # Comment out the line below if flex version 2.5.4[a] is used. | |
207 | # This version does not support optimized tables together with yylineno. | |
208 | FLEXFLAGS += -Cfe | |
209 | endif | |
210 | ||
3abe9331 | 211 | |
970ed795 EL |
212 | ifeq ($(DEBUG), yes) |
213 | BISONFLAGS += -t -v | |
214 | endif | |
215 | ||
216 | ifeq ($(COVERAGE), yes) | |
970ed795 EL |
217 | CPPFLAGS += -DCOVERAGE_BUILD |
218 | COMPILERFLAGS += -fprofile-arcs -ftest-coverage | |
219 | LDFLAGS += -fprofile-arcs -ftest-coverage -lgcov | |
220 | endif | |
970ed795 EL |
221 | |
222 | # Directory which contains the code for POSIX regular expression handling. | |
223 | # It is needed on platforms where the system's libc does not support POSIX | |
224 | # regexps. This is the case for Mingw. | |
225 | ifdef MINGW | |
226 | # If your platform isn't Mingw but lacks POSIX regular expressions, | |
227 | # comment out the ifdef/endif | |
228 | REGEX_DIR := /mnt/TTCN/Tools/CPP/regex-glibc-2.5.1 | |
229 | endif | |
230 | ||
231 | # Warning! Never set the above directories to /usr. | |
232 | # If your OpenSSL, Qt is installed under /usr you'd better set | |
233 | # these variables to a fake (non-existent) directory. If this is the case, | |
234 | # gcc will find the required headers and libs anyway, but -I/usr/include | |
235 | # might confuse it. | |
236 | ||
237 | # This is especially true on Windows with Mingw installed as a Cygwin package. | |
238 | # -mno-cygwin alters the include serach path to find the Mingw headers. | |
239 | # Passing -I/usr/include would cause the Mingw compiler to read the Cygwin | |
240 | # headers, and the compilation will fail. | |
241 | ||
242 | # The path name where the LaTeX binaries can be found. (optional) | |
243 | # If this variable is not defined the User Documentation will not be built | |
244 | # or installed. | |
245 | TEXPATH := /usr/local/teTeX2.0.2/bin/sparc-sun-solaris2.8 | |
246 | ||
970ed795 EL |
247 | |
248 | ########################################################################### | |
249 | # You don't have to alter anything below this line. | |
250 | ||
251 | # Setting PLATFORM automagically if it is not defined. | |
252 | ifndef PLATFORM | |
253 | PLATFORM1 := $(shell uname -s) | |
254 | PLATFORM2 := $(shell uname -r) | |
255 | PLATFORM3 := $(shell uname -m) | |
256 | ifeq ($(PLATFORM1), SunOS) | |
257 | ifneq ($(PLATFORM2), 5.6) | |
258 | PLATFORM := SOLARIS8 | |
259 | PLATSUFFIX = -sol8 | |
260 | else | |
261 | PLATFORM := SOLARIS | |
262 | PLATSUFFIX = -sol6 | |
263 | endif # 5.8 | |
264 | endif # SunOS | |
265 | ifeq ($(PLATFORM1), Linux) | |
266 | PLATFORM := LINUX | |
267 | PLATSUFFIX = -linux | |
268 | endif # Linux | |
269 | ifeq ($(PLATFORM1), FreeBSD) | |
270 | PLATFORM := FREEBSD | |
271 | endif # FreeBSD | |
272 | ifeq ($(findstring CYGWIN, $(PLATFORM1)), CYGWIN) | |
273 | PLATFORM := WIN32 | |
274 | PLATSUFFIX = -cygwin | |
275 | endif # CYGWIN | |
276 | endif # ifndef PLATFORM | |
277 | ifndef PLATFORM | |
278 | PLATFORM := $(error PLEASE CHECK THE PLATFORM SETTINGS) | |
279 | endif # ifndef PLATFORM | |
280 | ||
281 | # Derived variables, which you should never change. | |
282 | ||
283 | ifdef MINGW | |
284 | ||
285 | # Target directory for binaries: | |
286 | BINDIR := $(TTCN3_DIR)/programs | |
287 | # Target directory for manual pages: | |
288 | MANDIR := $(TTCN3_DIR)/manuals | |
289 | # Target directory for other files (nedit/xemacs additions, etc.) | |
290 | ETCDIR := $(TTCN3_DIR) | |
291 | ||
292 | else | |
293 | ||
294 | # Target directory for binaries: | |
295 | BINDIR := $(TTCN3_DIR)/bin | |
296 | # Target directory for manual pages: | |
297 | MANDIR := $(TTCN3_DIR)/man | |
298 | # Target directory for other files (nedit/xemacs additions, etc.) | |
299 | ETCDIR := $(TTCN3_DIR)/etc | |
300 | ||
301 | endif | |
302 | ||
303 | # Target directory for header files: | |
304 | INCDIR := $(TTCN3_DIR)/include | |
305 | # Target directory for libraries: | |
306 | LIBDIR := $(TTCN3_DIR)/lib | |
307 | # Target directory for html help pages: | |
308 | HELPDIR := $(TTCN3_DIR)/help | |
309 | # Target directory for the documentation: | |
310 | DOCDIR := $(TTCN3_DIR)/doc | |
311 | # Target directory for the demo "Hello World!" | |
312 | DEMODIR := $(TTCN3_DIR)/demo | |
313 | ||
314 | CPPFLAGS += -D$(PLATFORM) | |
315 | ||
316 | ifeq ($(LICENSING), yes) | |
317 | CPPFLAGS += -DLICENSE | |
318 | LICENSE_LIBS = -L$(OPENSSL_DIR)/lib -lcrypto | |
319 | else | |
320 | LICENSE_LIBS := | |
321 | endif | |
322 | ||
323 | ifeq ($(USAGE_STATS), yes) | |
324 | CPPFLAGS += -DUSAGE_STATS | |
325 | endif | |
326 | ||
327 | # Windows/Cygwin specific settings | |
328 | ifeq ($(PLATFORM), WIN32) | |
329 | EXESUFFIX := .exe | |
330 | LDFLAGS += -Wl,--enable-auto-import,--enable-runtime-pseudo-reloc | |
331 | ||
332 | ifdef MINGW | |
333 | MINGW_LIBS := -lgdi32 | |
334 | endif | |
335 | else | |
336 | EXESUFFIX := | |
337 | ||
338 | ifdef MINGW | |
339 | $(error MingW not supported on $(PLATFORM)) | |
340 | endif | |
341 | ||
342 | CCFLAGS += -fPIC | |
343 | CXXFLAGS += -fPIC | |
344 | LDFLAGS += -fPIC | |
345 | endif | |
346 | ||
347 | # Try to use -isystem for Qt headers (this is a GCC feature). | |
348 | # This avoids the myriads of warnings issued for the Qt headers. | |
349 | ifneq (,$(findstring SOLARIS,$(PLATFORM))) | |
350 | # Avoid using it on Solaris, because | |
351 | # -isystem puts an implicit "extern C" around every system header, | |
352 | # which causes compilation of Qt headers to fail miserably :-( | |
353 | # (this could be fixed by recompiling GCC) | |
354 | INCLUDEQT := -I | |
355 | else | |
356 | # Not Solaris | |
357 | INCLUDEQT := -isystem | |
358 | endif | |
359 | ||
360 | # Setting EPOLL usage - It is Linux specific | |
361 | ifeq ($(PLATFORM), LINUX) | |
362 | CPPFLAGS += -DUSE_EPOLL | |
363 | endif | |
364 | ||
365 | #not useful in compiler2/asn1, for example | |
366 | #REL_DIR := $(notdir $(CURDIR)) | |
367 | ||
368 | export ABS_TOP := $(abspath $(TOP))/ | |
369 | ifeq "$(ABS_TOP)" "/" | |
370 | # abspath only from GNU make 3.81, here's a replacement | |
371 | ABS_TOP := $(shell cd $(TOP); pwd)/ | |
372 | endif | |
373 | ||
374 | ifdef SRCDIR | |
375 | ||
376 | REL_DIR := $(subst $(ABS_TOP),,$(CURDIR)) | |
377 | ||
378 | ABS_SRC := $(SRCDIR)/$(REL_DIR) | |
379 | ||
380 | CPPFLAGS += -I. -I$(ABS_SRC) | |
381 | ||
382 | SRC_TOP := $(SRCDIR) | |
383 | ||
384 | else | |
385 | ||
386 | ABS_SRC := $(abspath $(CURDIR)) | |
387 | ifeq "$(ABS_SRC)" "" | |
388 | ABS_SRC := $(shell cd $(CURDIR); pwd) | |
389 | endif | |
390 | ||
391 | SRC_TOP := $(TOP) | |
392 | ||
393 | endif | |
394 | ||
395 |