Merge pull request #38 from gpilisi/master
[deliverable/titan.core.git] / Makefile.cfg
CommitLineData
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###############################################################################
29ifndef TOP
30$(error please define TOP)
31endif
32
33# Configurations for the Free Open Source Software version, if available
34ifneq ($(wildcard $(TOP)/MakefileFOSS.cfg), )
35 include $(TOP)/MakefileFOSS.cfg
36else
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
42endif
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:
50TTCN3_DIR := ${TOP}/Install
51
52# New installed files are run from make install, so they are added to the PATH
53PATH := ${PATH}:${TTCN3_DIR}/bin
54
55# Set it to 'yes' for developing or 'no' for release.
56DEBUG := no
57
58# Set it to 'yes' to generate coverage data (requires DEBUG=yes)
59COVERAGE := 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):
69FLEX := flex
70
71# Utility for building parsers:
72BISON := bison
73
74# The C compiler used for building:
75CC := gcc
76
77# The C++ compiler used for building:
78CXX := g++
79
80# generate userguide at install ('make release' always generates it)
81GEN_PDF := no
82
83# Set whether to build the CLI for MC: (yes or no)
84CLI := yes
85
86# set whether to build the JNI native library: (yes or no)
87JNI := yes
88
89# Path of the Java Developement Kit installation
90# (must be at least version 1.5.0_10)
9e07d6a9 91<<<<<<< HEAD
26d873cb 92JDKDIR := /usr/lib/jvm/default-java
9e07d6a9 93=======
31480fef 94JDKDIR := /usr/lib/jvm/default-java
9e07d6a9 95>>>>>>> 318d000115c0c01e0d7077166c13a9ab3918e287
970ed795
EL
96
97# Path of OpenSSL installation: (always required)
98OPENSSL_DIR := default
99
100# Location of libxml2
101XMLDIR := default
102
970ed795
EL
103# Flags for the C(++) preprocessor:
104# Prevent a warning about yyinput being defined but not used
105CPPFLAGS := -DYY_NO_INPUT
970ed795
EL
106
107# Flags shared between C and C++
108COMPILERFLAGS := -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
116CCFLAGS = $(COMPILERFLAGS) -std=gnu9x
3abe9331 117
118# Flags for the C++ compiler:
119CXXFLAGS = $(COMPILERFLAGS) -Wno-long-long
120
121# The command for maintaining static libraries:
122AR := 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.
127LD = $(CXX) -shared
128
129# Flags for linking binary executables (e.g. for profiling):
130LDFLAGS = $(MINGW)
131
132# The command for removing symbol table from the executables:
133STRIP := strip
134
135# Flags for flex:
136FLEXFLAGS := -B -s -Cr
137
138# Flags for bison:
139BISONFLAGS := -d
140
141# Override common settings with personal preferences if needed
142-include $(TOP)/Makefile.personal
143
144## ## ## ## ## Variables below are automatically set ## ## ## ## ##
145
146ifeq ($(DEBUG), yes)
147 CPPFLAGS += -DMEMORY_DEBUG -DFATAL_DEBUG
148else
149 CPPFLAGS += -DNDEBUG
150endif
151
152# MingW flags need to be passed to the preprocessor during ctags configure
153CPPFLAGS += $(MINGW)
154
970ed795
EL
155ifeq ($(DEBUG), yes)
156 CCFLAGS += -g
157 CCFLAGS += -Wshadow -Wpointer-arith -Wcast-qual -Wcast-align \
158 -Wstrict-prototypes
3abe9331 159else
160ifeq ($(COVERAGE), yes)
161 CCFLAGS += -O0
970ed795
EL
162else
163 CCFLAGS += -O2
164endif
3abe9331 165endif
970ed795
EL
166
167# Only the default Cygwin compiler can be used for Mingw.
168# Its version is 3.4.4, too low.
169ifndef MINGW
170# Only GCC 4.x understands -Wno-variadic-macros, comment out for lower versions
171#CXXFLAGS += -Wno-variadic-macros
172endif
173
174ifeq ($(DEBUG), yes)
175 CXXFLAGS += -g
176 CXXFLAGS += -Wshadow -Wpointer-arith -Wcast-qual -Wcast-align
3abe9331 177else
178ifeq ($(COVERAGE), yes)
179 CXXFLAGS += -O0
970ed795
EL
180else
181 CXXFLAGS += -O2
182endif
3abe9331 183endif
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
188ifneq ($(filter gcc% clang%, $(notdir $(CC))),)
189CCDEPFLAG := -MM
190CXXDEPFLAG := -MM
191else
192# Let's hope it's the Sun compiler
193CCDEPFLAG := -xM1
194CXXDEPFLAG := -xM1
195endif
196
970ed795
EL
197ifeq ($(DEBUG), yes)
198 LDFLAGS += -g
199endif
200
970ed795 201
970ed795
EL
202ifeq ($(DEBUG), yes)
203 FLEXFLAGS += -b -p
204# FLEXFLAGS += -d
205else
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
209endif
210
3abe9331 211
970ed795
EL
212ifeq ($(DEBUG), yes)
213 BISONFLAGS += -t -v
214endif
215
216ifeq ($(COVERAGE), yes)
970ed795
EL
217 CPPFLAGS += -DCOVERAGE_BUILD
218 COMPILERFLAGS += -fprofile-arcs -ftest-coverage
219 LDFLAGS += -fprofile-arcs -ftest-coverage -lgcov
220endif
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.
225ifdef MINGW
226# If your platform isn't Mingw but lacks POSIX regular expressions,
227# comment out the ifdef/endif
228REGEX_DIR := /mnt/TTCN/Tools/CPP/regex-glibc-2.5.1
229endif
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.
245TEXPATH := /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.
252ifndef PLATFORM
253PLATFORM1 := $(shell uname -s)
254PLATFORM2 := $(shell uname -r)
255PLATFORM3 := $(shell uname -m)
256ifeq ($(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
264endif # SunOS
265ifeq ($(PLATFORM1), Linux)
266 PLATFORM := LINUX
267 PLATSUFFIX = -linux
268endif # Linux
269ifeq ($(PLATFORM1), FreeBSD)
270 PLATFORM := FREEBSD
271endif # FreeBSD
272ifeq ($(findstring CYGWIN, $(PLATFORM1)), CYGWIN)
273 PLATFORM := WIN32
274 PLATSUFFIX = -cygwin
275endif # CYGWIN
276endif # ifndef PLATFORM
277ifndef PLATFORM
278 PLATFORM := $(error PLEASE CHECK THE PLATFORM SETTINGS)
279endif # ifndef PLATFORM
280
281# Derived variables, which you should never change.
282
283ifdef MINGW
284
285# Target directory for binaries:
286BINDIR := $(TTCN3_DIR)/programs
287# Target directory for manual pages:
288MANDIR := $(TTCN3_DIR)/manuals
289# Target directory for other files (nedit/xemacs additions, etc.)
290ETCDIR := $(TTCN3_DIR)
291
292else
293
294# Target directory for binaries:
295BINDIR := $(TTCN3_DIR)/bin
296# Target directory for manual pages:
297MANDIR := $(TTCN3_DIR)/man
298# Target directory for other files (nedit/xemacs additions, etc.)
299ETCDIR := $(TTCN3_DIR)/etc
300
301endif
302
303# Target directory for header files:
304INCDIR := $(TTCN3_DIR)/include
305# Target directory for libraries:
306LIBDIR := $(TTCN3_DIR)/lib
307# Target directory for html help pages:
308HELPDIR := $(TTCN3_DIR)/help
309# Target directory for the documentation:
310DOCDIR := $(TTCN3_DIR)/doc
311# Target directory for the demo "Hello World!"
312DEMODIR := $(TTCN3_DIR)/demo
313
314CPPFLAGS += -D$(PLATFORM)
315
316ifeq ($(LICENSING), yes)
317 CPPFLAGS += -DLICENSE
318 LICENSE_LIBS = -L$(OPENSSL_DIR)/lib -lcrypto
319else
320 LICENSE_LIBS :=
321endif
322
323ifeq ($(USAGE_STATS), yes)
324 CPPFLAGS += -DUSAGE_STATS
325endif
326
327# Windows/Cygwin specific settings
328ifeq ($(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
335else
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
345endif
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.
349ifneq (,$(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
355else
356# Not Solaris
357 INCLUDEQT := -isystem
358endif
359
360# Setting EPOLL usage - It is Linux specific
361ifeq ($(PLATFORM), LINUX)
362 CPPFLAGS += -DUSE_EPOLL
363endif
364
365#not useful in compiler2/asn1, for example
366#REL_DIR := $(notdir $(CURDIR))
367
368export ABS_TOP := $(abspath $(TOP))/
369ifeq "$(ABS_TOP)" "/"
370# abspath only from GNU make 3.81, here's a replacement
371ABS_TOP := $(shell cd $(TOP); pwd)/
372endif
373
374ifdef SRCDIR
375
376REL_DIR := $(subst $(ABS_TOP),,$(CURDIR))
377
378ABS_SRC := $(SRCDIR)/$(REL_DIR)
379
380CPPFLAGS += -I. -I$(ABS_SRC)
381
382SRC_TOP := $(SRCDIR)
383
384else
385
386ABS_SRC := $(abspath $(CURDIR))
387ifeq "$(ABS_SRC)" ""
388ABS_SRC := $(shell cd $(CURDIR); pwd)
389endif
390
391SRC_TOP := $(TOP)
392
393endif
394
395
This page took 0.059844 seconds and 5 git commands to generate.