implemented new code splitting mechanism (split to equal slices)
[deliverable/titan.core.git] / regression_test / anytype / Makefile
CommitLineData
d44e3c4f 1##############################################################################
2# Copyright (c) 2000-2016 Ericsson Telecom AB
970ed795
EL
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
d44e3c4f 7#
8# Contributors:
9# Baji, Laszlo
10# Balasko, Jeno
11# Kovacs, Ferenc
12# Raduly, Csaba
14e21cff 13# Szabo, Bence Janos
d44e3c4f 14#
15##############################################################################
970ed795
EL
16TOPDIR := ..
17include ../Makefile.regression
18
19ORIG ?= .
20
21# WARNING! This Makefile can be used with GNU make only.
22# Other versions of make may report syntax errors in it.
23
24#
25# Do NOT touch this line...
26#
27.PHONY: all check clean dep objects preprocess
28
29#
30# Set these variables...
31#
32
33
34# C preprocessor used for TTCN-3 files:
35CPP = cpp
36
37# Flags for the C++ preprocessor (and makedepend as well):
38CPPFLAGS += -D$(PLATFORM)
39# -I$(TTCN3_DIR)/include
40
41# Flags for preprocessing TTCN-3 files:
42#CPPFLAGS_TTCN3 +=
43
44# Flags for the C++ compiler: (-Wall already in)
45CXXFLAGS += -g -W -Wformat=2
46
47# Flags for the linker:
48LDFLAGS += -g
49
50# Local flags for Titan (can be overridden from the environment or commandline)
51TTCNFLAGS += -b -r -x
52
53# Flags for the TTCN-3 and ASN.1 compiler
54# (common flags already set in Makefile.regression)
55COMPILER_FLAGS += $(TTCNFLAGS)
56
57# $(sort ) also eliminates duplicates
58COMPILER_FLAGS := $(sort $(COMPILER_FLAGS))
59
60# Execution mode: (either ttcn3 or ttcn3-parallel)
61TTCN3_LIB = ttcn3$(RT2_SUFFIX)$(DYNAMIC_SUFFIX)
62
63
64#
65# You may change these variables. Add your files if necessary...
66#
67
68# TTCN-3 modules to preprocess:
69TTCN3_PP_MODULES = $(wildcard $(ABS_SRC)/*.ttcnpp)
70
71# Files to include in TTCN-3 preprocessed modules:
72TTCN3_INCLUDES = $(TOP_SRC)/XML/macros.ttcnin
73
74# ASN.1 modules of this project:
75ASN1_MODULES =
76
77# TTCN-3 source files generated by the C preprocessor:
78PREPROCESSED_TTCN3_MODULES := $(notdir $(TTCN3_PP_MODULES:.ttcnpp=.ttcn))
79
80# TTCN-3 modules of this project:
81TTCN3_MODULES = smallany.ttcn noany.ttcn
82
83# C++ source & header files generated from the TTCN-3 & ASN.1 modules of
84# this project:
85GENERATED_SOURCES = $(TTCN3_MODULES:.ttcn=.cc) $(PREPROCESSED_TTCN3_MODULES:.ttcn=.cc) $(ASN1_MODULES:.asn=.cc)
86GENERATED_HEADERS = $(GENERATED_SOURCES:.cc=.hh)
87ifdef CODE_SPLIT
88GENERATED_SOURCES := $(foreach file, $(GENERATED_SOURCES:.cc=), $(addprefix $(file), .cc _seq.cc _set.cc _seqof.cc _setof.cc _union.cc))
14e21cff 89else ifdef SPLIT_TO_SLICES
90POSTFIXES := $(foreach file, $(SPLIT_TO_SLICES), $(addsuffix $(file), _part_))
91POSTFIXES := $(foreach file, $(POSTFIXES), $(addprefix $(file), .cc))
92GENERATED_SOURCES2 := $(foreach file, $(GENERATED_SOURCES:.cc=), $(addprefix $(file), $(POSTFIXES)))
93GENERATED_SOURCES += $(GENERATED_SOURCES2)
970ed795
EL
94endif
95
96# C/C++ Source & header files of Test Ports, external functions and
97# other modules:
98USER_SOURCES =
99USER_HEADERS = $(USER_SOURCES:.cc=.hh)
100
101# Object files of this project that are needed for the executable test suite:
102OBJECTS = $(GENERATED_SOURCES:.cc=.o) $(USER_SOURCES:.cc=.o)
103
104# The name of the executable test suite:
105TARGET = AnytypeTest
106
107
108#
109# Rules for building the executable...
110#
111
112all: $(TARGET) ;
113
114objects: $(OBJECTS) ;
115
116$(TARGET): $(GENERATED_SOURCES) $(USER_SOURCES)
117 $(CXX) $(CPPFLAGS) $(CXXFLAGS) $(LDFLAGS) -o $@ $^ \
118 -L$(TTCN3_DIR)/lib -l$(TTCN3_LIB) \
119 -L$(OPENSSL_DIR)/lib -lcrypto \
120 -L$(XMLDIR)/lib $($(PLATFORM)_LIBS)
121
122%.ttcn: %.ttcnpp $(TTCN3_INCLUDES)
123 $(CPP) -x c -nostdinc $(CPPFLAGS_TTCN3) $< $@
124
125preprocess: $(PREPROCESSED_TTCN3_MODULES) ;
126
127$(GENERATED_SOURCES) $(GENERATED_HEADERS): compile
128 @if [ ! -f $@ ]; then $(RM) compile; $(MAKE) compile; fi
129
130ifeq ($(findstring dynamic,$(TTCN3_LIB)),)
131# not dynamic
132CORELIB_BINARY := $(TTCN3_DIR)/lib/lib$(TTCN3_LIB).a
133else
134CORELIB_BINARY := $(TTCN3_DIR)/lib/lib$(TTCN3_LIB).so
135endif
136
137
138compile:: $(firstword $(TTCN3_COMPILER)) $(CORELIB_BINARY)
139 @if [ -f $@ ]; then $(RM) compile; $(MAKE) compile; fi
140
141compile:: $(TTCN3_MODULES) $(PREPROCESSED_TTCN3_MODULES) $(ASN1_MODULES)
142# no old names due to modulepar verbose
143 $(filter-out -Nold -E, $(TTCN3_COMPILER) $(COMPILER_FLAGS)) $^ - $?
144 touch $@
145
146clean distclean:
147 -$(RM) $(TARGET) $(OBJECTS) $(GENERATED_HEADERS) \
148 $(GENERATED_SOURCES) $(PREPROCESSED_TTCN3_MODULES) compile \
149 tags *.log
150
151dep: $(GENERATED_SOURCES) $(USER_SOURCES)
152 makedepend $(CPPFLAGS) $^
153
154#
155# Add your rules here if necessary...
156#
157
158install:
159 @echo You cannot be serious!
160
161re:
162 rm -f compile
163
164RUN := $(shell which colortitan)
165ifeq ($(firstword $(RUN)),no)
166# stupid /bin/which on Solaris writes errors to stdout instead of stderr
167RUN :=
168endif
169
170
171run: $(TARGET) config.cfg
172 $(RUN) ./$^
173
This page took 0.031105 seconds and 5 git commands to generate.