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