1 ###############################################################################
2 # Copyright (c) 2000-2015 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 ###############################################################################
9 $(error please define TOP)
12 # Configurations for the Free Open Source Software version, if available
13 ifneq ($(wildcard $(TOP)/MakefileFOSS.cfg), )
14 include $(TOP)/MakefileFOSS.cfg
16 # Set whether licensing is enabled: (yes or no)
19 # Set whether to send usage statistics: (yes or no)
23 # Define SRCDIR to the root of Titan sources to enable out-of-tree build
24 #SRCDIR := ${HOME}/workspace/TTCNv3
26 # Set these variables to fit your system:
28 # The target directory where the Test Executor will be installed to:
29 TTCN3_DIR := ${TOP}/Install
31 # New installed files are run from make install, so they are added to the PATH
32 PATH := ${PATH}:${TTCN3_DIR}/bin
34 # Set it to 'yes' for developing or 'no' for release.
37 # Set it to 'yes' to generate coverage data (requires DEBUG=yes)
40 # Your platform. Allowed values: SOLARIS, SOLARIS8, LINUX, FREEBSD,
41 # WIN32. Decided automagically if not defined (recommended).
44 # Uncomment the following for "native" Win32
45 #MINGW := -DMINGW -mno-cygwin
47 # Utility for building lexical analyzers (tokenizers):
50 # Utility for building parsers:
53 # The C compiler used for building:
56 # The C++ compiler used for building:
59 # generate userguide at install ('make release' always generates it)
62 # Set whether to build the CLI for MC: (yes or no)
65 # set whether to build the JNI native library: (yes or no)
68 # Path of the Java Developement Kit installation
69 # (must be at least version 1.5.0_10)
70 JDKDIR := /mnt/TTCN/Tools/jdk1.5.0_11
72 # Path of OpenSSL installation: (always required)
73 OPENSSL_DIR := default
78 # Flags for the C(++) preprocessor:
79 # Prevent a warning about yyinput being defined but not used
80 CPPFLAGS := -DYY_NO_INPUT
82 # Flags shared between C and C++
83 COMPILERFLAGS := -Wall
86 # Unlikely to work for GCC below 4.x
87 #COMPILERFLAGS += -Werror -pedantic -W -Wno-unused-parameter -O1
89 # Flags for the C compiler.
90 # std=gnu9x shuts up warnings about long long and variadic macros
91 CCFLAGS = $(COMPILERFLAGS) -std=gnu9x
93 # Flags for the C++ compiler:
94 CXXFLAGS = $(COMPILERFLAGS) -Wno-long-long
96 # The command for maintaining static libraries:
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.
104 # Flags for linking binary executables (e.g. for profiling):
107 # The command for removing symbol table from the executables:
111 FLEXFLAGS := -B -s -Cr
116 # Override common settings with personal preferences if needed
117 -include $(TOP)/Makefile.personal
119 ## ## ## ## ## Variables below are automatically set ## ## ## ## ##
122 CPPFLAGS += -DMEMORY_DEBUG -DFATAL_DEBUG
127 # MingW flags need to be passed to the preprocessor during ctags configure
132 CCFLAGS += -Wshadow -Wpointer-arith -Wcast-qual -Wcast-align \
135 ifeq ($(COVERAGE), yes)
142 # Only the default Cygwin compiler can be used for Mingw.
143 # Its version is 3.4.4, too low.
145 # Only GCC 4.x understands -Wno-variadic-macros, comment out for lower versions
146 #CXXFLAGS += -Wno-variadic-macros
151 CXXFLAGS += -Wshadow -Wpointer-arith -Wcast-qual -Wcast-align
153 ifeq ($(COVERAGE), yes)
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).
163 ifneq ($(filter gcc% clang%, $(notdir $(CC))),)
167 # Let's hope it's the Sun compiler
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.
191 ifeq ($(COVERAGE), yes)
192 CPPFLAGS += -DCOVERAGE_BUILD
193 COMPILERFLAGS += -fprofile-arcs -ftest-coverage
194 LDFLAGS += -fprofile-arcs -ftest-coverage -lgcov
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.
201 # If your platform isn't Mingw but lacks POSIX regular expressions,
202 # comment out the ifdef/endif
203 REGEX_DIR := /mnt/TTCN/Tools/CPP/regex-glibc-2.5.1
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
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.
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
220 TEXPATH := /usr/local/teTeX2.0.2/bin/sparc-sun-solaris2.8
223 ###########################################################################
224 # You don't have to alter anything below this line.
226 # Setting PLATFORM automagically if it is not defined.
228 PLATFORM1 := $(shell uname -s)
229 PLATFORM2 := $(shell uname -r)
230 PLATFORM3 := $(shell uname -m)
231 ifeq ($(PLATFORM1), SunOS)
232 ifneq ($(PLATFORM2), 5.6)
240 ifeq ($(PLATFORM1), Linux)
244 ifeq ($(PLATFORM1), FreeBSD)
247 ifeq ($(findstring CYGWIN, $(PLATFORM1)), CYGWIN)
251 endif # ifndef PLATFORM
253 PLATFORM := $(error PLEASE CHECK THE PLATFORM SETTINGS)
254 endif # ifndef PLATFORM
256 # Derived variables, which you should never change.
260 # Target directory for binaries:
261 BINDIR := $(TTCN3_DIR)/programs
262 # Target directory for manual pages:
263 MANDIR := $(TTCN3_DIR)/manuals
264 # Target directory for other files (nedit/xemacs additions, etc.)
265 ETCDIR := $(TTCN3_DIR)
269 # Target directory for binaries:
270 BINDIR := $(TTCN3_DIR)/bin
271 # Target directory for manual pages:
272 MANDIR := $(TTCN3_DIR)/man
273 # Target directory for other files (nedit/xemacs additions, etc.)
274 ETCDIR := $(TTCN3_DIR)/etc
278 # Target directory for header files:
279 INCDIR := $(TTCN3_DIR)/include
280 # Target directory for libraries:
281 LIBDIR := $(TTCN3_DIR)/lib
282 # Target directory for html help pages:
283 HELPDIR := $(TTCN3_DIR)/help
284 # Target directory for the documentation:
285 DOCDIR := $(TTCN3_DIR)/doc
286 # Target directory for the demo "Hello World!"
287 DEMODIR := $(TTCN3_DIR)/demo
289 CPPFLAGS += -D$(PLATFORM)
291 ifeq ($(LICENSING), yes)
292 CPPFLAGS += -DLICENSE
293 LICENSE_LIBS = -L$(OPENSSL_DIR)/lib -lcrypto
298 ifeq ($(USAGE_STATS), yes)
299 CPPFLAGS += -DUSAGE_STATS
302 # Windows/Cygwin specific settings
303 ifeq ($(PLATFORM), WIN32)
305 LDFLAGS += -Wl,--enable-auto-import,--enable-runtime-pseudo-reloc
308 MINGW_LIBS := -lgdi32
314 $(error MingW not supported on $(PLATFORM))
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.
324 ifneq (,$(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)
332 INCLUDEQT := -isystem
335 # Setting EPOLL usage - It is Linux specific
336 ifeq ($(PLATFORM), LINUX)
337 CPPFLAGS += -DUSE_EPOLL
340 #not useful in compiler2/asn1, for example
341 #REL_DIR := $(notdir $(CURDIR))
343 export ABS_TOP := $(abspath $(TOP))/
344 ifeq "$(ABS_TOP)" "/"
345 # abspath only from GNU make 3.81, here's a replacement
346 ABS_TOP := $(shell cd $(TOP); pwd)/
351 REL_DIR := $(subst $(ABS_TOP),,$(CURDIR))
353 ABS_SRC := $(SRCDIR)/$(REL_DIR)
355 CPPFLAGS += -I. -I$(ABS_SRC)
361 ABS_SRC := $(abspath $(CURDIR))
363 ABS_SRC := $(shell cd $(CURDIR); pwd)