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