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 ###############################################################################
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 ## ## ## ## ## Variables below are automatically set ## ## ## ## ##
80 # Flags for the C(++) preprocessor:
81 # Prevent a warning about yyinput being defined but not used
82 CPPFLAGS := -DYY_NO_INPUT
84 CPPFLAGS += -DMEMORY_DEBUG -DFATAL_DEBUG
89 # MingW flags need to be passed to the preprocessor during ctags configure
93 # Flags shared between C and C++
94 COMPILERFLAGS := -Wall
97 # Unlikely to work for GCC below 4.x
98 #COMPILERFLAGS += -Werror -pedantic -W -Wno-unused-parameter -O1
100 # Flags for the C compiler.
101 # std=gnu9x shuts up warnings about long long and variadic macros
102 CCFLAGS = $(COMPILERFLAGS) -std=gnu9x
105 CCFLAGS += -Wshadow -Wpointer-arith -Wcast-qual -Wcast-align \
111 # Flags for the C++ compiler:
112 CXXFLAGS = $(COMPILERFLAGS) -Wno-long-long
114 # Only the default Cygwin compiler can be used for Mingw.
115 # Its version is 3.4.4, too low.
117 # Only GCC 4.x understands -Wno-variadic-macros, comment out for lower versions
118 #CXXFLAGS += -Wno-variadic-macros
123 CXXFLAGS += -Wshadow -Wpointer-arith -Wcast-qual -Wcast-align
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).
131 ifneq ($(filter gcc% clang%, $(notdir $(CC))),)
135 # Let's hope it's the Sun compiler
140 # The command for maintaining static libraries:
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.
148 # Flags for linking binary executables (e.g. for profiling):
154 # The command for removing symbol table from the executables:
158 FLEXFLAGS := -B -s -Cr
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.
174 ifeq ($(COVERAGE), yes)
175 ifneq ($(DEBUG), yes)
176 $(error TURN ON DEBUG MODE FOR COVERAGE)
178 CPPFLAGS += -DCOVERAGE_BUILD
179 COMPILERFLAGS += -fprofile-arcs -ftest-coverage
180 LDFLAGS += -fprofile-arcs -ftest-coverage -lgcov
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.
188 # If your platform isn't Mingw but lacks POSIX regular expressions,
189 # comment out the ifdef/endif
190 REGEX_DIR := /mnt/TTCN/Tools/CPP/regex-glibc-2.5.1
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
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.
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
207 TEXPATH := /usr/local/teTeX2.0.2/bin/sparc-sun-solaris2.8
209 # Override common settings with personal preferences if needed
210 -include $(TOP)/Makefile.personal
212 ###########################################################################
213 # You don't have to alter anything below this line.
215 # Setting PLATFORM automagically if it is not defined.
217 PLATFORM1 := $(shell uname -s)
218 PLATFORM2 := $(shell uname -r)
219 PLATFORM3 := $(shell uname -m)
220 ifeq ($(PLATFORM1), SunOS)
221 ifneq ($(PLATFORM2), 5.6)
229 ifeq ($(PLATFORM1), Linux)
233 ifeq ($(PLATFORM1), FreeBSD)
236 ifeq ($(findstring CYGWIN, $(PLATFORM1)), CYGWIN)
240 endif # ifndef PLATFORM
242 PLATFORM := $(error PLEASE CHECK THE PLATFORM SETTINGS)
243 endif # ifndef PLATFORM
245 # Derived variables, which you should never change.
249 # Target directory for binaries:
250 BINDIR := $(TTCN3_DIR)/programs
251 # Target directory for manual pages:
252 MANDIR := $(TTCN3_DIR)/manuals
253 # Target directory for other files (nedit/xemacs additions, etc.)
254 ETCDIR := $(TTCN3_DIR)
258 # Target directory for binaries:
259 BINDIR := $(TTCN3_DIR)/bin
260 # Target directory for manual pages:
261 MANDIR := $(TTCN3_DIR)/man
262 # Target directory for other files (nedit/xemacs additions, etc.)
263 ETCDIR := $(TTCN3_DIR)/etc
267 # Target directory for header files:
268 INCDIR := $(TTCN3_DIR)/include
269 # Target directory for libraries:
270 LIBDIR := $(TTCN3_DIR)/lib
271 # Target directory for html help pages:
272 HELPDIR := $(TTCN3_DIR)/help
273 # Target directory for the documentation:
274 DOCDIR := $(TTCN3_DIR)/doc
275 # Target directory for the demo "Hello World!"
276 DEMODIR := $(TTCN3_DIR)/demo
278 CPPFLAGS += -D$(PLATFORM)
280 ifeq ($(LICENSING), yes)
281 CPPFLAGS += -DLICENSE
282 LICENSE_LIBS = -L$(OPENSSL_DIR)/lib -lcrypto
287 ifeq ($(USAGE_STATS), yes)
288 CPPFLAGS += -DUSAGE_STATS
291 # Windows/Cygwin specific settings
292 ifeq ($(PLATFORM), WIN32)
294 LDFLAGS += -Wl,--enable-auto-import,--enable-runtime-pseudo-reloc
297 MINGW_LIBS := -lgdi32
303 $(error MingW not supported on $(PLATFORM))
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.
313 ifneq (,$(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)
321 INCLUDEQT := -isystem
324 # Setting EPOLL usage - It is Linux specific
325 ifeq ($(PLATFORM), LINUX)
326 CPPFLAGS += -DUSE_EPOLL
329 #not useful in compiler2/asn1, for example
330 #REL_DIR := $(notdir $(CURDIR))
332 export ABS_TOP := $(abspath $(TOP))/
333 ifeq "$(ABS_TOP)" "/"
334 # abspath only from GNU make 3.81, here's a replacement
335 ABS_TOP := $(shell cd $(TOP); pwd)/
340 REL_DIR := $(subst $(ABS_TOP),,$(CURDIR))
342 ABS_SRC := $(SRCDIR)/$(REL_DIR)
344 CPPFLAGS += -I. -I$(ABS_SRC)
350 ABS_SRC := $(abspath $(CURDIR))
352 ABS_SRC := $(shell cd $(CURDIR); pwd)