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 # WARNING! This Makefile can be used with GNU make only.
23 # Other versions of make may report syntax errors in it.
26 # Do NOT touch this line...
28 .PHONY
: all archive
check clean distclean dep objects preprocess
33 # Set these variables...
36 # C preprocessor used for TTCN-3 files:
39 # Flags for the C++ preprocessor (and makedepend as well):
42 # Flags for dependency generation
45 # Flags for preprocessing TTCN-3 files:
48 # Flags for the C++ compiler:
51 # Flags for the linker:
54 ifeq ($(PLATFORM
), WIN32
)
55 # Silence linker warnings.
56 LDFLAGS
+= -Wl
,--enable-auto-import
,--enable-runtime-pseudo-reloc
59 # Flags for the TTCN-3 and ASN.1 compiler:
60 COMPILER_FLAGS
+= -brx
61 COMPILER_FLAGS
:= $(sort $(COMPILER_FLAGS
))
62 # $(sort ) removes duplicates
64 # Execution mode: (either ttcn3 or ttcn3-parallel)
65 TTCN3_LIB
:= ttcn3
$(RT2_SUFFIX
)$(DYNAMIC_SUFFIX
)
68 # You may change these variables. Add your files if necessary...
71 # TTCN-3 modules of this project:
72 TTCN3_MODULES
:= UsefulTtcn3Types.ttcn XSD.ttcn \
73 www_example_com_POQ.ttcn www_example_com_POU.ttcn \
74 www_example_com_POQAQ.ttcn www_example_com_POUAQ.ttcn \
75 converter.ttcn www_example_org_all.ttcn
77 vpath
%.
cc $(TOP_SRC
)/iconv
78 vpath
%.ttcn
$(TOP_SRC
)/iconv
79 vpath
%.xsd
$(ABS_SRC
)
81 # TTCN-3 modules to preprocess:
82 TTCN3_PP_MODULES
= POtest.ttcnpp
84 # Files to include in TTCN-3 preprocessed modules:
85 TTCN3_INCLUDES
= $(TOP_SRC
)/XML
/macros.ttcnin
87 # ASN.1 modules of this project:
90 # TTCN-3 source files generated by the C preprocessor:
91 PREPROCESSED_TTCN3_MODULES
= $(notdir $(TTCN3_PP_MODULES
:.ttcnpp
=.ttcn
))
93 # C++ source & header files generated from the TTCN-3 & ASN.1 modules of
95 GENERATED_SOURCES
:= $(TTCN3_MODULES
:.ttcn
=.
cc) $(TTCN3_PP_MODULES
:.ttcnpp
=.
cc) $(ASN1_MODULES
:.asn
=.
cc)
96 GENERATED_HEADERS
:= $(GENERATED_SOURCES
:.
cc=.hh
)
98 GENERATED_SOURCES
:= $(foreach file
, $(GENERATED_SOURCES
:.
cc=), $(addprefix $(file
), .
cc _seq.
cc _set.
cc _seqof.
cc _setof.
cc _union.
cc))
101 # C/C++ Source & header files of Test Ports, external functions and
103 USER_SOURCES
= iconver.
cc
104 USER_HEADERS
= $(USER_SOURCES
:.
cc=.hh
)
106 # Object files of this project that are needed for the executable test suite:
107 OBJECTS
= $(GENERATED_SOURCES
:.
cc=.o
) $(USER_SOURCES
:.
cc=.o
)
109 DEPFILES
= $(OBJECTS
:.o
=.d
)
111 # Other files of the project (Makefile, configuration files, etc.)
112 # that will be added to the archived source files:
113 OTHER_FILES
= po_qual_default.xml po_qual_explicit.xml po_unqual.xml \
114 po_qual.xsd po_qual_atr.xsd po_qual_both.xsd po_unqual.xsd \
117 # The name of the executable test suite:
118 TARGET
= POtest
$(EXESUFFIX
)
121 # Do not modify these unless you know what you are doing...
122 # Platform specific additional libraries:
124 SOLARIS_LIBS
= -lsocket
-lnsl
-lxml2
-lresolv
125 SOLARIS8_LIBS
= -lsocket
-lnsl
-lxml2
-lresolv
126 LINUX_LIBS
= -lxml2
-lpthread
-lrt
127 FREEBSD_LIBS
= -lxml2
-liconv
128 WIN32_LIBS
= -lxml2
-liconv
131 # Rules for building the executable...
136 shared_objects
: $(SHARED_OBJECTS
) ;
138 objects
: $(OBJECTS
) ;
140 ifeq ($(findstring dynamic
,$(TTCN3_LIB
)),)
142 CORELIB_BINARY
:= $(TTCN3_DIR
)/lib
/lib
$(TTCN3_LIB
).a
144 CORELIB_BINARY
:= $(TTCN3_DIR
)/lib
/lib
$(TTCN3_LIB
).so
147 $(TARGET
): $(OBJECTS
) $(CORELIB_BINARY
)
148 $(CXX
) $(LDFLAGS
) -o
$@
$(OBJECTS
) \
149 -L
$(TTCN3_DIR
)/lib
-l
$(TTCN3_LIB
) \
150 -L
$(OPENSSL_DIR
)/lib
-lcrypto \
151 -L
$(XMLDIR
)/lib
$($(PLATFORM
)_LIBS
) \
152 ||
$(TTCN3_DIR
)/bin
/titanver
$(OBJECTS
)
155 $(CXX
) -c
$(CPPFLAGS
) $(CXXFLAGS
) -o
$@
$<
158 @echo Creating dependency file for
'$<'; set
-e
; \
159 $(CXX
) $(CXXDEPFLAGS
) $(CPPFLAGS
) $(CXXFLAGS
) $< \
160 | sed
's/\($*\)\.o[ :]*/\1.o $@ : /g' > $@
; \
161 [ -s
$@
] ||
rm -f
$@
163 %.ttcn
: %.ttcnpp
$(TTCN3_INCLUDES
)
164 $(CPP
) -x c
-nostdinc
$(CPPFLAGS_TTCN3
) $< $@
166 preprocess
: $(PREPROCESSED_TTCN3_MODULES
) ;
168 $(GENERATED_SOURCES
) $(GENERATED_HEADERS
): compile
169 @if
[ ! -f
$@
]; then
$(RM
) compile
; $(MAKE
) compile
; fi
171 check: $(TTCN3_MODULES
) $(PREPROCESSED_TTCN3_MODULES
) $(ASN1_MODULES
)
172 $(TTCN3_COMPILER
) -s
$(COMPILER_FLAGS
) $^
174 compile
:: $(firstword $(TTCN3_COMPILER
))
175 @if
[ -f
$@
]; then
$(RM
) compile
; $(MAKE
) compile
; fi
177 compile
:: $(TTCN3_MODULES
) $(PREPROCESSED_TTCN3_MODULES
) $(ASN1_MODULES
)
178 $(TTCN3_COMPILER
) $(COMPILER_FLAGS
) $^
- $?
182 -$(RM
) $(TARGET
) $(OBJECTS
) $(GENERATED_HEADERS
) \
183 $(GENERATED_SOURCES
) $(PREPROCESSED_TTCN3_MODULES
) compile \
184 tags *.log
$(DEPFILES
) \
185 www_example
*.ttcn UsefulTtcn3Types.ttcn XSD.ttcn
187 dep
: $(GENERATED_SOURCES
) $(USER_SOURCES
) $(DEPFILES
);
189 ifeq (,$(findstring n
,$(MAKEFLAGS
)))
190 ifeq (,$(findstring clean,$(MAKECMDGOALS
)))
191 ifeq (,$(findstring preprocess
,$(MAKECMDGOALS
)))
199 # Add your rules here if necessary...
202 RUN
:= $(shell which colortitan
2>/dev
/null
)
203 ifeq ($(firstword $(RUN
)),no
)
204 # stupid /bin/which on Solaris writes errors to stdout instead of stderr
208 run
: $(TARGET
) config.cfg
212 # # # # # # # # # # # # # # #
214 # xsd2ttcn *.xsd renames the various PurchaseOrder types
215 # to prevent name clashes. To avoid this, compile each xsd separately.
217 UsefulTtcn3Types.ttcn XSD.ttcn www_example_com_POUAQ.ttcn
:: po_qual_atr.xsd
218 $(TTCN3_DIR
)/bin
/xsd2ttcn
-z
$<
220 UsefulTtcn3Types.ttcn XSD.ttcn www_example_com_POQAQ.ttcn
:: po_qual_both.xsd
221 $(TTCN3_DIR
)/bin
/xsd2ttcn
-z
$<
223 UsefulTtcn3Types.ttcn XSD.ttcn www_example_com_POU.ttcn
:: po_unqual.xsd
224 $(TTCN3_DIR
)/bin
/xsd2ttcn
-z
$<
226 UsefulTtcn3Types.ttcn XSD.ttcn www_example_com_POQ.ttcn
:: po_qual.xsd
227 $(TTCN3_DIR
)/bin
/xsd2ttcn
-z
$<
229 UsefulTtcn3Types.ttcn XSD.ttcn www_example_org_all.ttcn
:: globall.xsd
230 $(TTCN3_DIR
)/bin
/xsd2ttcn
-z
$<