implemented new code splitting mechanism (split to equal slices)
[deliverable/titan.core.git] / regression_test / XML / HN15589 / 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# Raduly, Csaba
14e21cff 12# Szabo, Bence Janos
d44e3c4f 13#
14##############################################################################
970ed795
EL
15TOPDIR := ../..
16include ../../Makefile.regression
17
18ORIG ?= .
19
20CPP := cpp
21
22# Flags for the C++ preprocessor (and makedepend as well):
23#CPPFLAGS +=
24
25# Flags for preprocessing TTCN-3 files:
26#CPPFLAGS_TTCN3 +=
27
28# Flags for the C++ compiler:
29CXXFLAGS += -g -fmessage-length=0
30
31# Flags for the linker:
32LDFLAGS += -g
33
34WIN32_LIBS += -liconv
35INTERIX_LIBS += -L/usr/local/lib -liconv
36FREEBSD_LIBS += -liconv
37
38# Local flags for Titan (can be overridden from the environment or commandline)
39TTCNFLAGS := -b -r -x
40
41# Flags for the TTCN-3 and ASN.1 compiler
42# (common flags already set in Makefile.regression)
43COMPILER_FLAGS += $(TTCNFLAGS) -a
44
45# $(sort ) also eliminates duplicates
46COMPILER_FLAGS := $(sort $(COMPILER_FLAGS))
47
48# Execution mode: (either ttcn3 or ttcn3-parallel)
49TTCN3_LIB := ttcn3$(RT2_SUFFIX)$(DYNAMIC_SUFFIX)
50
51##
52##
53
54# TTCN-3 modules of this project:
55TTCN3_MODULES = converter.ttcn $(wildcard $(ORIG)/xtd*.ttcn)
56# UTF8.ttcn
57
58# TTCN-3 modules to preprocess:
59TTCN3_PP_MODULES := $(wildcard $(ORIG)/*.ttcnpp)
60
61
62# Files to include in TTCN-3 preprocessed modules:
63TTCN3_INCLUDES = ../macros.ttcnin
64
65# TTCN-3 source files generated by the C preprocessor:
66PREPROCESSED_TTCN3_MODULES := $(notdir $(TTCN3_PP_MODULES:.ttcnpp=.ttcn))
67
68
69# C++ source & header files generated from the TTCN-3 & ASN.1 modules of
70# this project:
71GENERATED_SOURCES := $(TTCN3_MODULES:.ttcn=.cc) $(PREPROCESSED_TTCN3_MODULES:.ttcn=.cc) $(ASN1_MODULES:.asn=.cc)
72GENERATED_HEADERS := $(GENERATED_SOURCES:.cc=.hh)
73ifdef CODE_SPLIT
74GENERATED_SOURCES := $(foreach file, $(GENERATED_SOURCES:.cc=), $(addprefix $(file), .cc _seq.cc _set.cc _seqof.cc _setof.cc _union.cc))
14e21cff 75else ifdef SPLIT_TO_SLICES
76POSTFIXES := $(foreach file, $(SPLIT_TO_SLICES), $(addsuffix $(file), _part_))
77POSTFIXES := $(foreach file, $(POSTFIXES), $(addprefix $(file), .cc))
78GENERATED_SOURCES2 := $(foreach file, $(GENERATED_SOURCES:.cc=), $(addprefix $(file), $(POSTFIXES)))
79GENERATED_SOURCES += $(GENERATED_SOURCES2)
970ed795
EL
80endif
81
82# C/C++ Source & header files of Test Ports, external functions and
83# other modules:
84USER_SOURCES := iconver.cc
85USER_HEADERS := $(USER_SOURCES:.cc=.hh)
86
87# Object files of this project that are needed for the executable test suite:
88OBJECTS := $(GENERATED_SOURCES:.cc=.o) $(USER_SOURCES:.cc=.o)
89
90# The name of the executable test suite:
91TARGET := HN15589$(RT2_SUFFIX)$(EXESUFFIX)
92
93#
94# Rules for building the executable...
95#
96
97all: $(TARGET)
98
99objects: $(OBJECTS) ;
100
101ifeq ($(findstring dynamic,$(TTCN3_LIB)),)
102# not dynamic
103CORELIB_BINARY := $(TTCN3_DIR)/lib/lib$(TTCN3_LIB).a
104else
105CORELIB_BINARY := $(TTCN3_DIR)/lib/lib$(TTCN3_LIB).so
106endif
107
108# libttcn3.a appears twice; this should be harmless
109$(TARGET): $(OBJECTS) $(CORELIB_BINARY)
110 $(CXX) $(LDFLAGS) -o $@ $(OBJECTS) \
111 -L$(TTCN3_DIR)/lib -l$(TTCN3_LIB) \
112 -L$(OPENSSL_DIR)/lib -lcrypto $($(PLATFORM)_LIBS) \
113 || $(TTCN3_DIR)/bin/titanver $(OBJECTS)
114
115%.o: %.cc
116 @echo '(C++)' $<; $(CXX) -c $(CPPFLAGS) $(CXXFLAGS) $<
117
118%.d: %.cc
119 @echo '(dep)' $<; $(CXX) -MM -MP $(CPPFLAGS) $(CXXFLAGS) $< >$@
120
121# The preprocessing step
122%.ttcn: %.ttcnpp $(TTCN3_INCLUDES)
123 $(CPP) -x c -nostdinc $(CPPFLAGS_TTCN3) $< $@
124
125preprocess: $(PREPROCESSED_TTCN3_MODULES) ;
126
127$(GENERATED_SOURCES) $(GENERATED_HEADERS): compile
128 @if [ ! -f $@ ]; then $(RM) compile; $(MAKE) compile; fi
129
130check: $(TTCN3_MODULES) $(PREPROCESSED_TTCN3_MODULES) $(ASN1_MODULES)
131 $(TTCN3_COMPILER) -s $(COMPILER_FLAGS) $^
132
133compile:: $(firstword $(TTCN3_COMPILER))
134 @if [ -f $@ ]; then $(RM) compile; $(MAKE) compile; fi
135# if [ -f $(GENERATED_SOURCES) ]; then rm -f $(GENERATED_SOURCES); $(MAKE) $(GENERATED_SOURCES); fi
136
137compile:: $(TTCN3_MODULES) $(PREPROCESSED_TTCN3_MODULES) $(ASN1_MODULES)
138# "modulepar boolean verbose" makes this unusable with old names
139 $(TTCN3_COMPILER) $(COMPILER_FLAGS) $^ - $?
140 touch $@
141
142clean celan clena:
143 -$(RM) $(TARGET) $(OBJECTS) $(GENERATED_HEADERS) \
144 $(GENERATED_SOURCES) $(PREPROCESSED_TTCN3_MODULES) compile \
145 tags *.log
146
147distclean: clean
148 -$(RM) $(DEPFILES)
149
150#
151# Add your rules here if necessary...
152#
153
154.SUFFIXES: .asn .ttcn .ttcnpp
155
156RUN := $(shell which colortitan 2>/dev/null)
157ifeq ($(firstword $(RUN)),no)
158# stupid /bin/which on Solaris writes errors to stdout instead of stderr
159RUN :=
160endif
161
162XMLLINT := $(shell which xmllint 2>/dev/null)
163ifeq ($(firstword $(XMLLINT)),no)
164# stupid /bin/which on Solaris writes errors to stdout instead of stderr
165XMLLINT :=
166endif
167
168run: $(TARGET) config.cfg
169 $(RUN) ./$^
170ifneq ($(XMLLINT),) # xmllint found in path
171 perl log2xml.pl $(TARGET:.exe=).log > result.xml
172 xmllint --schema flipflop-check.xsd result.xml
173endif
174 $(RUN) ./$< xtdp.cfg
175ifneq ($(XMLLINT),) # xmllint found in path
176 perl log2xml.pl $(TARGET:.exe=).log > xresult.xml
177 xmllint --schema xsd/XTDP-Message.xsd xresult.xml
178endif
179
180debug:
181 $(MAKE) run RUN='gdb --args'
182
183vpath %.cc $(TOP_SRC)/iconv
184vpath %.ttcn $(TOP_SRC)/iconv
185
186
187dep: ;
188
189DEPFILES := $(OBJECTS:.o=.d)
190
191ifeq (,$(findstring n,$(MAKEFLAGS)))
192ifeq (,$(filter clean distclean,$(MAKECMDGOALS)))
193-include $(DEPFILES)
194endif
195endif
196
This page took 0.030826 seconds and 5 git commands to generate.