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