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