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 # Your platform. Allowed values: SOLARIS, SOLARIS8, LINUX, FREEBSD,
62 # WIN32. Decided automagically if not defined (recommended).
65 # Uncomment the following for "native" Win32
66 #MINGW := -DMINGW -mno-cygwin
68 # Utility for building lexical analyzers (tokenizers):
71 # Utility for building parsers:
74 # The C compiler used for building:
77 # The C++ compiler used for building:
80 # generate userguide at install ('make release' always generates it)
83 # Set whether to build the CLI for MC: (yes or no)
86 # set whether to build the JNI native library: (yes or no)
89 # Path of the Java Developement Kit installation
90 # (must be at least version 1.5.0_10)
91 JDKDIR := /usr/lib/jvm/default-java
93 # Path of OpenSSL installation: (always required)
94 OPENSSL_DIR := default
99 # Flags for the C(++) preprocessor:
100 # Prevent a warning about yyinput being defined but not used
101 CPPFLAGS := -DYY_NO_INPUT
103 # Flags shared between C and C++
104 COMPILERFLAGS := -Wall
106 # 'Hardcore' settings
107 # Unlikely to work for GCC below 4.x
108 #COMPILERFLAGS += -Werror -pedantic -W -Wno-unused-parameter -O1
110 # Flags for the C compiler.
111 # std=gnu9x shuts up warnings about long long and variadic macros
112 CCFLAGS = $(COMPILERFLAGS) -std=gnu9x
114 # Flags for the C++ compiler:
115 CXXFLAGS = $(COMPILERFLAGS) -Wno-long-long
117 # The command for maintaining static libraries:
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.
125 # Flags for linking binary executables (e.g. for profiling):
128 # The command for removing symbol table from the executables:
132 FLEXFLAGS := -B -s -Cr
137 # Override common settings with personal preferences if needed
138 -include $(TOP)/Makefile.personal
140 ## ## ## ## ## Variables below are automatically set ## ## ## ## ##
143 CPPFLAGS += -DMEMORY_DEBUG -DFATAL_DEBUG
148 # MingW flags need to be passed to the preprocessor during ctags configure
153 CCFLAGS += -Wshadow -Wpointer-arith -Wcast-qual -Wcast-align \
156 ifeq ($(COVERAGE), yes)
163 # Only the default Cygwin compiler can be used for Mingw.
164 # Its version is 3.4.4, too low.
166 # Only GCC 4.x understands -Wno-variadic-macros, comment out for lower versions
167 #CXXFLAGS += -Wno-variadic-macros
172 CXXFLAGS += -Wshadow -Wpointer-arith -Wcast-qual -Wcast-align
174 ifeq ($(COVERAGE), yes)
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).
184 ifneq ($(filter gcc% clang%, $(notdir $(CC))),)
188 # Let's hope it's the Sun compiler
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.
212 ifeq ($(COVERAGE), yes)
213 CPPFLAGS += -DCOVERAGE_BUILD
214 COMPILERFLAGS += -fprofile-arcs -ftest-coverage
215 LDFLAGS += -fprofile-arcs -ftest-coverage -lgcov
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.
222 # If your platform isn't Mingw but lacks POSIX regular expressions,
223 # comment out the ifdef/endif
224 REGEX_DIR := /mnt/TTCN/Tools/CPP/regex-glibc-2.5.1
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
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.
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
241 TEXPATH := /usr/local/teTeX2.0.2/bin/sparc-sun-solaris2.8
244 ###########################################################################
245 # You don't have to alter anything below this line.
247 # Setting PLATFORM automagically if it is not defined.
249 PLATFORM1 := $(shell uname -s)
250 PLATFORM2 := $(shell uname -r)
251 PLATFORM3 := $(shell uname -m)
252 ifeq ($(PLATFORM1), SunOS)
253 ifneq ($(PLATFORM2), 5.6)
261 ifeq ($(PLATFORM1), Linux)
265 ifeq ($(PLATFORM1), FreeBSD)
268 ifeq ($(findstring CYGWIN, $(PLATFORM1)), CYGWIN)
272 endif # ifndef PLATFORM
274 PLATFORM := $(error PLEASE CHECK THE PLATFORM SETTINGS)
275 endif # ifndef PLATFORM
277 # Derived variables, which you should never change.
281 # Target directory for binaries:
282 BINDIR := $(TTCN3_DIR)/programs
283 # Target directory for manual pages:
284 MANDIR := $(TTCN3_DIR)/manuals
285 # Target directory for other files (nedit/xemacs additions, etc.)
286 ETCDIR := $(TTCN3_DIR)
290 # Target directory for binaries:
291 BINDIR := $(TTCN3_DIR)/bin
292 # Target directory for manual pages:
293 MANDIR := $(TTCN3_DIR)/man
294 # Target directory for other files (nedit/xemacs additions, etc.)
295 ETCDIR := $(TTCN3_DIR)/etc
299 # Target directory for header files:
300 INCDIR := $(TTCN3_DIR)/include
301 # Target directory for libraries:
302 LIBDIR := $(TTCN3_DIR)/lib
303 # Target directory for html help pages:
304 HELPDIR := $(TTCN3_DIR)/help
305 # Target directory for the documentation:
306 DOCDIR := $(TTCN3_DIR)/doc
307 # Target directory for the demo "Hello World!"
308 DEMODIR := $(TTCN3_DIR)/demo
310 CPPFLAGS += -D$(PLATFORM)
312 ifeq ($(LICENSING), yes)
313 CPPFLAGS += -DLICENSE
314 LICENSE_LIBS = -L$(OPENSSL_DIR)/lib -lcrypto
319 ifeq ($(USAGE_STATS), yes)
320 CPPFLAGS += -DUSAGE_STATS
323 # Windows/Cygwin specific settings
324 ifeq ($(PLATFORM), WIN32)
326 LDFLAGS += -Wl,--enable-auto-import,--enable-runtime-pseudo-reloc
329 MINGW_LIBS := -lgdi32
335 $(error MingW not supported on $(PLATFORM))
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.
345 ifneq (,$(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)
353 INCLUDEQT := -isystem
356 # Setting EPOLL usage - It is Linux specific
357 ifeq ($(PLATFORM), LINUX)
358 CPPFLAGS += -DUSE_EPOLL
361 #not useful in compiler2/asn1, for example
362 #REL_DIR := $(notdir $(CURDIR))
364 export ABS_TOP := $(abspath $(TOP))/
365 ifeq "$(ABS_TOP)" "/"
366 # abspath only from GNU make 3.81, here's a replacement
367 ABS_TOP := $(shell cd $(TOP); pwd)/
372 REL_DIR := $(subst $(ABS_TOP),,$(CURDIR))
374 ABS_SRC := $(SRCDIR)/$(REL_DIR)
376 CPPFLAGS += -I. -I$(ABS_SRC)
382 ABS_SRC := $(abspath $(CURDIR))
384 ABS_SRC := $(shell cd $(CURDIR); pwd)