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
14 #$(warning yes SRC=$(SRCDIR))
15 ORIGSRC
:= $(TOP_SRC
)/XML
/XER
23 # WARNING! This Makefile can be used with GNU make only.
24 # Other versions of make may report syntax errors in it.
27 # Do NOT touch this line...
29 .PHONY
: all check clean dep objects preprocess
32 # Set these variables...
36 # Flags for the C++ preprocessor (and makedepend as well):
39 # Flags for preprocessing TTCN-3 files:
42 # Flags for the C++ compiler:
43 CXXFLAGS
+= -g
-W
-Wformat
=2
45 # Flags for the linker:
49 FREEBSD_LIBS
+= -liconv
51 # Local flags for Titan (can be overridden from the environment or commandline)
54 # Flags for the TTCN-3 and ASN.1 compiler
55 # (common flags already set in Makefile.regression)
56 COMPILER_FLAGS
+= $(TTCNFLAGS
) -a
58 # $(sort ) also eliminates duplicates
59 COMPILER_FLAGS
:= $(sort $(COMPILER_FLAGS
))
61 # Execution mode: (either ttcn3 or ttcn3-parallel)
62 TTCN3_LIB
:= ttcn3
$(RT2_SUFFIX
)$(DYNAMIC_SUFFIX
)
65 # You may change these variables. Add your files if necessary...
68 # TTCN-3 modules of this project:
69 TTCN3_MODULES
:= $(TOP_SRC
)/iconv
/converter.ttcn UTF8.ttcn
71 # TTCN-3 modules to preprocess:
72 TTCN3_PP_MODULES
:= $(wildcard $(ORIGSRC
)/*.ttcnpp
)
75 # Files to include in TTCN-3 preprocessed modules:
76 TTCN3_INCLUDES
:= $(TOP_SRC
)/XML
/macros.ttcnin
78 # ASN.1 modules of this project:
79 ASN1_MODULES
:= Asntypes.asn AsnValues.asn EmptyUnion.asn \
80 Sets.asn SetValues.asn ObjectClass.asn ObjectClassWithSyntax.asn
82 # TTCN-3 source files generated by the C preprocessor:
83 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
:= $(notdir $(TTCN3_MODULES
:.ttcn
=.
cc) $(PREPROCESSED_TTCN3_MODULES
:.ttcn
=.
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
:= Flatten.
cc 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 # The name of the executable test suite:
103 TARGET
:= Xertest
$(RT2_SUFFIX
)$(EXESUFFIX
)
107 # Rules for building the executable...
113 objects
: $(OBJECTS
) ;
115 ifeq ($(findstring dynamic
,$(TTCN3_LIB
)),)
117 CORELIB_BINARY
:= $(TTCN3_DIR
)/lib
/lib
$(TTCN3_LIB
).a
119 CORELIB_BINARY
:= $(TTCN3_DIR
)/lib
/lib
$(TTCN3_LIB
).so
122 # libttcn3.a appears twice; this should be harmless
123 $(TARGET
): $(OBJECTS
) $(CORELIB_BINARY
)
124 $(CXX
) $(LDFLAGS
) -o
$@
$(OBJECTS
) \
125 -L
$(TTCN3_DIR
)/lib
-l
$(TTCN3_LIB
) \
126 -L
$(OPENSSL_DIR
)/lib
-lcrypto
$($(PLATFORM
)_LIBS
) \
127 ||
$(TTCN3_DIR
)/bin
/titanver
$(OBJECTS
)
130 @echo
'(C++)' $<; $(CXX
) -c
$(CPPFLAGS
) $(CXXFLAGS
) $<
133 @echo
'(dep)' $<; $(CXX
) -MM
-MP
$(CPPFLAGS
) $(CXXFLAGS
) $< >$@
136 # The preprocessing step
137 %.ttcn
: %.ttcnpp
$(TTCN3_INCLUDES
)
138 $(CPP
) -x c
-nostdinc
$(CPPFLAGS_TTCN3
) $< $@
140 preprocess
: $(PREPROCESSED_TTCN3_MODULES
) ;
142 $(GENERATED_SOURCES
) $(GENERATED_HEADERS
): compile
143 @if
[ ! -f
$@
]; then
$(RM
) compile
; $(MAKE
) compile
; fi
146 compile
:: $(firstword $(TTCN3_COMPILER
))
147 @if
[ -f
$@
]; then
$(RM
) compile
; $(MAKE
) compile
; fi
148 # if [ -f $(GENERATED_SOURCES) ]; then rm -f $(GENERATED_SOURCES); $(MAKE) $(GENERATED_SOURCES); fi
150 compile
:: $(TTCN3_MODULES
) $(PREPROCESSED_TTCN3_MODULES
) $(ASN1_MODULES
)
151 $(TTCN3_COMPILER
) $(COMPILER_FLAGS
) -c
$^
$(ORIG
)/junk.ttcn3
2>&1 |
$(ORIG
)/checkit.pl
152 $(TTCN3_COMPILER
) $(COMPILER_FLAGS
) $^
- $?
156 -$(RM
) $(TARGET
) $(OBJECTS
) $(GENERATED_HEADERS
) \
157 $(GENERATED_SOURCES
) $(PREPROCESSED_TTCN3_MODULES
) compile \
164 # Add your rules here if necessary...
167 .SUFFIXES
: .asn .ttcn .ttcnpp
169 RUN
:= $(shell which colortitan
2>/dev
/null
)
170 ifeq ($(firstword $(RUN
)),no
)
171 # stupid /bin/which on Solaris writes errors to stdout instead of stderr
175 run
: $(TARGET
) config.cfg
176 .
/$(TARGET
) -v
2>&1 |
$(ORIG
)/checkit.pl
180 $(MAKE
) run RUN
='gdb --args'
185 xertest
: xertest.o ..
/..
/core
/libttcn3.a
191 @echo You cannot be serious
!
195 vpath iconver.
cc $(TOP_SRC
)/iconv
196 vpath
%.ttcn
$(TOP_SRC
)/iconv
:$(TOP_SRC
)/XML
/TTCNandXML
201 DEPFILES
:= $(OBJECTS
:.o
=.d
)
203 ifeq (,$(findstring n
,$(MAKEFLAGS
)))
204 ifeq (,$(filter clean distclean preprocess
,$(MAKECMDGOALS
)))
210 $(foreach src
, $(USER_SOURCES
), $(eval vpath
$(src
) $(ABS_SRC
)))