Sync with 5.1.0
[deliverable/titan.core.git] / regression_test / Makefile.regression
CommitLineData
970ed795
EL
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###############################################################################
8#
9# Common settings for all regression tests (formerly passed through
10# the environment).
11#
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).
14#
15
16ifndef TOPDIR
17$(error Please define TOPDIR in the including makefile)
18endif
19
20# hardcode a path for Jenkinks to workaround XML/XmlWorkflow/bin/prj2mk.pl
21ifneq ($(origin TTCN3_DIR), file)
22# The directory that the Test Executor is installed in:
23TTCN3_DIR := $(shell cd $(TOPDIR)/..; pwd)/Install
24export TTCN3_DIR
25# The following would be nicer, but abspath requires make 3.81 (rhea has only 3.79.1)
26#TTCN3_DIR := $(abspath $(TOPDIR)/../Install)
27endif
28
29# Command for compiling TTCN-3 and ASN.1 modules
30TTCN3_COMPILER := $(TTCN3_DIR)/bin/compiler
31
32# Many tests ignore COMPILER_FLAGS. Append any common options to the compiler name.
33TTCN3_COMPILER += -g -L
34
35# Use the alternative runtime when running the tests
36#RT2 := true
37
38# Use code splitting when running the tests
39#CODE_SPLIT := true
40
41ifdef RT2
42# add command line option to generate code for alternative runtime
43RT2_FLAG := -R
44TTCN3_COMPILER += $(RT2_FLAG)
45RT2_SUFFIX := -rt2
46endif
47
48ifdef DYN
49DYNAMIC_SUFFIX = -dynamic
50ifeq ($(PLATFORM), WIN32)
51 export PATH:=$(TTCN3_DIR)/lib:$(PATH)
52else
53 export LD_LIBRARY_PATH:=$(TTCN3_DIR)/lib:$(LD_LIBRARY_PATH)
54endif
55endif
56
57ifdef CODE_SPLIT
58SPLIT_FLAG = -Utype
59# No space between -U and type !
60TTCN3_COMPILER += $(SPLIT_FLAG)
61endif
62
63# Your platform. Allowed values: SOLARIS, SOLARIS8, LINUX, FREEBSD, WIN32
64ifndef PLATFORM
65PLATFORM1 := $(shell uname -s)
66PLATFORM2 := $(shell uname -r)
67PLATFORM3 := $(shell uname -m)
68
69ifeq ($(PLATFORM1), SunOS)
70 ifeq ($(PLATFORM2), 5.6)
71 PLATFORM := SOLARIS
72 else
73 PLATFORM := SOLARIS8
74 endif # 5.6
75endif # SunOS
76ifeq ($(PLATFORM1), Linux)
77 PLATFORM := LINUX
78endif # Linux
79ifeq ($(PLATFORM1), FreeBSD)
80 PLATFORM := FREEBSD
81endif # FreeBSD
82ifeq ($(findstring CYGWIN, $(PLATFORM1)), CYGWIN)
83 PLATFORM := WIN32
84endif # CYGWIN
85ifeq ($(PLATFORM1), Interix)
86 PLATFORM := INTERIX
87endif # Interix
88endif # ifndef PLATFORM
89ifndef PLATFORM
90 PLEASE CHECK THE ABOVE PLATFORM SETTINGS!!!
91endif # ifndef PLATFORM
92
93# Flags for the C++ preprocessor (and makedepend):
94# This must be recursively expanded (CPPFLAGS=), not simply expanded (CPPFLAGS:=)
95CPPFLAGS = -D$(PLATFORM) -I$(TTCN3_DIR)/include
96ifdef RT2
97CPPFLAGS += -DTITAN_RUNTIME_2
98endif
99
100# # # # Old naming and enum hack (uncomment to test) # # # #
101# TTCN3_COMPILER += -Nold -E
102# CPPFLAGS += -DOLD_NAMES
103
104
105# The C++ compiler used for building:
106CXX := g++
107CC = $(CXX)
108
109# Flags for the C++ compiler:
110CXXFLAGS = -Wall
111
112# Flags for the linker:
113LDFLAGS =
114
115ifeq ($(PLATFORM), WIN32)
116 EXESUFFIX := .exe
117 LDFLAGS += -Wl,--enable-auto-import,--enable-runtime-pseudo-reloc
118else
119 EXESUFFIX :=
120
121 ifdef MINGW
122 $(error MingW not supported on $(PLATFORM))
123 endif
124endif
125
126ifeq ($(PLATFORM3), x86_64)
127 CCFLAGS += -fPIC
128 CXXFLAGS += -fPIC
129 LDFLAGS += -fPIC
130endif
131
132ifeq ($(PLATFORM),INTERIX)
133# Pick up the right iconv
134CPPFLAGS += -I/usr/local/include
135endif
136
137# Path of OpenSSL installation:
138OPENSSL_DIR = /mnt/TTCN/Tools/openssl-0.9.8k
139
140LCOV_DIR := /mnt/TTCN/Tools/lcov-1.7/usr
141
142#LCOV=1
143
144ifdef LCOV
145 CXXFLAGS += -fprofile-arcs -ftest-coverage -g
146 LDFLAGS += -fprofile-arcs -ftest-coverage -g -lgcov
147endif
148
149
150# Utility for finding patterns:
151ifeq ($(PLATFORM1), SunOS)
152 GREP := /usr/xpg4/bin/grep
153else
154 GREP := grep
155endif # SunOS
156export GREP
157
158# Suffix of executables
159ifeq ($(PLATFORM), WIN32)
160 EXESUFFIX := .exe
161else
162 EXESUFFIX :=
163endif # WIN32
164
165SOLARIS_LIBS = -lxnet -L${XMLDIR}/lib -lxml2 -lresolv
166SOLARIS8_LIBS = $(SOLARIS_LIBS) -lresolv
167LINUX_LIBS = -L${XMLDIR}/lib -lxml2 -lpthread -lrt
168FREEBSD_LIBS =
169WIN32_LIBS = -L${XMLDIR}/lib -lxml2
170INTERIX_LIBS = -L${XMLDIR}/lib -lxml2 -liconv
171
172
173#
174# Include local preferences
175#
176-include $(TOPDIR)/Makefile.personal
177
178ifeq (${XMLDIR}, default)
179CPPFLAGS += -I/usr/include/libxml2
180else
181CPPFLAGS += -I${XMLDIR}/include/libxml2
182endif
183
184
185
186# Quiet down a bit
187CXXFLAGS += -Wno-deprecated-declarations
188
189# At least ASN1/errorMessages needs ASN1_COMPILER in the environment
190export ASN1_COMPILER TTCN3_COMPILER
191
192print-%:
193 @echo $* = \"$($*)\" from $(origin $*)
194
195#
196# Define SRCDIR for OOBE. It should point to the original regression_test dir.
197#
198ifdef SRCDIR
199TOP_SRC := $(SRCDIR)
200
201# absolute path to "regression_test" in the build dir
202ABS_TOP := $(abspath $(TOPDIR))/
203
204# relative path from "regression_test" to current dir
205REL_DIR := $(subst $(ABS_TOP),,$(CURDIR))
206
207# absolute path to the equivalent of current dir
208ABS_SRC := $(SRCDIR)/$(REL_DIR)/
209
210vpath %.ttcnpp $(ABS_SRC)
211vpath %.inc $(ABS_SRC)
212vpath %.ttcn $(ABS_SRC)
213vpath %.asn $(ABS_SRC)
214vpath %.ttcnin $(ABS_TOP)/XML
215
216$(foreach src, $(USER_SOURCES), $(eval vpath $(src) $(ABS_SRC)))
217
218CPPFLAGS += -I. -I$(ABS_SRC)
219
220else
221TOP_SRC := $(TOPDIR)
222
223ABS_SRC := $(abspath .)
224ifeq "${ABS_SRC}" ""
225ABS_SRC :=$(shell pwd)
226endif
227
228endif
229
230export ABS_SRC
231
232vpath %.cfg $(ABS_SRC)
This page took 0.064126 seconds and 5 git commands to generate.