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)
92 JDKDIR := /usr/lib/jvm/default-java
94 JDKDIR := /usr/lib/jvm/default-java
95 >>>>>>> 318d000115c0c01e0d7077166c13a9ab3918e287
97 # Path of OpenSSL installation: (always required)
98 OPENSSL_DIR := default
100 # Location of libxml2
103 # Flags for the C(++) preprocessor:
104 # Prevent a warning about yyinput being defined but not used
105 CPPFLAGS := -DYY_NO_INPUT
107 # Flags shared between C and C++
108 COMPILERFLAGS := -Wall
110 # 'Hardcore' settings
111 # Unlikely to work for GCC below 4.x
112 #COMPILERFLAGS += -Werror -pedantic -W -Wno-unused-parameter -O1
114 # Flags for the C compiler.
115 # std=gnu9x shuts up warnings about long long and variadic macros
116 CCFLAGS = $(COMPILERFLAGS) -std=gnu9x
118 # Flags for the C++ compiler:
119 CXXFLAGS = $(COMPILERFLAGS) -Wno-long-long
121 # The command for maintaining static libraries:
124 # The command for building the shared libraries:
125 # It shall be set to either "$(CXX) -G" or "$(CXX) -shared" depending
126 # on the linker you use.
129 # Flags for linking binary executables (e.g. for profiling):
132 # The command for removing symbol table from the executables:
136 FLEXFLAGS := -B -s -Cr
141 # Override common settings with personal preferences if needed
142 -include $(TOP)/Makefile.personal
144 ## ## ## ## ## Variables below are automatically set ## ## ## ## ##
147 CPPFLAGS += -DMEMORY_DEBUG -DFATAL_DEBUG
152 # MingW flags need to be passed to the preprocessor during ctags configure
157 CCFLAGS += -Wshadow -Wpointer-arith -Wcast-qual -Wcast-align \
160 ifeq ($(COVERAGE), yes)
167 # Only the default Cygwin compiler can be used for Mingw.
168 # Its version is 3.4.4, too low.
170 # Only GCC 4.x understands -Wno-variadic-macros, comment out for lower versions
171 #CXXFLAGS += -Wno-variadic-macros
176 CXXFLAGS += -Wshadow -Wpointer-arith -Wcast-qual -Wcast-align
178 ifeq ($(COVERAGE), yes)
185 # Flags for the C/C++ compilers to generate dependency list (-M or -MM
186 # for gcc or clang, -xM or -xM1 for Sun C compiler).
188 ifneq ($(filter gcc% clang%, $(notdir $(CC))),)
192 # Let's hope it's the Sun compiler
206 # Comment out the line below if flex version 2.5.4[a] is used.
207 # This version does not support optimized tables together with yylineno.
216 ifeq ($(COVERAGE), yes)
217 CPPFLAGS += -DCOVERAGE_BUILD
218 COMPILERFLAGS += -fprofile-arcs -ftest-coverage
219 LDFLAGS += -fprofile-arcs -ftest-coverage -lgcov
222 # Directory which contains the code for POSIX regular expression handling.
223 # It is needed on platforms where the system's libc does not support POSIX
224 # regexps. This is the case for Mingw.
226 # If your platform isn't Mingw but lacks POSIX regular expressions,
227 # comment out the ifdef/endif
228 REGEX_DIR := /mnt/TTCN/Tools/CPP/regex-glibc-2.5.1
231 # Warning! Never set the above directories to /usr.
232 # If your OpenSSL, Qt is installed under /usr you'd better set
233 # these variables to a fake (non-existent) directory. If this is the case,
234 # gcc will find the required headers and libs anyway, but -I/usr/include
237 # This is especially true on Windows with Mingw installed as a Cygwin package.
238 # -mno-cygwin alters the include serach path to find the Mingw headers.
239 # Passing -I/usr/include would cause the Mingw compiler to read the Cygwin
240 # headers, and the compilation will fail.
242 # The path name where the LaTeX binaries can be found. (optional)
243 # If this variable is not defined the User Documentation will not be built
245 TEXPATH := /usr/local/teTeX2.0.2/bin/sparc-sun-solaris2.8
248 ###########################################################################
249 # You don't have to alter anything below this line.
251 # Setting PLATFORM automagically if it is not defined.
253 PLATFORM1 := $(shell uname -s)
254 PLATFORM2 := $(shell uname -r)
255 PLATFORM3 := $(shell uname -m)
256 ifeq ($(PLATFORM1), SunOS)
257 ifneq ($(PLATFORM2), 5.6)
265 ifeq ($(PLATFORM1), Linux)
269 ifeq ($(PLATFORM1), FreeBSD)
272 ifeq ($(findstring CYGWIN, $(PLATFORM1)), CYGWIN)
276 endif # ifndef PLATFORM
278 PLATFORM := $(error PLEASE CHECK THE PLATFORM SETTINGS)
279 endif # ifndef PLATFORM
281 # Derived variables, which you should never change.
285 # Target directory for binaries:
286 BINDIR := $(TTCN3_DIR)/programs
287 # Target directory for manual pages:
288 MANDIR := $(TTCN3_DIR)/manuals
289 # Target directory for other files (nedit/xemacs additions, etc.)
290 ETCDIR := $(TTCN3_DIR)
294 # Target directory for binaries:
295 BINDIR := $(TTCN3_DIR)/bin
296 # Target directory for manual pages:
297 MANDIR := $(TTCN3_DIR)/man
298 # Target directory for other files (nedit/xemacs additions, etc.)
299 ETCDIR := $(TTCN3_DIR)/etc
303 # Target directory for header files:
304 INCDIR := $(TTCN3_DIR)/include
305 # Target directory for libraries:
306 LIBDIR := $(TTCN3_DIR)/lib
307 # Target directory for html help pages:
308 HELPDIR := $(TTCN3_DIR)/help
309 # Target directory for the documentation:
310 DOCDIR := $(TTCN3_DIR)/doc
311 # Target directory for the demo "Hello World!"
312 DEMODIR := $(TTCN3_DIR)/demo
314 CPPFLAGS += -D$(PLATFORM)
316 ifeq ($(LICENSING), yes)
317 CPPFLAGS += -DLICENSE
318 LICENSE_LIBS = -L$(OPENSSL_DIR)/lib -lcrypto
323 ifeq ($(USAGE_STATS), yes)
324 CPPFLAGS += -DUSAGE_STATS
327 # Windows/Cygwin specific settings
328 ifeq ($(PLATFORM), WIN32)
330 LDFLAGS += -Wl,--enable-auto-import,--enable-runtime-pseudo-reloc
333 MINGW_LIBS := -lgdi32
339 $(error MingW not supported on $(PLATFORM))
347 # Try to use -isystem for Qt headers (this is a GCC feature).
348 # This avoids the myriads of warnings issued for the Qt headers.
349 ifneq (,$(findstring SOLARIS,$(PLATFORM)))
350 # Avoid using it on Solaris, because
351 # -isystem puts an implicit "extern C" around every system header,
352 # which causes compilation of Qt headers to fail miserably :-(
353 # (this could be fixed by recompiling GCC)
357 INCLUDEQT := -isystem
360 # Setting EPOLL usage - It is Linux specific
361 ifeq ($(PLATFORM), LINUX)
362 CPPFLAGS += -DUSE_EPOLL
365 #not useful in compiler2/asn1, for example
366 #REL_DIR := $(notdir $(CURDIR))
368 export ABS_TOP := $(abspath $(TOP))/
369 ifeq "$(ABS_TOP)" "/"
370 # abspath only from GNU make 3.81, here's a replacement
371 ABS_TOP := $(shell cd $(TOP); pwd)/
376 REL_DIR := $(subst $(ABS_TOP),,$(CURDIR))
378 ABS_SRC := $(SRCDIR)/$(REL_DIR)
380 CPPFLAGS += -I. -I$(ABS_SRC)
386 ABS_SRC := $(abspath $(CURDIR))
388 ABS_SRC := $(shell cd $(CURDIR); pwd)