implemented new code splitting mechanism (split to equal slices)
[deliverable/titan.core.git] / regression_test / XML / XMLqualif / 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#
10# Baji, Laszlo
11# Balasko, Jeno
12# Raduly, Csaba
14e21cff 13# Szabo, Bence Janos
d44e3c4f 14#
15##############################################################################
970ed795
EL
16TOPDIR := ../..
17include ../../Makefile.regression
18
19ORIG ?= .
20
21CPP := cpp
22
23# WARNING! This Makefile can be used with GNU make only.
24# Other versions of make may report syntax errors in it.
25
26#
27# Do NOT touch this line...
28#
29.PHONY: all archive check clean distclean dep objects preprocess
30
31.SUFFIXES: .d
32
33#
34# Set these variables...
35#
36
37# C preprocessor used for TTCN-3 files:
38CPP = cpp
39
40# Flags for the C++ preprocessor (and makedepend as well):
41#CPPFLAGS +=
42
43# Flags for dependency generation
44CXXDEPFLAGS = -MM
45
46# Flags for preprocessing TTCN-3 files:
47CPPFLAGS_TTCN3 +=
48
49# Flags for the C++ compiler:
50#CXXFLAGS = -Wall
51
52# Flags for the linker:
53LDFLAGS +=
54
55ifeq ($(PLATFORM), WIN32)
56# Silence linker warnings.
57LDFLAGS += -Wl,--enable-auto-import,--enable-runtime-pseudo-reloc
58endif
59
60# Flags for the TTCN-3 and ASN.1 compiler:
61COMPILER_FLAGS += -brx
62COMPILER_FLAGS := $(sort $(COMPILER_FLAGS))
63# $(sort ) removes duplicates
64
65# Execution mode: (either ttcn3 or ttcn3-parallel)
66TTCN3_LIB := ttcn3$(RT2_SUFFIX)$(DYNAMIC_SUFFIX)
67
68#
69# You may change these variables. Add your files if necessary...
70#
71
72# TTCN-3 modules of this project:
73TTCN3_MODULES := UsefulTtcn3Types.ttcn XSD.ttcn \
74www_example_com_POQ.ttcn www_example_com_POU.ttcn \
75www_example_com_POQAQ.ttcn www_example_com_POUAQ.ttcn \
76converter.ttcn www_example_org_all.ttcn
77
78vpath %.cc $(TOP_SRC)/iconv
79vpath %.ttcn $(TOP_SRC)/iconv
80vpath %.xsd $(ABS_SRC)
81
82# TTCN-3 modules to preprocess:
83TTCN3_PP_MODULES = POtest.ttcnpp
84
85# Files to include in TTCN-3 preprocessed modules:
86TTCN3_INCLUDES = $(TOP_SRC)/XML/macros.ttcnin
87
88# ASN.1 modules of this project:
89ASN1_MODULES =
90
91# TTCN-3 source files generated by the C preprocessor:
92PREPROCESSED_TTCN3_MODULES = $(notdir $(TTCN3_PP_MODULES:.ttcnpp=.ttcn))
93
94# C++ source & header files generated from the TTCN-3 & ASN.1 modules of
95# this project:
96GENERATED_SOURCES := $(TTCN3_MODULES:.ttcn=.cc) $(TTCN3_PP_MODULES:.ttcnpp=.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 = 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
115DEPFILES = $(OBJECTS:.o=.d)
116
117# Other files of the project (Makefile, configuration files, etc.)
118# that will be added to the archived source files:
119OTHER_FILES = po_qual_default.xml po_qual_explicit.xml po_unqual.xml \
120po_qual.xsd po_qual_atr.xsd po_qual_both.xsd po_unqual.xsd \
121config.cfg Makefile
122
123# The name of the executable test suite:
124TARGET = POtest$(EXESUFFIX)
125
126#
127# Do not modify these unless you know what you are doing...
128# Platform specific additional libraries:
129#
f08ff9ca
BB
130SOLARIS_LIBS = -lsocket -lnsl -lxml2 -lresolv -lcurses
131SOLARIS8_LIBS = -lsocket -lnsl -lxml2 -lresolv -lcurses
132LINUX_LIBS = -lxml2 -lpthread -lrt -lncurses
133FREEBSD_LIBS = -lxml2 -liconv -lncurses
134WIN32_LIBS = -lxml2 -liconv -lncurses
970ed795
EL
135
136#
137# Rules for building the executable...
138#
139
140all: $(TARGET) ;
141
142shared_objects: $(SHARED_OBJECTS) ;
143
144objects: $(OBJECTS) ;
145
146ifeq ($(findstring dynamic,$(TTCN3_LIB)),)
147# not dynamic
148CORELIB_BINARY := $(TTCN3_DIR)/lib/lib$(TTCN3_LIB).a
149else
150CORELIB_BINARY := $(TTCN3_DIR)/lib/lib$(TTCN3_LIB).so
151endif
152
153$(TARGET): $(OBJECTS) $(CORELIB_BINARY)
154 $(CXX) $(LDFLAGS) -o $@ $(OBJECTS) \
155 -L$(TTCN3_DIR)/lib -l$(TTCN3_LIB) \
156 -L$(OPENSSL_DIR)/lib -lcrypto \
157 -L$(XMLDIR)/lib $($(PLATFORM)_LIBS) \
158 || $(TTCN3_DIR)/bin/titanver $(OBJECTS)
159
160.cc.o .c.o:
161 $(CXX) -c $(CPPFLAGS) $(CXXFLAGS) -o $@ $<
162
163.cc.d .c.d:
164 @echo Creating dependency file for '$<'; set -e; \
165 $(CXX) $(CXXDEPFLAGS) $(CPPFLAGS) $(CXXFLAGS) $< \
166 | sed 's/\($*\)\.o[ :]*/\1.o $@ : /g' > $@; \
167 [ -s $@ ] || rm -f $@
168
169%.ttcn: %.ttcnpp $(TTCN3_INCLUDES)
170 $(CPP) -x c -nostdinc $(CPPFLAGS_TTCN3) $< $@
171
172preprocess: $(PREPROCESSED_TTCN3_MODULES) ;
173
174$(GENERATED_SOURCES) $(GENERATED_HEADERS): compile
175 @if [ ! -f $@ ]; then $(RM) compile; $(MAKE) compile; fi
176
177check: $(TTCN3_MODULES) $(PREPROCESSED_TTCN3_MODULES) $(ASN1_MODULES)
178 $(TTCN3_COMPILER) -s $(COMPILER_FLAGS) $^
179
180compile:: $(firstword $(TTCN3_COMPILER))
181 @if [ -f $@ ]; then $(RM) compile; $(MAKE) compile; fi
182
183compile:: $(TTCN3_MODULES) $(PREPROCESSED_TTCN3_MODULES) $(ASN1_MODULES)
184 $(TTCN3_COMPILER) $(COMPILER_FLAGS) $^ - $?
185 touch $@
186
187clean distclean:
188 -$(RM) $(TARGET) $(OBJECTS) $(GENERATED_HEADERS) \
189 $(GENERATED_SOURCES) $(PREPROCESSED_TTCN3_MODULES) compile \
190 tags *.log $(DEPFILES) \
191 www_example*.ttcn UsefulTtcn3Types.ttcn XSD.ttcn
192
193dep: $(GENERATED_SOURCES) $(USER_SOURCES) $(DEPFILES);
194
195ifeq (,$(findstring n,$(MAKEFLAGS)))
196ifeq (,$(findstring clean,$(MAKECMDGOALS)))
197ifeq (,$(findstring preprocess,$(MAKECMDGOALS)))
198-include $(DEPFILES)
199endif
200endif
201endif
202
203
204#
205# Add your rules here if necessary...
206#
207
208RUN := $(shell which colortitan 2>/dev/null)
209ifeq ($(firstword $(RUN)),no)
210# stupid /bin/which on Solaris writes errors to stdout instead of stderr
211RUN :=
212endif
213
214run: $(TARGET) config.cfg
215 $(RUN) ./$^
216
217
218# # # # # # # # # # # # # # #
219#
220# xsd2ttcn *.xsd renames the various PurchaseOrder types
221# to prevent name clashes. To avoid this, compile each xsd separately.
222#
223UsefulTtcn3Types.ttcn XSD.ttcn www_example_com_POUAQ.ttcn:: po_qual_atr.xsd
224 $(TTCN3_DIR)/bin/xsd2ttcn -z $<
225
226UsefulTtcn3Types.ttcn XSD.ttcn www_example_com_POQAQ.ttcn:: po_qual_both.xsd
227 $(TTCN3_DIR)/bin/xsd2ttcn -z $<
228
229UsefulTtcn3Types.ttcn XSD.ttcn www_example_com_POU.ttcn:: po_unqual.xsd
230 $(TTCN3_DIR)/bin/xsd2ttcn -z $<
231
232UsefulTtcn3Types.ttcn XSD.ttcn www_example_com_POQ.ttcn:: po_qual.xsd
233 $(TTCN3_DIR)/bin/xsd2ttcn -z $<
234
235UsefulTtcn3Types.ttcn XSD.ttcn www_example_org_all.ttcn:: globall.xsd
236 $(TTCN3_DIR)/bin/xsd2ttcn -z $<
237
This page took 0.035462 seconds and 5 git commands to generate.