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
14 ##############################################################################
16 include ..
/..
/Makefile.regression
22 # Flags for the C++ preprocessor (and makedepend as well):
25 # Flags for preprocessing TTCN-3 files:
28 # Flags for the C++ compiler:
29 CXXFLAGS
+= -g
-fmessage-length
=0
31 # Flags for the linker:
35 INTERIX_LIBS
+= -L
/usr
/local
/lib
-liconv
36 FREEBSD_LIBS
+= -liconv
38 # Local flags for Titan (can be overridden from the environment or commandline)
41 # Flags for the TTCN-3 and ASN.1 compiler
42 # (common flags already set in Makefile.regression)
43 COMPILER_FLAGS
+= $(TTCNFLAGS
) -a
45 # $(sort ) also eliminates duplicates
46 COMPILER_FLAGS
:= $(sort $(COMPILER_FLAGS
))
48 # Execution mode: (either ttcn3 or ttcn3-parallel)
49 TTCN3_LIB
:= ttcn3
$(RT2_SUFFIX
)$(DYNAMIC_SUFFIX
)
54 # TTCN-3 modules of this project:
55 TTCN3_MODULES
= converter.ttcn
$(wildcard $(ORIG
)/xtd
*.ttcn
)
58 # TTCN-3 modules to preprocess:
59 TTCN3_PP_MODULES
:= $(wildcard $(ORIG
)/*.ttcnpp
)
62 # Files to include in TTCN-3 preprocessed modules:
63 TTCN3_INCLUDES
= ..
/macros.ttcnin
65 # TTCN-3 source files generated by the C preprocessor:
66 PREPROCESSED_TTCN3_MODULES
:= $(notdir $(TTCN3_PP_MODULES
:.ttcnpp
=.ttcn
))
69 # C++ source & header files generated from the TTCN-3 & ASN.1 modules of
71 GENERATED_SOURCES
:= $(TTCN3_MODULES
:.ttcn
=.
cc) $(PREPROCESSED_TTCN3_MODULES
:.ttcn
=.
cc) $(ASN1_MODULES
:.asn
=.
cc)
72 GENERATED_HEADERS
:= $(GENERATED_SOURCES
:.
cc=.hh
)
74 GENERATED_SOURCES
:= $(foreach file
, $(GENERATED_SOURCES
:.
cc=), $(addprefix $(file
), .
cc _seq.
cc _set.
cc _seqof.
cc _setof.
cc _union.
cc))
75 else ifdef SPLIT_TO_SLICES
76 POSTFIXES
:= $(foreach file
, $(SPLIT_TO_SLICES
), $(addsuffix $(file
), _part_
))
77 POSTFIXES
:= $(foreach file
, $(POSTFIXES
), $(addprefix $(file
), .
cc))
78 GENERATED_SOURCES2
:= $(foreach file
, $(GENERATED_SOURCES
:.
cc=), $(addprefix $(file
), $(POSTFIXES
)))
79 GENERATED_SOURCES
+= $(GENERATED_SOURCES2
)
82 # C/C++ Source & header files of Test Ports, external functions and
84 USER_SOURCES
:= iconver.
cc
85 USER_HEADERS
:= $(USER_SOURCES
:.
cc=.hh
)
87 # Object files of this project that are needed for the executable test suite:
88 OBJECTS
:= $(GENERATED_SOURCES
:.
cc=.o
) $(USER_SOURCES
:.
cc=.o
)
90 # The name of the executable test suite:
91 TARGET
:= HN15589
$(RT2_SUFFIX
)$(EXESUFFIX
)
94 # Rules for building the executable...
101 ifeq ($(findstring dynamic
,$(TTCN3_LIB
)),)
103 CORELIB_BINARY
:= $(TTCN3_DIR
)/lib
/lib
$(TTCN3_LIB
).a
105 CORELIB_BINARY
:= $(TTCN3_DIR
)/lib
/lib
$(TTCN3_LIB
).so
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
)
116 @echo
'(C++)' $<; $(CXX
) -c
$(CPPFLAGS
) $(CXXFLAGS
) $<
119 @echo
'(dep)' $<; $(CXX
) -MM
-MP
$(CPPFLAGS
) $(CXXFLAGS
) $< >$@
121 # The preprocessing step
122 %.ttcn
: %.ttcnpp
$(TTCN3_INCLUDES
)
123 $(CPP
) -x c
-nostdinc
$(CPPFLAGS_TTCN3
) $< $@
125 preprocess
: $(PREPROCESSED_TTCN3_MODULES
) ;
127 $(GENERATED_SOURCES
) $(GENERATED_HEADERS
): compile
128 @if
[ ! -f
$@
]; then
$(RM
) compile
; $(MAKE
) compile
; fi
130 check: $(TTCN3_MODULES
) $(PREPROCESSED_TTCN3_MODULES
) $(ASN1_MODULES
)
131 $(TTCN3_COMPILER
) -s
$(COMPILER_FLAGS
) $^
133 compile
:: $(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
137 compile
:: $(TTCN3_MODULES
) $(PREPROCESSED_TTCN3_MODULES
) $(ASN1_MODULES
)
138 # "modulepar boolean verbose" makes this unusable with old names
139 $(TTCN3_COMPILER
) $(COMPILER_FLAGS
) $^
- $?
143 -$(RM
) $(TARGET
) $(OBJECTS
) $(GENERATED_HEADERS
) \
144 $(GENERATED_SOURCES
) $(PREPROCESSED_TTCN3_MODULES
) compile \
151 # Add your rules here if necessary...
154 .SUFFIXES
: .asn .ttcn .ttcnpp
156 RUN
:= $(shell which colortitan
2>/dev
/null
)
157 ifeq ($(firstword $(RUN
)),no
)
158 # stupid /bin/which on Solaris writes errors to stdout instead of stderr
162 XMLLINT
:= $(shell which xmllint
2>/dev
/null
)
163 ifeq ($(firstword $(XMLLINT
)),no
)
164 # stupid /bin/which on Solaris writes errors to stdout instead of stderr
168 run
: $(TARGET
) config.cfg
170 ifneq ($(XMLLINT
),) # xmllint found in path
171 perl log2xml.pl
$(TARGET
:.exe
=).log
> result.xml
172 xmllint
--schema flipflop-check.xsd result.xml
175 ifneq ($(XMLLINT
),) # xmllint found in path
176 perl log2xml.pl
$(TARGET
:.exe
=).log
> xresult.xml
177 xmllint
--schema xsd
/XTDP-Message.xsd xresult.xml
181 $(MAKE
) run RUN
='gdb --args'
183 vpath
%.
cc $(TOP_SRC
)/iconv
184 vpath
%.ttcn
$(TOP_SRC
)/iconv
189 DEPFILES
:= $(OBJECTS
:.o
=.d
)
191 ifeq (,$(findstring n
,$(MAKEFLAGS
)))
192 ifeq (,$(filter clean distclean,$(MAKECMDGOALS
)))