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
18 # WARNING! This Makefile can be used with GNU make only.
19 # Other versions of make may report syntax errors in it.
22 # Do NOT touch this line...
24 .PHONY
: all archive
check clean dep objects
28 # Flags for the C++ preprocessor (and makedepend as well):
31 # Flags for dependency generation
34 # Flags for the C++ compiler:
37 # Flags for the linker:
40 # Flags for the TTCN-3 and ASN.1 compiler:
43 # Execution mode: (either ttcn3 or ttcn3-parallel)
44 TTCN3_LIB
= ttcn3
$(RT2_SUFFIX
)$(DYNAMIC_SUFFIX
)
47 # You may change these variables. Add your files if necessary...
50 # TTCN-3 modules of this project:
51 TTCN3_MODULES
= gtpctest.ttcn GTPv2_Types.ttcn General_Types.ttcn
53 # ASN.1 modules of this project:
56 # C++ source & header files generated from the TTCN-3 & ASN.1 modules of
58 GENERATED_SOURCES
= $(TTCN3_MODULES
:.ttcn
=.
cc) $(ASN1_MODULES
:.asn
=.
cc)
59 GENERATED_HEADERS
= $(GENERATED_SOURCES
:.
cc=.hh
)
61 POSTFIXES
:= $(foreach file
, $(SPLIT_TO_SLICES
), $(addsuffix $(file
), _part_
))
62 POSTFIXES
:= $(foreach file
, $(POSTFIXES
), $(addprefix $(file
), .
cc))
63 GENERATED_SOURCES2
:= $(foreach file
, $(GENERATED_SOURCES
:.
cc=), $(addprefix $(file
), $(POSTFIXES
)))
64 GENERATED_SOURCES
+= $(GENERATED_SOURCES2
)
66 # C/C++ Source & header files of Test Ports, external functions and
69 USER_HEADERS
= $(USER_SOURCES
:.
cc=.hh
)
71 # Object files of this project that are needed for the executable test suite:
72 OBJECTS
= $(GENERATED_OBJECTS
) $(USER_OBJECTS
)
74 GENERATED_OBJECTS
= $(GENERATED_SOURCES
:.
cc=.o
)
76 USER_OBJECTS
= $(USER_SOURCES
:.
cc=.o
)
78 DEPFILES
= $(USER_OBJECTS
:.o
=.d
) $(GENERATED_OBJECTS
:.o
=.d
)
80 # Other files of the project (Makefile, configuration files, etc.)
81 # that will be added to the archived source files:
82 OTHER_FILES
= Makefile
84 # The name of the executable test suite:
85 TARGET
= gtpctest
$(EXESUFFIX
)
89 # Rules for building the executable...
94 objects
: $(OBJECTS
) compile
;
97 if
$(CXX
) $(LDFLAGS
) -o
$@
$^ \
98 -L
$(TTCN3_DIR
)/lib
-l
$(TTCN3_LIB
) \
99 -L
$(OPENSSL_DIR
)/lib
-lcrypto \
100 -L
$(XMLDIR
)/lib
$($(PLATFORM
)_LIBS
); \
101 then
: ; else $(TTCN3_DIR
)/bin
/titanver
$(OBJECTS
); exit
1; fi
104 $(CXX
) -c
$(CPPFLAGS
) $(CXXFLAGS
) -o
$@
$<
107 @echo Creating dependency file for
'$<'; set
-e
; \
108 $(CXX
) $(CXXDEPFLAGS
) $(CPPFLAGS
) $(CXXFLAGS
) $< \
109 | sed
's/\($*\)\.o[ :]*/\1.o $@ : /g' > $@
; \
110 [ -s
$@
] ||
rm -f
$@
112 $(GENERATED_SOURCES
) $(GENERATED_HEADERS
): compile
113 @if
[ ! -f
$@
]; then
$(RM
) compile
; $(MAKE
) compile
; fi
115 compile
: $(TTCN3_MODULES
) $(ASN1_MODULES
)
116 $(TTCN3_COMPILER
) $(COMPILER_FLAGS
) $^
- $?
120 -$(RM
) $(TARGET
) $(OBJECTS
) $(GENERATED_HEADERS
) \
121 $(GENERATED_SOURCES
) compile
$(DEPFILES
) \
124 dep
: $(GENERATED_SOURCES
) $(USER_SOURCES
) ;
126 ifeq ($(findstring n
,$(MAKEFLAGS
)),)
127 ifeq ($(filter clean distclean check compile archive diag
,$(MAKECMDGOALS
)),)
133 $(TTCN3_DIR
)/bin
/compiler
-v
2>&1
134 $(TTCN3_DIR
)/bin
/mctr_cli
-v
2>&1
136 @echo TTCN3_DIR
=$(TTCN3_DIR
)
137 @echo OPENSSL_DIR
=$(OPENSSL_DIR
)
138 @echo XMLDIR
=$(XMLDIR
)
139 @echo PLATFORM
=$(PLATFORM
)
142 # Add your rules here if necessary...