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 # Common settings for all regression tests (formerly passed through
12 # Warning! This makefile is included at the beginning of other makefiles.
13 # Do not put any targets here (they would override the default target).
17 $(error Please define TOPDIR in the including makefile)
20 # hardcode a path for Jenkinks to workaround XML/XmlWorkflow/bin/prj2mk.pl
21 ifneq ($(origin TTCN3_DIR), file)
22 # The directory that the Test Executor is installed in:
23 TTCN3_DIR := $(shell cd $(TOPDIR)/..; pwd)/Install
25 # The following would be nicer, but abspath requires make 3.81 (rhea has only 3.79.1)
26 #TTCN3_DIR := $(abspath $(TOPDIR)/../Install)
29 # Command for compiling TTCN-3 and ASN.1 modules
30 TTCN3_COMPILER := $(TTCN3_DIR)/bin/compiler
32 # Many tests ignore COMPILER_FLAGS. Append any common options to the compiler name.
33 TTCN3_COMPILER += -g -L
35 # Use the alternative runtime when running the tests
38 # Use code splitting when running the tests
42 # add command line option to generate code for alternative runtime
44 TTCN3_COMPILER += $(RT2_FLAG)
49 DYNAMIC_SUFFIX = -dynamic
50 ifeq ($(PLATFORM), WIN32)
51 export PATH:=$(TTCN3_DIR)/lib:$(PATH)
53 export LD_LIBRARY_PATH:=$(TTCN3_DIR)/lib:$(LD_LIBRARY_PATH)
59 # No space between -U and type !
60 TTCN3_COMPILER += $(SPLIT_FLAG)
63 # Your platform. Allowed values: SOLARIS, SOLARIS8, LINUX, FREEBSD, WIN32
65 PLATFORM1 := $(shell uname -s)
66 PLATFORM2 := $(shell uname -r)
67 PLATFORM3 := $(shell uname -m)
69 ifeq ($(PLATFORM1), SunOS)
70 ifeq ($(PLATFORM2), 5.6)
76 ifeq ($(PLATFORM1), Linux)
79 ifeq ($(PLATFORM1), FreeBSD)
82 ifeq ($(findstring CYGWIN, $(PLATFORM1)), CYGWIN)
85 ifeq ($(PLATFORM1), Interix)
88 endif # ifndef PLATFORM
90 PLEASE CHECK THE ABOVE PLATFORM SETTINGS!!!
91 endif # ifndef PLATFORM
93 # Flags for the C++ preprocessor (and makedepend):
94 # This must be recursively expanded (CPPFLAGS=), not simply expanded (CPPFLAGS:=)
95 CPPFLAGS = -D$(PLATFORM) -I$(TTCN3_DIR)/include
97 CPPFLAGS += -DTITAN_RUNTIME_2
100 # # # # Old naming and enum hack (uncomment to test) # # # #
101 # TTCN3_COMPILER += -Nold -E
102 # CPPFLAGS += -DOLD_NAMES
105 # The C++ compiler used for building:
109 # Flags for the C++ compiler:
112 # Flags for the linker:
115 ifeq ($(PLATFORM), WIN32)
117 LDFLAGS += -Wl,--enable-auto-import,--enable-runtime-pseudo-reloc
122 $(error MingW not supported on $(PLATFORM))
126 ifeq ($(PLATFORM3), x86_64)
132 ifeq ($(PLATFORM),INTERIX)
133 # Pick up the right iconv
134 CPPFLAGS += -I/usr/local/include
137 # Path of OpenSSL installation:
138 OPENSSL_DIR = /mnt/TTCN/Tools/openssl-0.9.8k
140 LCOV_DIR := /mnt/TTCN/Tools/lcov-1.7/usr
145 CPPFLAGS += -fprofile-arcs -ftest-coverage -g
146 CXXFLAGS += -fprofile-arcs -ftest-coverage -g
147 LDFLAGS += -fprofile-arcs -ftest-coverage -g -lgcov
151 # Utility for finding patterns:
152 ifeq ($(PLATFORM1), SunOS)
153 GREP := /usr/xpg4/bin/grep
159 # Suffix of executables
160 ifeq ($(PLATFORM), WIN32)
166 SOLARIS_LIBS = -lxnet -L${XMLDIR}/lib -lxml2 -lresolv
167 SOLARIS8_LIBS = $(SOLARIS_LIBS) -lresolv
168 LINUX_LIBS = -L${XMLDIR}/lib -lxml2 -lpthread -lrt
170 WIN32_LIBS = -L${XMLDIR}/lib -lxml2
171 INTERIX_LIBS = -L${XMLDIR}/lib -lxml2 -liconv
175 # Include local preferences
177 -include $(TOPDIR)/Makefile.personal
179 ifeq (${XMLDIR}, default)
180 CPPFLAGS += -I/usr/include/libxml2
182 CPPFLAGS += -I${XMLDIR}/include/libxml2
188 CXXFLAGS += -Wno-deprecated-declarations
190 # At least ASN1/errorMessages needs ASN1_COMPILER in the environment
191 export ASN1_COMPILER TTCN3_COMPILER
194 @echo $* = \"$($*)\" from $(origin $*)
197 # Define SRCDIR for OOBE. It should point to the original regression_test dir.
202 # absolute path to "regression_test" in the build dir
203 ABS_TOP := $(abspath $(TOPDIR))/
205 # relative path from "regression_test" to current dir
206 REL_DIR := $(subst $(ABS_TOP),,$(CURDIR))
208 # absolute path to the equivalent of current dir
209 ABS_SRC := $(SRCDIR)/$(REL_DIR)/
211 vpath %.ttcnpp $(ABS_SRC)
212 vpath %.inc $(ABS_SRC)
213 vpath %.ttcn $(ABS_SRC)
214 vpath %.asn $(ABS_SRC)
215 vpath %.ttcnin $(ABS_TOP)/XML
217 $(foreach src, $(USER_SOURCES), $(eval vpath $(src) $(ABS_SRC)))
219 CPPFLAGS += -I. -I$(ABS_SRC)
224 ABS_SRC := $(abspath .)
226 ABS_SRC :=$(shell pwd)
233 vpath %.cfg $(ABS_SRC)