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