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