1 ###############################################################################
2 # Copyright (c) 2000-2015 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 ###############################################################################
9 include ..
/..
/Makefile.regression
15 # WARNING! This Makefile can be used with GNU make only.
16 # Other versions of make may report syntax errors in it.
19 # Do NOT touch this line...
21 .PHONY
: all archive
check clean distclean dep objects preprocess
26 # Set these variables...
29 # C preprocessor used for TTCN-3 files:
32 # Flags for the C++ preprocessor (and makedepend as well):
35 # Flags for dependency generation
38 # Flags for preprocessing TTCN-3 files:
41 # Flags for the C++ compiler:
44 # Flags for the linker:
47 ifeq ($(PLATFORM
), WIN32
)
48 # Silence linker warnings.
49 LDFLAGS
+= -Wl
,--enable-auto-import
,--enable-runtime-pseudo-reloc
52 # Flags for the TTCN-3 and ASN.1 compiler:
53 COMPILER_FLAGS
+= -brx
54 COMPILER_FLAGS
:= $(sort $(COMPILER_FLAGS
))
55 # $(sort ) removes duplicates
57 # Execution mode: (either ttcn3 or ttcn3-parallel)
58 TTCN3_LIB
:= ttcn3
$(RT2_SUFFIX
)$(DYNAMIC_SUFFIX
)
61 # You may change these variables. Add your files if necessary...
64 # TTCN-3 modules of this project:
65 TTCN3_MODULES
:= UsefulTtcn3Types.ttcn XSD.ttcn \
66 www_example_com_POQ.ttcn www_example_com_POU.ttcn \
67 www_example_com_POQAQ.ttcn www_example_com_POUAQ.ttcn \
68 converter.ttcn www_example_org_all.ttcn
70 vpath
%.
cc $(TOP_SRC
)/iconv
71 vpath
%.ttcn
$(TOP_SRC
)/iconv
72 vpath
%.xsd
$(ABS_SRC
)
74 # TTCN-3 modules to preprocess:
75 TTCN3_PP_MODULES
= POtest.ttcnpp
77 # Files to include in TTCN-3 preprocessed modules:
78 TTCN3_INCLUDES
= $(TOP_SRC
)/XML
/macros.ttcnin
80 # ASN.1 modules of this project:
83 # TTCN-3 source files generated by the C preprocessor:
84 PREPROCESSED_TTCN3_MODULES
= $(notdir $(TTCN3_PP_MODULES
:.ttcnpp
=.ttcn
))
86 # C++ source & header files generated from the TTCN-3 & ASN.1 modules of
88 GENERATED_SOURCES
:= $(TTCN3_MODULES
:.ttcn
=.
cc) $(TTCN3_PP_MODULES
:.ttcnpp
=.
cc) $(ASN1_MODULES
:.asn
=.
cc)
89 GENERATED_HEADERS
:= $(GENERATED_SOURCES
:.
cc=.hh
)
91 GENERATED_SOURCES
:= $(foreach file
, $(GENERATED_SOURCES
:.
cc=), $(addprefix $(file
), .
cc _seq.
cc _set.
cc _seqof.
cc _setof.
cc _union.
cc))
94 # C/C++ Source & header files of Test Ports, external functions and
96 USER_SOURCES
= iconver.
cc
97 USER_HEADERS
= $(USER_SOURCES
:.
cc=.hh
)
99 # Object files of this project that are needed for the executable test suite:
100 OBJECTS
= $(GENERATED_SOURCES
:.
cc=.o
) $(USER_SOURCES
:.
cc=.o
)
102 DEPFILES
= $(OBJECTS
:.o
=.d
)
104 # Other files of the project (Makefile, configuration files, etc.)
105 # that will be added to the archived source files:
106 OTHER_FILES
= po_qual_default.xml po_qual_explicit.xml po_unqual.xml \
107 po_qual.xsd po_qual_atr.xsd po_qual_both.xsd po_unqual.xsd \
110 # The name of the executable test suite:
111 TARGET
= POtest
$(EXESUFFIX
)
114 # Do not modify these unless you know what you are doing...
115 # Platform specific additional libraries:
117 SOLARIS_LIBS
= -lsocket
-lnsl
-lxml2
-lresolv
118 SOLARIS8_LIBS
= -lsocket
-lnsl
-lxml2
-lresolv
119 LINUX_LIBS
= -lxml2
-lpthread
-lrt
120 FREEBSD_LIBS
= -lxml2
-liconv
121 WIN32_LIBS
= -lxml2
-liconv
124 # Rules for building the executable...
129 shared_objects
: $(SHARED_OBJECTS
) ;
131 objects
: $(OBJECTS
) ;
133 ifeq ($(findstring dynamic
,$(TTCN3_LIB
)),)
135 CORELIB_BINARY
:= $(TTCN3_DIR
)/lib
/lib
$(TTCN3_LIB
).a
137 CORELIB_BINARY
:= $(TTCN3_DIR
)/lib
/lib
$(TTCN3_LIB
).so
140 $(TARGET
): $(OBJECTS
) $(CORELIB_BINARY
)
141 $(CXX
) $(LDFLAGS
) -o
$@
$(OBJECTS
) \
142 -L
$(TTCN3_DIR
)/lib
-l
$(TTCN3_LIB
) \
143 -L
$(OPENSSL_DIR
)/lib
-lcrypto \
144 -L
$(XMLDIR
)/lib
$($(PLATFORM
)_LIBS
) \
145 ||
$(TTCN3_DIR
)/bin
/titanver
$(OBJECTS
)
148 $(CXX
) -c
$(CPPFLAGS
) $(CXXFLAGS
) -o
$@
$<
151 @echo Creating dependency file for
'$<'; set
-e
; \
152 $(CXX
) $(CXXDEPFLAGS
) $(CPPFLAGS
) $(CXXFLAGS
) $< \
153 | sed
's/\($*\)\.o[ :]*/\1.o $@ : /g' > $@
; \
154 [ -s
$@
] ||
rm -f
$@
156 %.ttcn
: %.ttcnpp
$(TTCN3_INCLUDES
)
157 $(CPP
) -x c
-nostdinc
$(CPPFLAGS_TTCN3
) $< $@
159 preprocess
: $(PREPROCESSED_TTCN3_MODULES
) ;
161 $(GENERATED_SOURCES
) $(GENERATED_HEADERS
): compile
162 @if
[ ! -f
$@
]; then
$(RM
) compile
; $(MAKE
) compile
; fi
164 check: $(TTCN3_MODULES
) $(PREPROCESSED_TTCN3_MODULES
) $(ASN1_MODULES
)
165 $(TTCN3_COMPILER
) -s
$(COMPILER_FLAGS
) $^
167 compile
:: $(firstword $(TTCN3_COMPILER
))
168 @if
[ -f
$@
]; then
$(RM
) compile
; $(MAKE
) compile
; fi
170 compile
:: $(TTCN3_MODULES
) $(PREPROCESSED_TTCN3_MODULES
) $(ASN1_MODULES
)
171 $(TTCN3_COMPILER
) $(COMPILER_FLAGS
) $^
- $?
175 -$(RM
) $(TARGET
) $(OBJECTS
) $(GENERATED_HEADERS
) \
176 $(GENERATED_SOURCES
) $(PREPROCESSED_TTCN3_MODULES
) compile \
177 tags *.log
$(DEPFILES
) \
178 www_example
*.ttcn UsefulTtcn3Types.ttcn XSD.ttcn
180 dep
: $(GENERATED_SOURCES
) $(USER_SOURCES
) $(DEPFILES
);
182 ifeq (,$(findstring n
,$(MAKEFLAGS
)))
183 ifeq (,$(findstring clean,$(MAKECMDGOALS
)))
184 ifeq (,$(findstring preprocess
,$(MAKECMDGOALS
)))
192 # Add your rules here if necessary...
195 RUN
:= $(shell which colortitan
2>/dev
/null
)
196 ifeq ($(firstword $(RUN
)),no
)
197 # stupid /bin/which on Solaris writes errors to stdout instead of stderr
201 run
: $(TARGET
) config.cfg
205 # # # # # # # # # # # # # # #
207 # xsd2ttcn *.xsd renames the various PurchaseOrder types
208 # to prevent name clashes. To avoid this, compile each xsd separately.
210 UsefulTtcn3Types.ttcn XSD.ttcn www_example_com_POUAQ.ttcn
:: po_qual_atr.xsd
211 $(TTCN3_DIR
)/bin
/xsd2ttcn
-z
$<
213 UsefulTtcn3Types.ttcn XSD.ttcn www_example_com_POQAQ.ttcn
:: po_qual_both.xsd
214 $(TTCN3_DIR
)/bin
/xsd2ttcn
-z
$<
216 UsefulTtcn3Types.ttcn XSD.ttcn www_example_com_POU.ttcn
:: po_unqual.xsd
217 $(TTCN3_DIR
)/bin
/xsd2ttcn
-z
$<
219 UsefulTtcn3Types.ttcn XSD.ttcn www_example_com_POQ.ttcn
:: po_qual.xsd
220 $(TTCN3_DIR
)/bin
/xsd2ttcn
-z
$<
222 UsefulTtcn3Types.ttcn XSD.ttcn www_example_org_all.ttcn
:: globall.xsd
223 $(TTCN3_DIR
)/bin
/xsd2ttcn
-z
$<