Merge pull request #61 from BenceJanosSzabo/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)
19700695 91JDKDIR := /usr/lib/jvm/default-java
970ed795
EL
92
93# Path of OpenSSL installation: (always required)
94OPENSSL_DIR := default
95
96# Location of libxml2
97XMLDIR := default
98
970ed795
EL
99# Flags for the C(++) preprocessor:
100# Prevent a warning about yyinput being defined but not used
101CPPFLAGS := -DYY_NO_INPUT
970ed795
EL
102
103# Flags shared between C and C++
104COMPILERFLAGS := -Wall
105
106# 'Hardcore' settings
107# Unlikely to work for GCC below 4.x
108#COMPILERFLAGS += -Werror -pedantic -W -Wno-unused-parameter -O1
109
110# Flags for the C compiler.
111# std=gnu9x shuts up warnings about long long and variadic macros
112CCFLAGS = $(COMPILERFLAGS) -std=gnu9x
3abe9331 113
114# Flags for the C++ compiler:
115CXXFLAGS = $(COMPILERFLAGS) -Wno-long-long
116
117# The command for maintaining static libraries:
118AR := ar
119
120# The command for building the shared libraries:
121# It shall be set to either "$(CXX) -G" or "$(CXX) -shared" depending
122# on the linker you use.
123LD = $(CXX) -shared
124
125# Flags for linking binary executables (e.g. for profiling):
126LDFLAGS = $(MINGW)
127
128# The command for removing symbol table from the executables:
129STRIP := strip
130
131# Flags for flex:
132FLEXFLAGS := -B -s -Cr
133
134# Flags for bison:
135BISONFLAGS := -d
136
137# Override common settings with personal preferences if needed
138-include $(TOP)/Makefile.personal
139
140## ## ## ## ## Variables below are automatically set ## ## ## ## ##
141
142ifeq ($(DEBUG), yes)
143 CPPFLAGS += -DMEMORY_DEBUG -DFATAL_DEBUG
144else
145 CPPFLAGS += -DNDEBUG
146endif
147
148# MingW flags need to be passed to the preprocessor during ctags configure
149CPPFLAGS += $(MINGW)
150
970ed795
EL
151ifeq ($(DEBUG), yes)
152 CCFLAGS += -g
153 CCFLAGS += -Wshadow -Wpointer-arith -Wcast-qual -Wcast-align \
154 -Wstrict-prototypes
3abe9331 155else
156ifeq ($(COVERAGE), yes)
157 CCFLAGS += -O0
970ed795
EL
158else
159 CCFLAGS += -O2
160endif
3abe9331 161endif
970ed795
EL
162
163# Only the default Cygwin compiler can be used for Mingw.
164# Its version is 3.4.4, too low.
165ifndef MINGW
166# Only GCC 4.x understands -Wno-variadic-macros, comment out for lower versions
167#CXXFLAGS += -Wno-variadic-macros
168endif
169
170ifeq ($(DEBUG), yes)
171 CXXFLAGS += -g
172 CXXFLAGS += -Wshadow -Wpointer-arith -Wcast-qual -Wcast-align
3abe9331 173else
174ifeq ($(COVERAGE), yes)
175 CXXFLAGS += -O0
970ed795
EL
176else
177 CXXFLAGS += -O2
178endif
3abe9331 179endif
970ed795
EL
180
181# Flags for the C/C++ compilers to generate dependency list (-M or -MM
182# for gcc or clang, -xM or -xM1 for Sun C compiler).
183
184ifneq ($(filter gcc% clang%, $(notdir $(CC))),)
185CCDEPFLAG := -MM
186CXXDEPFLAG := -MM
187else
188# Let's hope it's the Sun compiler
189CCDEPFLAG := -xM1
190CXXDEPFLAG := -xM1
191endif
192
970ed795
EL
193ifeq ($(DEBUG), yes)
194 LDFLAGS += -g
195endif
196
970ed795 197
970ed795
EL
198ifeq ($(DEBUG), yes)
199 FLEXFLAGS += -b -p
200# FLEXFLAGS += -d
201else
202# Comment out the line below if flex version 2.5.4[a] is used.
203# This version does not support optimized tables together with yylineno.
204 FLEXFLAGS += -Cfe
205endif
206
3abe9331 207
970ed795
EL
208ifeq ($(DEBUG), yes)
209 BISONFLAGS += -t -v
210endif
211
212ifeq ($(COVERAGE), yes)
970ed795
EL
213 CPPFLAGS += -DCOVERAGE_BUILD
214 COMPILERFLAGS += -fprofile-arcs -ftest-coverage
215 LDFLAGS += -fprofile-arcs -ftest-coverage -lgcov
216endif
970ed795
EL
217
218# Directory which contains the code for POSIX regular expression handling.
219# It is needed on platforms where the system's libc does not support POSIX
220# regexps. This is the case for Mingw.
221ifdef MINGW
222# If your platform isn't Mingw but lacks POSIX regular expressions,
223# comment out the ifdef/endif
224REGEX_DIR := /mnt/TTCN/Tools/CPP/regex-glibc-2.5.1
225endif
226
227# Warning! Never set the above directories to /usr.
228# If your OpenSSL, Qt is installed under /usr you'd better set
229# these variables to a fake (non-existent) directory. If this is the case,
230# gcc will find the required headers and libs anyway, but -I/usr/include
231# might confuse it.
232
233# This is especially true on Windows with Mingw installed as a Cygwin package.
234# -mno-cygwin alters the include serach path to find the Mingw headers.
235# Passing -I/usr/include would cause the Mingw compiler to read the Cygwin
236# headers, and the compilation will fail.
237
238# The path name where the LaTeX binaries can be found. (optional)
239# If this variable is not defined the User Documentation will not be built
240# or installed.
241TEXPATH := /usr/local/teTeX2.0.2/bin/sparc-sun-solaris2.8
242
970ed795
EL
243
244###########################################################################
245# You don't have to alter anything below this line.
246
247# Setting PLATFORM automagically if it is not defined.
248ifndef PLATFORM
249PLATFORM1 := $(shell uname -s)
250PLATFORM2 := $(shell uname -r)
251PLATFORM3 := $(shell uname -m)
252ifeq ($(PLATFORM1), SunOS)
253 ifneq ($(PLATFORM2), 5.6)
254 PLATFORM := SOLARIS8
255 PLATSUFFIX = -sol8
256 else
257 PLATFORM := SOLARIS
258 PLATSUFFIX = -sol6
259 endif # 5.8
260endif # SunOS
261ifeq ($(PLATFORM1), Linux)
262 PLATFORM := LINUX
263 PLATSUFFIX = -linux
264endif # Linux
265ifeq ($(PLATFORM1), FreeBSD)
266 PLATFORM := FREEBSD
267endif # FreeBSD
268ifeq ($(findstring CYGWIN, $(PLATFORM1)), CYGWIN)
269 PLATFORM := WIN32
270 PLATSUFFIX = -cygwin
271endif # CYGWIN
272endif # ifndef PLATFORM
273ifndef PLATFORM
274 PLATFORM := $(error PLEASE CHECK THE PLATFORM SETTINGS)
275endif # ifndef PLATFORM
276
277# Derived variables, which you should never change.
278
279ifdef MINGW
280
281# Target directory for binaries:
282BINDIR := $(TTCN3_DIR)/programs
283# Target directory for manual pages:
284MANDIR := $(TTCN3_DIR)/manuals
285# Target directory for other files (nedit/xemacs additions, etc.)
286ETCDIR := $(TTCN3_DIR)
287
288else
289
290# Target directory for binaries:
291BINDIR := $(TTCN3_DIR)/bin
292# Target directory for manual pages:
293MANDIR := $(TTCN3_DIR)/man
294# Target directory for other files (nedit/xemacs additions, etc.)
295ETCDIR := $(TTCN3_DIR)/etc
296
297endif
298
299# Target directory for header files:
300INCDIR := $(TTCN3_DIR)/include
301# Target directory for libraries:
302LIBDIR := $(TTCN3_DIR)/lib
303# Target directory for html help pages:
304HELPDIR := $(TTCN3_DIR)/help
305# Target directory for the documentation:
306DOCDIR := $(TTCN3_DIR)/doc
307# Target directory for the demo "Hello World!"
308DEMODIR := $(TTCN3_DIR)/demo
309
310CPPFLAGS += -D$(PLATFORM)
311
312ifeq ($(LICENSING), yes)
313 CPPFLAGS += -DLICENSE
314 LICENSE_LIBS = -L$(OPENSSL_DIR)/lib -lcrypto
315else
316 LICENSE_LIBS :=
317endif
318
319ifeq ($(USAGE_STATS), yes)
320 CPPFLAGS += -DUSAGE_STATS
321endif
322
323# Windows/Cygwin specific settings
324ifeq ($(PLATFORM), WIN32)
325 EXESUFFIX := .exe
326 LDFLAGS += -Wl,--enable-auto-import,--enable-runtime-pseudo-reloc
327
328 ifdef MINGW
329 MINGW_LIBS := -lgdi32
330 endif
331else
332 EXESUFFIX :=
333
334 ifdef MINGW
335 $(error MingW not supported on $(PLATFORM))
336 endif
337
338 CCFLAGS += -fPIC
339 CXXFLAGS += -fPIC
340 LDFLAGS += -fPIC
341endif
342
343# Try to use -isystem for Qt headers (this is a GCC feature).
344# This avoids the myriads of warnings issued for the Qt headers.
345ifneq (,$(findstring SOLARIS,$(PLATFORM)))
346# Avoid using it on Solaris, because
347# -isystem puts an implicit "extern C" around every system header,
348# which causes compilation of Qt headers to fail miserably :-(
349# (this could be fixed by recompiling GCC)
350 INCLUDEQT := -I
351else
352# Not Solaris
353 INCLUDEQT := -isystem
354endif
355
356# Setting EPOLL usage - It is Linux specific
357ifeq ($(PLATFORM), LINUX)
358 CPPFLAGS += -DUSE_EPOLL
359endif
360
361#not useful in compiler2/asn1, for example
362#REL_DIR := $(notdir $(CURDIR))
363
364export ABS_TOP := $(abspath $(TOP))/
365ifeq "$(ABS_TOP)" "/"
366# abspath only from GNU make 3.81, here's a replacement
367ABS_TOP := $(shell cd $(TOP); pwd)/
368endif
369
370ifdef SRCDIR
371
372REL_DIR := $(subst $(ABS_TOP),,$(CURDIR))
373
374ABS_SRC := $(SRCDIR)/$(REL_DIR)
375
376CPPFLAGS += -I. -I$(ABS_SRC)
377
378SRC_TOP := $(SRCDIR)
379
380else
381
382ABS_SRC := $(abspath $(CURDIR))
383ifeq "$(ABS_SRC)" ""
384ABS_SRC := $(shell cd $(CURDIR); pwd)
385endif
386
387SRC_TOP := $(TOP)
388
389endif
390
391
This page took 0.036799 seconds and 5 git commands to generate.