implemented new code splitting mechanism (split to equal slices)
[deliverable/titan.core.git] / regression_test / XML / EXER-whitepaper / 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
16#
17# Tests transcribed from "ASN.1, a schema language for XML"
18#
19
20TOPDIR := ../..
21include ../../Makefile.regression
22
23ORIG ?= .
24
25ifdef SRCDIR
26ORIGSRC := $(ABS_SRC)
27else
28ORIGSRC := $(ORIG)
29endif
30
31CPP := cpp
32
33# Flags for the C++ preprocessor (and makedepend as well):
34#CPPFLAGS +=
35
36# Flags for preprocessing TTCN-3 files:
37#CPPFLAGS_TTCN3 +=
38
39# Flags for the C++ compiler:
40CXXFLAGS += -g -fmessage-length=0
41
42# Flags for the linker:
43LDFLAGS += -g
44
45WIN32_LIBS += -liconv
46INTERIX_LIBS += -L/usr/local/lib -liconv
47FREEBSD_LIBS += -liconv
48
49# Local flags for Titan (can be overridden from the environment or commandline)
50TTCNFLAGS := -b -r -x
51
52# Flags for the TTCN-3 and ASN.1 compiler
53# (common flags already set in Makefile.regression)
54COMPILER_FLAGS += $(TTCNFLAGS) -a
55
56# $(sort ) also eliminates duplicates
57COMPILER_FLAGS := $(sort $(COMPILER_FLAGS))
58
59# Execution mode: (either ttcn3 or ttcn3-parallel)
60TTCN3_LIB := ttcn3$(RT2_SUFFIX)$(DYNAMIC_SUFFIX)
61
62##
63##
64
65# TTCN-3 modules of this project:
66TTCN3_MODULES = converter.ttcn
67# UTF8.ttcn
68
69# TTCN-3 modules to preprocess:
70TTCN3_PP_MODULES := $(wildcard $(ORIGSRC)/*.ttcnpp)
71
72
73# Files to include in TTCN-3 preprocessed modules:
74TTCN3_INCLUDES = $(TOP_SRC)/XML/macros.ttcnin
75
76# TTCN-3 source files generated by the C preprocessor:
77PREPROCESSED_TTCN3_MODULES := $(notdir $(TTCN3_PP_MODULES:.ttcnpp=.ttcn))
78
79
80# C++ source & header files generated from the TTCN-3 & ASN.1 modules of
81# this project:
82GENERATED_SOURCES := $(TTCN3_MODULES:.ttcn=.cc) $(PREPROCESSED_TTCN3_MODULES:.ttcn=.cc) $(ASN1_MODULES:.asn=.cc)
83GENERATED_HEADERS := $(GENERATED_SOURCES:.cc=.hh)
84ifdef CODE_SPLIT
85GENERATED_SOURCES := $(foreach file, $(GENERATED_SOURCES:.cc=), $(addprefix $(file), .cc _seq.cc _set.cc _seqof.cc _setof.cc _union.cc))
14e21cff 86else ifdef SPLIT_TO_SLICES
87POSTFIXES := $(foreach file, $(SPLIT_TO_SLICES), $(addsuffix $(file), _part_))
88POSTFIXES := $(foreach file, $(POSTFIXES), $(addprefix $(file), .cc))
89GENERATED_SOURCES2 := $(foreach file, $(GENERATED_SOURCES:.cc=), $(addprefix $(file), $(POSTFIXES)))
90GENERATED_SOURCES += $(GENERATED_SOURCES2)
970ed795
EL
91endif
92
93# C/C++ Source & header files of Test Ports, external functions and
94# other modules:
95USER_SOURCES := iconver.cc
96USER_HEADERS := $(USER_SOURCES:.cc=.hh)
97
98# Object files of this project that are needed for the executable test suite:
99OBJECTS := $(GENERATED_SOURCES:.cc=.o) $(USER_SOURCES:.cc=.o)
100
101# The name of the executable test suite:
102TARGET := EXERtest$(RT2_SUFFIX)$(EXESUFFIX)
103
104#
105# Rules for building the executable...
106#
107
108all: $(TARGET)
109
110objects: $(OBJECTS) ;
111
112ifeq ($(findstring dynamic,$(TTCN3_LIB)),)
113# not dynamic
114CORELIB_BINARY := $(TTCN3_DIR)/lib/lib$(TTCN3_LIB).a
115else
116CORELIB_BINARY := $(TTCN3_DIR)/lib/lib$(TTCN3_LIB).so
117endif
118
119# libttcn3.a appears twice; this should be harmless
120$(TARGET): $(OBJECTS) $(CORELIB_BINARY)
121 $(CXX) $(LDFLAGS) -o $@ $(OBJECTS) \
122 -L$(TTCN3_DIR)/lib -l$(TTCN3_LIB) \
123 -L$(OPENSSL_DIR)/lib -lcrypto $($(PLATFORM)_LIBS) \
124 || $(TTCN3_DIR)/bin/titanver $(OBJECTS)
125
126%.o: %.cc
127 @echo '(C++)' $<; $(CXX) -c $(CPPFLAGS) $(CXXFLAGS) $<
128
129%.d: %.cc
130 @echo '(dep)' $<; $(CXX) -MM -MP $(CPPFLAGS) $(CXXFLAGS) $< >$@
131
132# The preprocessing step
133%.ttcn: %.ttcnpp $(TTCN3_INCLUDES)
134 $(CPP) -x c -nostdinc $(CPPFLAGS_TTCN3) $< $@
135
136preprocess: $(PREPROCESSED_TTCN3_MODULES) ;
137
138$(GENERATED_SOURCES) $(GENERATED_HEADERS): compile
139 @if [ ! -f $@ ]; then $(RM) compile; $(MAKE) compile; fi
140
141check: $(TTCN3_MODULES) $(PREPROCESSED_TTCN3_MODULES) $(ASN1_MODULES)
142 $(TTCN3_COMPILER) -s $(COMPILER_FLAGS) $^
143
144compile:: $(firstword $(TTCN3_COMPILER))
145 @if [ -f $@ ]; then $(RM) compile; $(MAKE) compile; fi
146# if [ -f $(GENERATED_SOURCES) ]; then rm -f $(GENERATED_SOURCES); $(MAKE) $(GENERATED_SOURCES); fi
147
148compile:: $(TTCN3_MODULES) $(PREPROCESSED_TTCN3_MODULES) $(ASN1_MODULES)
149# "modulepar boolean verbose" makes this unusable with old names
150 $(TTCN3_COMPILER) $(COMPILER_FLAGS) $^ - $?
151 touch $@
152
153clean celan clena:
154 -$(RM) $(TARGET) $(OBJECTS) $(GENERATED_HEADERS) \
155 $(GENERATED_SOURCES) $(PREPROCESSED_TTCN3_MODULES) compile \
156 tags *.log
157
158distclean: clean
159 -$(RM) $(DEPFILES)
160
161#
162# Add your rules here if necessary...
163#
164
165.SUFFIXES: .asn .ttcn .ttcnpp
166
167RUN := $(shell which colortitan 2>/dev/null)
168ifeq ($(firstword $(RUN)),no)
169# stupid /bin/which on Solaris writes errors to stdout instead of stderr
170RUN :=
171endif
172
173run: $(TARGET) config.cfg
174 $(RUN) ./$^
175
176debug:
177 $(MAKE) run RUN='gdb --args'
178
179vpath %.cc $(TOP_SRC)/iconv
180vpath %.ttcn $(TOP_SRC)/iconv
181
182
183dep: ;
184
185DEPFILES := $(OBJECTS:.o=.d)
186
187ifeq (,$(findstring n,$(MAKEFLAGS)))
188ifeq (,$(filter clean distclean preprocess,$(MAKECMDGOALS)))
189-include $(DEPFILES)
190endif
191endif
192
193# Only ttcnpp files contain tests
194TESTS := $(PREPROCESSED_TTCN3_MODULES:.ttcn=)
195
196# Ability to run one control part
197$(TESTS): $(TARGET) config.cfg
198 $(RUN) ./$^ $@
199
200ifdef SRCDIR
201$(foreach src, $(USER_SOURCES), $(eval vpath $(src) $(ABS_SRC)))
202endif
This page took 0.033272 seconds and 5 git commands to generate.