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
17 # WARNING! This Makefile can be used with GNU make only.
18 # Other versions of make may report syntax errors in it.
21 # Do NOT touch this line...
23 .PHONY
: all archive
check clean dep objects
28 # Set these variables...
31 # Flags for the C++ preprocessor (and makedepend as well):
34 # Flags for dependency generation
37 # Flags for the C++ compiler:
40 # Flags for the linker:
43 # Flags for the TTCN-3 and ASN.1 compiler:
47 # This test requires location info (when checking the generated log file).
48 # Add -L to COMPILER_FLAGS, *unless* it's already present in COMPILER_FLAGS
49 # or TTCN3_COMPILER: the compiler doesn't like it if a flag is set more than once.
51 ifeq ($(findstring L
, $(COMPILER_FLAGS
)),)
52 ifeq ($(findstring -L
, $(TTCN3_COMPILER
)),)
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
= transparent.ttcn
67 # ASN.1 modules of this project:
70 # C++ source & header files generated from the TTCN-3 & ASN.1 modules of
72 GENERATED_SOURCES
= $(TTCN3_MODULES
:.ttcn
=.
cc) $(ASN1_MODULES
:.asn
=.
cc)
73 GENERATED_HEADERS
= $(GENERATED_SOURCES
:.
cc=.hh
)
75 # C/C++ Source & header files of Test Ports, external functions and
78 USER_HEADERS
= $(USER_SOURCES
:.
cc=.hh
)
80 # Object files of this project that are needed for the executable test suite:
81 OBJECTS
= $(GENERATED_OBJECTS
) $(USER_OBJECTS
)
83 GENERATED_OBJECTS
= $(GENERATED_SOURCES
:.
cc=.o
)
85 USER_OBJECTS
= $(USER_SOURCES
:.
cc=.o
)
87 DEPFILES
= $(USER_OBJECTS
:.o
=.d
) $(GENERATED_OBJECTS
:.o
=.d
)
89 # Other files of the project (Makefile, configuration files, etc.)
90 # that will be added to the archived source files:
91 OTHER_FILES
= Makefile
93 # The name of the executable test suite:
97 # Rules for building the executable...
102 objects
: $(OBJECTS
) compile
;
104 $(TARGET
): $(OBJECTS
)
105 if
$(CXX
) $(LDFLAGS
) -o
$@
$^ \
106 -L
$(TTCN3_DIR
)/lib
-l
$(TTCN3_LIB
) \
107 -L
$(OPENSSL_DIR
)/lib
-lcrypto \
108 -L
$(XMLDIR
)/lib
$($(PLATFORM
)_LIBS
); \
109 then
: ; else $(TTCN3_DIR
)/bin
/titanver
$(OBJECTS
); exit
1; fi
112 $(CXX
) -c
$(CPPFLAGS
) $(CXXFLAGS
) -o
$@
$<
115 @echo Creating dependency file for
'$<'; set
-e
; \
116 $(CXX
) $(CXXDEPFLAGS
) $(CPPFLAGS
) $(CXXFLAGS
) $< \
117 | sed
's/\($*\)\.o[ :]*/\1.o $@ : /g' > $@
; \
118 [ -s
$@
] ||
rm -f
$@
120 $(GENERATED_SOURCES
) $(GENERATED_HEADERS
): compile
121 @if
[ ! -f
$@
]; then
$(RM
) compile
; $(MAKE
) compile
; fi
123 compile
: $(TTCN3_MODULES
) $(ASN1_MODULES
)
124 $(TTCN3_COMPILER
) $(COMPILER_FLAGS
) $^
- $?
128 -$(RM
) $(TARGET
) $(OBJECTS
) $(GENERATED_HEADERS
) \
129 $(GENERATED_SOURCES
) compile
$(DEPFILES
) \
135 dep
: $(GENERATED_SOURCES
) $(USER_SOURCES
) ;
137 ifeq ($(findstring n
,$(MAKEFLAGS
)),)
138 ifeq ($(filter clean distclean check compile archive diag
,$(MAKECMDGOALS
)),)
144 $(TTCN3_DIR
)/bin
/compiler
-v
2>&1
145 $(TTCN3_DIR
)/bin
/mctr_cli
-v
2>&1
147 @echo TTCN3_DIR
=$(TTCN3_DIR
)
148 @echo OPENSSL_DIR
=$(OPENSSL_DIR
)
149 @echo XMLDIR
=$(XMLDIR
)
150 @echo PLATFORM
=$(PLATFORM
)
152 run
: $(TARGET
) run.cfg
154 # the setverdict line should contain the testcase as the location
155 grep
'(testcase:comp) setverdict' $(TARGET
:.exe
=).log