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
13 ##############################################################################
15 include ..
/..
/Makefile.regression
21 # Flags for the C++ preprocessor (and makedepend as well):
24 # Flags for preprocessing TTCN-3 files:
27 # Flags for the C++ compiler:
28 CXXFLAGS
+= -g
-fmessage-length
=0
30 # Flags for the linker:
34 INTERIX_LIBS
+= -L
/usr
/local
/lib
-liconv
35 FREEBSD_LIBS
+= -liconv
37 # Local flags for Titan (can be overridden from the environment or commandline)
40 # Flags for the TTCN-3 and ASN.1 compiler
41 # (common flags already set in Makefile.regression)
42 COMPILER_FLAGS
+= $(TTCNFLAGS
) -a
44 # $(sort ) also eliminates duplicates
45 COMPILER_FLAGS
:= $(sort $(COMPILER_FLAGS
))
47 # Execution mode: (either ttcn3 or ttcn3-parallel)
48 TTCN3_LIB
:= ttcn3
$(RT2_SUFFIX
)$(DYNAMIC_SUFFIX
)
53 # TTCN-3 modules of this project:
54 TTCN3_MODULES
= converter.ttcn
$(wildcard $(ORIG
)/xtd
*.ttcn
)
57 # TTCN-3 modules to preprocess:
58 TTCN3_PP_MODULES
:= $(wildcard $(ORIG
)/*.ttcnpp
)
61 # Files to include in TTCN-3 preprocessed modules:
62 TTCN3_INCLUDES
= ..
/macros.ttcnin
64 # TTCN-3 source files generated by the C preprocessor:
65 PREPROCESSED_TTCN3_MODULES
:= $(notdir $(TTCN3_PP_MODULES
:.ttcnpp
=.ttcn
))
68 # C++ source & header files generated from the TTCN-3 & ASN.1 modules of
70 GENERATED_SOURCES
:= $(TTCN3_MODULES
:.ttcn
=.
cc) $(PREPROCESSED_TTCN3_MODULES
:.ttcn
=.
cc) $(ASN1_MODULES
:.asn
=.
cc)
71 GENERATED_HEADERS
:= $(GENERATED_SOURCES
:.
cc=.hh
)
73 GENERATED_SOURCES
:= $(foreach file
, $(GENERATED_SOURCES
:.
cc=), $(addprefix $(file
), .
cc _seq.
cc _set.
cc _seqof.
cc _setof.
cc _union.
cc))
76 # C/C++ Source & header files of Test Ports, external functions and
78 USER_SOURCES
:= iconver.
cc
79 USER_HEADERS
:= $(USER_SOURCES
:.
cc=.hh
)
81 # Object files of this project that are needed for the executable test suite:
82 OBJECTS
:= $(GENERATED_SOURCES
:.
cc=.o
) $(USER_SOURCES
:.
cc=.o
)
84 # The name of the executable test suite:
85 TARGET
:= HN15589
$(RT2_SUFFIX
)$(EXESUFFIX
)
88 # Rules for building the executable...
95 ifeq ($(findstring dynamic
,$(TTCN3_LIB
)),)
97 CORELIB_BINARY
:= $(TTCN3_DIR
)/lib
/lib
$(TTCN3_LIB
).a
99 CORELIB_BINARY
:= $(TTCN3_DIR
)/lib
/lib
$(TTCN3_LIB
).so
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
)
110 @echo
'(C++)' $<; $(CXX
) -c
$(CPPFLAGS
) $(CXXFLAGS
) $<
113 @echo
'(dep)' $<; $(CXX
) -MM
-MP
$(CPPFLAGS
) $(CXXFLAGS
) $< >$@
115 # The preprocessing step
116 %.ttcn
: %.ttcnpp
$(TTCN3_INCLUDES
)
117 $(CPP
) -x c
-nostdinc
$(CPPFLAGS_TTCN3
) $< $@
119 preprocess
: $(PREPROCESSED_TTCN3_MODULES
) ;
121 $(GENERATED_SOURCES
) $(GENERATED_HEADERS
): compile
122 @if
[ ! -f
$@
]; then
$(RM
) compile
; $(MAKE
) compile
; fi
124 check: $(TTCN3_MODULES
) $(PREPROCESSED_TTCN3_MODULES
) $(ASN1_MODULES
)
125 $(TTCN3_COMPILER
) -s
$(COMPILER_FLAGS
) $^
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
131 compile
:: $(TTCN3_MODULES
) $(PREPROCESSED_TTCN3_MODULES
) $(ASN1_MODULES
)
132 # "modulepar boolean verbose" makes this unusable with old names
133 $(TTCN3_COMPILER
) $(COMPILER_FLAGS
) $^
- $?
137 -$(RM
) $(TARGET
) $(OBJECTS
) $(GENERATED_HEADERS
) \
138 $(GENERATED_SOURCES
) $(PREPROCESSED_TTCN3_MODULES
) compile \
145 # Add your rules here if necessary...
148 .SUFFIXES
: .asn .ttcn .ttcnpp
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
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
162 run
: $(TARGET
) config.cfg
164 ifneq ($(XMLLINT
),) # xmllint found in path
165 perl log2xml.pl
$(TARGET
:.exe
=).log
> result.xml
166 xmllint
--schema flipflop-check.xsd result.xml
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
175 $(MAKE
) run RUN
='gdb --args'
177 vpath
%.
cc $(TOP_SRC
)/iconv
178 vpath
%.ttcn
$(TOP_SRC
)/iconv
183 DEPFILES
:= $(OBJECTS
:.o
=.d
)
185 ifeq (,$(findstring n
,$(MAKEFLAGS
)))
186 ifeq (,$(filter clean distclean,$(MAKECMDGOALS
)))