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