1 ###############################################################################
2 # Copyright (c) 2000-2016 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
24 # Szabo, Janos Zoltan – initial implementation
26 # Zalanyi, Balazs Andor
28 ###############################################################################
30 $(error please define TOP)
33 # Configurations for the Free Open Source Software version, if available
34 ifneq ($(wildcard $(TOP)/MakefileFOSS.cfg), )
35 include $(TOP)/MakefileFOSS.cfg
37 # Set whether licensing is enabled: (yes or no)
40 # Set whether to send usage statistics: (yes or no)
44 # Define SRCDIR to the root of Titan sources to enable out-of-tree build
45 #SRCDIR := ${HOME}/workspace/TTCNv3
47 # Set these variables to fit your system:
49 # The target directory where the Test Executor will be installed to:
50 TTCN3_DIR := ${TOP}/Install
52 # New installed files are run from make install, so they are added to the PATH
53 PATH := ${PATH}:${TTCN3_DIR}/bin
55 # Set it to 'yes' for developing or 'no' for release.
58 # Set it to 'yes' to generate coverage data (requires DEBUG=yes)
61 # Set it to 'yes' to enable extra features for the debugger UI in single mode
62 # (this requires an extra library when linking the generated code).
63 # Set it to 'no' to use a simplified debugger UI.
64 ADVANCED_DEBUGGER_UI := no
66 # Your platform. Allowed values: SOLARIS, SOLARIS8, LINUX, FREEBSD,
67 # WIN32. Decided automagically if not defined (recommended).
70 # Uncomment the following for "native" Win32
71 #MINGW := -DMINGW -mno-cygwin
73 # Utility for building lexical analyzers (tokenizers):
76 # Utility for building parsers:
79 # The C compiler used for building:
82 # The C++ compiler used for building:
85 # generate userguide at install ('make release' always generates it)
88 # Set whether to build the CLI for MC: (yes or no)
91 # set whether to build the JNI native library: (yes or no)
94 # Path of the Java Developement Kit installation
95 # (must be at least version 1.5.0_10)
96 JDKDIR := /usr/lib/jvm/default-java
98 # Path of OpenSSL installation: (always required)
99 OPENSSL_DIR := default
101 # Location of libxml2
104 # Flags for the C(++) preprocessor:
105 # Prevent a warning about yyinput being defined but not used
106 CPPFLAGS += -DYY_NO_INPUT
108 # Flags shared between C and C++
109 COMPILERFLAGS := -Wall
111 # 'Hardcore' settings
112 # Unlikely to work for GCC below 4.x
113 #COMPILERFLAGS += -Werror -pedantic -W -Wno-unused-parameter -O1
115 # Flags for the C compiler.
116 # std=gnu9x shuts up warnings about long long and variadic macros
117 CCFLAGS += $(COMPILERFLAGS) -std=gnu9x
119 # Flags for the C++ compiler:
120 CXXFLAGS += $(COMPILERFLAGS) -Wno-long-long
122 # The command for maintaining static libraries:
125 # The command for building the shared libraries:
126 # It shall be set to either "$(CXX) -G" or "$(CXX) -shared" depending
127 # on the linker you use.
130 # Flags for linking binary executables (e.g. for profiling):
133 # The command for removing symbol table from the executables:
137 FLEXFLAGS := -B -s -Cr
142 # Override common settings with personal preferences if needed
143 -include $(TOP)/Makefile.personal
145 ## ## ## ## ## Variables below are automatically set ## ## ## ## ##
148 CPPFLAGS += -DMEMORY_DEBUG -DFATAL_DEBUG
153 # MingW flags need to be passed to the preprocessor during ctags configure
158 CCFLAGS += -Wshadow -Wpointer-arith -Wcast-qual -Wcast-align \
161 ifeq ($(COVERAGE), yes)
168 # Only the default Cygwin compiler can be used for Mingw.
169 # Its version is 3.4.4, too low.
171 # Only GCC 4.x understands -Wno-variadic-macros, comment out for lower versions
172 #CXXFLAGS += -Wno-variadic-macros
177 CXXFLAGS += -Wshadow -Wpointer-arith -Wcast-qual -Wcast-align
179 ifeq ($(COVERAGE), yes)
186 # Flags for the C/C++ compilers to generate dependency list (-M or -MM
187 # for gcc or clang, -xM or -xM1 for Sun C compiler).
189 ifneq ($(filter gcc% clang%, $(notdir $(CC))),)
193 # Let's hope it's the Sun compiler
207 # Comment out the line below if flex version 2.5.4[a] is used.
208 # This version does not support optimized tables together with yylineno.
217 ifeq ($(COVERAGE), yes)
218 CPPFLAGS += -DCOVERAGE_BUILD
219 COMPILERFLAGS += -fprofile-arcs -ftest-coverage
220 LDFLAGS += -fprofile-arcs -ftest-coverage -lgcov
223 ifeq ($(ADVANCED_DEBUGGER_UI), yes)
224 CPPFLAGS += -DADVANCED_DEBUGGER_UI
227 # Directory which contains the code for POSIX regular expression handling.
228 # It is needed on platforms where the system's libc does not support POSIX
229 # regexps. This is the case for Mingw.
231 # If your platform isn't Mingw but lacks POSIX regular expressions,
232 # comment out the ifdef/endif
233 REGEX_DIR := /mnt/TTCN/Tools/CPP/regex-glibc-2.5.1
236 # Warning! Never set the above directories to /usr.
237 # If your OpenSSL, Qt is installed under /usr you'd better set
238 # these variables to a fake (non-existent) directory. If this is the case,
239 # gcc will find the required headers and libs anyway, but -I/usr/include
242 # This is especially true on Windows with Mingw installed as a Cygwin package.
243 # -mno-cygwin alters the include serach path to find the Mingw headers.
244 # Passing -I/usr/include would cause the Mingw compiler to read the Cygwin
245 # headers, and the compilation will fail.
247 # The path name where the LaTeX binaries can be found. (optional)
248 # If this variable is not defined the User Documentation will not be built
250 TEXPATH := /usr/local/teTeX2.0.2/bin/sparc-sun-solaris2.8
253 ###########################################################################
254 # You don't have to alter anything below this line.
256 # Setting PLATFORM automagically if it is not defined.
258 PLATFORM1 := $(shell uname -s)
259 PLATFORM2 := $(shell uname -r)
260 PLATFORM3 := $(shell uname -m)
261 ifeq ($(PLATFORM1), SunOS)
262 ifneq ($(PLATFORM2), 5.6)
270 ifeq ($(PLATFORM1), Linux)
274 ifeq ($(PLATFORM1), FreeBSD)
277 ifeq ($(findstring CYGWIN, $(PLATFORM1)), CYGWIN)
281 endif # ifndef PLATFORM
283 PLATFORM := $(error PLEASE CHECK THE PLATFORM SETTINGS)
284 endif # ifndef PLATFORM
286 # Derived variables, which you should never change.
290 # Target directory for binaries:
291 BINDIR := $(TTCN3_DIR)/programs
292 # Target directory for manual pages:
293 MANDIR := $(TTCN3_DIR)/manuals
294 # Target directory for other files (nedit/xemacs additions, etc.)
295 ETCDIR := $(TTCN3_DIR)
299 # Target directory for binaries:
300 BINDIR := $(TTCN3_DIR)/bin
301 # Target directory for manual pages:
302 MANDIR := $(TTCN3_DIR)/man
303 # Target directory for other files (nedit/xemacs additions, etc.)
304 ETCDIR := $(TTCN3_DIR)/etc
308 # Target directory for header files:
309 INCDIR := $(TTCN3_DIR)/include
310 # Target directory for libraries:
311 LIBDIR := $(TTCN3_DIR)/lib
312 # Target directory for html help pages:
313 HELPDIR := $(TTCN3_DIR)/help
314 # Target directory for the documentation:
315 DOCDIR := $(TTCN3_DIR)/doc
316 # Target directory for the demo "Hello World!"
317 DEMODIR := $(TTCN3_DIR)/demo
319 CPPFLAGS += -D$(PLATFORM)
321 ifeq ($(LICENSING), yes)
322 CPPFLAGS += -DLICENSE
323 LICENSE_LIBS = -L$(OPENSSL_DIR)/lib -lcrypto
328 ifeq ($(USAGE_STATS), yes)
329 CPPFLAGS += -DUSAGE_STATS
332 # Windows/Cygwin specific settings
333 ifeq ($(PLATFORM), WIN32)
335 LDFLAGS += -Wl,--enable-auto-import,--enable-runtime-pseudo-reloc
338 MINGW_LIBS := -lgdi32
344 $(error MingW not supported on $(PLATFORM))
352 # Try to use -isystem for Qt headers (this is a GCC feature).
353 # This avoids the myriads of warnings issued for the Qt headers.
354 ifneq (,$(findstring SOLARIS,$(PLATFORM)))
355 # Avoid using it on Solaris, because
356 # -isystem puts an implicit "extern C" around every system header,
357 # which causes compilation of Qt headers to fail miserably :-(
358 # (this could be fixed by recompiling GCC)
362 INCLUDEQT := -isystem
365 # Setting EPOLL usage - It is Linux specific
366 ifeq ($(PLATFORM), LINUX)
367 CPPFLAGS += -DUSE_EPOLL
370 #not useful in compiler2/asn1, for example
371 #REL_DIR := $(notdir $(CURDIR))
373 export ABS_TOP := $(abspath $(TOP))/
374 ifeq "$(ABS_TOP)" "/"
375 # abspath only from GNU make 3.81, here's a replacement
376 ABS_TOP := $(shell cd $(TOP); pwd)/
381 REL_DIR := $(subst $(ABS_TOP),,$(CURDIR))
383 ABS_SRC := $(SRCDIR)/$(REL_DIR)
385 CPPFLAGS += -I. -I$(ABS_SRC)
391 ABS_SRC := $(abspath $(CURDIR))
393 ABS_SRC := $(shell cd $(CURDIR); pwd)