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
15 ##############################################################################
17 include ..
/Makefile.regression
19 # WARNING! This Makefile can be used with GNU make only.
20 # Other versions of make may report syntax errors in it.
23 # Do NOT touch this line...
25 .PHONY
: all archive
check clean dep objects
30 # Set these variables...
33 # Flags for the C++ preprocessor (and makedepend as well):
36 # Flags for dependency generation
39 # Flags for the C++ compiler:
42 # Flags for the linker:
43 #LDFLAGS += -g -rdynamic
46 # Flags for the TTCN-3 and ASN.1 compiler:
49 # Execution mode: (either ttcn3 or ttcn3-parallel)
50 TTCN3_LIB
= ttcn3
$(RT2_SUFFIX
)$(DYNAMIC_SUFFIX
)
53 # You may change these variables. Add your files if necessary...
56 # TTCN-3 modules of this project:
57 TTCN3_MODULES
= tcdefparam.ttcn
59 # ASN.1 modules of this project:
62 # C++ source & header files generated from the TTCN-3 & ASN.1 modules of
64 GENERATED_SOURCES
= $(TTCN3_MODULES
:.ttcn
=.
cc) $(ASN1_MODULES
:.asn
=.
cc)
65 GENERATED_HEADERS
= $(GENERATED_SOURCES
:.
cc=.hh
)
67 POSTFIXES
:= $(foreach file
, $(SPLIT_TO_SLICES
), $(addsuffix $(file
), _part_
))
68 POSTFIXES
:= $(foreach file
, $(POSTFIXES
), $(addprefix $(file
), .
cc))
69 GENERATED_SOURCES2
:= $(foreach file
, $(GENERATED_SOURCES
:.
cc=), $(addprefix $(file
), $(POSTFIXES
)))
70 GENERATED_SOURCES
+= $(GENERATED_SOURCES2
)
72 # C/C++ Source & header files of Test Ports, external functions and
75 USER_HEADERS
= $(USER_SOURCES
:.
cc=.hh
)
77 # Object files of this project that are needed for the executable test suite:
78 OBJECTS
= $(GENERATED_OBJECTS
) $(USER_OBJECTS
)
80 GENERATED_OBJECTS
= $(GENERATED_SOURCES
:.
cc=.o
)
82 USER_OBJECTS
= $(USER_SOURCES
:.
cc=.o
)
84 DEPFILES
= $(USER_OBJECTS
:.o
=.d
) $(GENERATED_OBJECTS
:.o
=.d
)
86 # Other files of the project (Makefile, configuration files, etc.)
87 # that will be added to the archived source files:
88 OTHER_FILES
= config.cfg Makefile
90 # The name of the executable test suite:
94 # Rules for building the executable...
99 objects
: $(OBJECTS
) compile
;
101 $(TARGET
): $(OBJECTS
)
102 if
$(CXX
) $(LDFLAGS
) -o
$@
$^ \
103 -L
$(TTCN3_DIR
)/lib
-l
$(TTCN3_LIB
) \
104 -L
$(OPENSSL_DIR
)/lib
-lcrypto \
105 -L
$(XMLDIR
)/lib
$($(PLATFORM
)_LIBS
); \
106 then
: ; else $(TTCN3_DIR
)/bin
/titanver
$(OBJECTS
); exit
1; fi
109 $(CXX
) -c
$(CPPFLAGS
) $(CXXFLAGS
) -o
$@
$<
112 @echo Creating dependency file for
'$<'; set
-e
; \
113 $(CXX
) $(CXXDEPFLAGS
) $(CPPFLAGS
) $(CXXFLAGS
) $< \
114 | sed
's/\($*\)\.o[ :]*/\1.o $@ : /g' > $@
; \
115 [ -s
$@
] ||
rm -f
$@
117 $(GENERATED_SOURCES
) $(GENERATED_HEADERS
): compile
118 @if
[ ! -f
$@
]; then
$(RM
) compile
; $(MAKE
) compile
; fi
120 compile
: $(TTCN3_MODULES
) $(ASN1_MODULES
)
121 $(TTCN3_COMPILER
) $(COMPILER_FLAGS
) $^
- $?
125 -$(RM
) $(TARGET
) $(OBJECTS
) $(GENERATED_HEADERS
) \
126 $(GENERATED_SOURCES
) compile
$(DEPFILES
) \
132 dep
: $(GENERATED_SOURCES
) $(USER_SOURCES
) ;
134 ifeq ($(findstring n
,$(MAKEFLAGS
)),)
135 ifeq ($(filter clean distclean check compile archive diag
,$(MAKECMDGOALS
)),)
141 $(TTCN3_DIR
)/bin
/compiler
-v
2>&1
142 $(TTCN3_DIR
)/bin
/mctr_cli
-v
2>&1
144 @echo TTCN3_DIR
=$(TTCN3_DIR
)
145 @echo OPENSSL_DIR
=$(OPENSSL_DIR
)
146 @echo XMLDIR
=$(XMLDIR
)
147 @echo PLATFORM
=$(PLATFORM
)
149 # If using -dynamic runtime, the following may be needed:
150 # LD_LIBRARY_PATH=${TTCN3_DIR}/lib:${LD_LIBRARY_PATH}
151 run
: $(TARGET
) config.cfg
153 # Run each testcase from the command line (but not the control part)
154 for t in
`./${TARGET} -l | egrep '^[^ ]*\.[^ ]*' | grep -vw control` ; do .
/$^
$$t; done