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
18 ##############################################################################
20 include ..
/Makefile.regression
22 # WARNING! This Makefile can be used with GNU make only.
23 # Other versions of make may report syntax errors in it.
26 # Do NOT touch this line...
28 .PHONY
: all archive
check clean distclean dep objects
33 # Set these variables...
37 # Flags for the C++ preprocessor (and makedepend as well):
38 #CPPFLAGS := -I. $(CPPFLAGS)
40 # Flags for dependency generation
43 # Flags for the C++ compiler:
46 # Flags for the linker:
49 ifeq ($(PLATFORM
), WIN32
)
50 # Silence linker warnings.
51 LDFLAGS
+= -Wl
,--enable-auto-import
,--enable-runtime-pseudo-reloc
54 # Flags for the TTCN-3 and ASN.1 compiler:
55 COMPILER_FLAGS
+= -L
$(RT2_FLAG
)
56 # sort removes duplicates
57 COMPILER_FLAGS
:= $(sort $(COMPILER_FLAGS
))
59 # Execution mode: (either ttcn3 or ttcn3-parallel)
60 TTCN3_LIB
= ttcn3
$(RT2_SUFFIX
)$(DYNAMIC_SUFFIX
)
63 # You may change these variables. Add your files if necessary...
66 # TTCN-3 modules of this project:
67 COMPILE_TIME_TTCN
:= $(wildcard $(ABS_SRC
)/*_SW.ttcn
)
68 RUN_TIME_TTCN
:= $(wildcard $(ABS_SRC
)/*_OK.ttcn
)
69 # The naming convention is not exactly obvious; _SW stands for semantic warnings
70 # *_SW.ttcn are the compile-time tests which have lots (1000+) warnings of type
71 # "Control never reaches this code because of previous effective condition(s)"
73 # *_OK.ttcn are the runtime tests. Ideally, they would be warning-free :)
74 # But at least there should be no "Control never reaches ..." warnings.
75 TTCN3_MODULES
:= $(COMPILE_TIME_TTCN
) $(RUN_TIME_TTCN
)
77 # ASN.1 modules of this project:
80 # C++ source & header files generated by TTCN-3 & ASN.1 compilers:
81 GENERATED_SOURCES
:= $(notdir $(TTCN3_MODULES
:.ttcn
=.
cc))
82 GENERATED_HEADERS
:= $(notdir $(TTCN3_MODULES
:.ttcn
=.hh
))
84 GENERATED_SOURCES
:= $(foreach file
, $(GENERATED_SOURCES
:.
cc=), $(addprefix $(file
), .
cc _seq.
cc _set.
cc _seqof.
cc _setof.
cc _union.
cc))
87 # Source & header files of Test Ports and your other modules:
89 USER_HEADERS
= $(USER_SOURCES
:.
cc=.hh
)
91 # Object files of this project that are needed for the executable test suite:
92 OBJECTS
= $(GENERATED_OBJECTS
) $(USER_OBJECTS
)
94 GENERATED_OBJECTS
= $(GENERATED_SOURCES
:.
cc=.o
)
96 USER_OBJECTS
= $(USER_SOURCES
:.
cc=.o
)
98 DEPFILES
= $(USER_OBJECTS
:.o
=.d
) $(GENERATED_OBJECTS
:.o
=.d
)
100 # Other files of the project (Makefile, configuration files, etc.)
101 # that will be added to the archived source files:
102 OTHER_FILES
= Makefile
104 # The name of the executable test suite:
105 TARGET
:= PreDef
$(EXESUFFIX
)
108 # Rules for building the executable...
112 objects
: $(OBJECTS
) ;
114 $(TARGET
): $(OBJECTS
)
115 $(CXX
) $(LDFLAGS
) -o
$@
$^ \
116 -L
$(TTCN3_DIR
)/lib
-l
$(TTCN3_LIB
) \
117 -L
$(OPENSSL_DIR
)/lib
-lcrypto \
118 -L
$(XMLDIR
)/lib
$($(PLATFORM
)_LIBS
) \
119 ||
$(TTCN3_DIR
)/bin
/titanver
$(OBJECTS
)
122 $(CXX
) -c
$(CPPFLAGS
) $(CXXFLAGS
) -o
$@
$<
125 @echo Creating dependency file for
'$<'; set
-e
; \
126 $(CXX
) $(CXXDEPFLAGS
) $(CPPFLAGS
) $(CXXFLAGS
) $< \
127 | sed
's/\($*\)\.o[ :]*/\1.o $@ : /g' > $@
; \
128 [ -s
$@
] ||
rm -f
$@
130 $(GENERATED_SOURCES
) $(GENERATED_HEADERS
): compile
131 @if
[ ! -f
$@
]; then
$(RM
) compile
; $(MAKE
) compile
; fi
133 compile
: $(TTCN3_MODULES
) $(ASN1_MODULES
)
134 $(TOP_SRC
)/..
/function_test
/Semantic_Analyser
/cw.pl
$(COMPILER_FLAGS
) $^
- $?
138 -$(RM
) $(TARGET
) $(OBJECTS
) $(GENERATED_HEADERS
) \
139 $(GENERATED_SOURCES
) compile
$(DEPFILES
) \
145 dep
: $(GENERATED_SOURCES
) $(USER_SOURCES
) ;
147 ifeq ($(findstring n
,$(MAKEFLAGS
)),)
148 ifeq ($(filter clean distclean check compile archive diag
,$(MAKECMDGOALS
)),)
155 $(TTCN3_DIR
)/bin
/compiler
-v
2>&1
156 $(TTCN3_DIR
)/bin
/mctr_cli
-v
2>&1
158 @echo TTCN3_DIR
=$(TTCN3_DIR
)
159 @echo OPENSSL_DIR
=$(OPENSSL_DIR
)
160 @echo XMLDIR
=$(XMLDIR
)
161 @echo PLATFORM
=$(PLATFORM
)
164 # Add your rules here if necessary...
166 run
: $(TARGET
) PreDef.cfg
171 mycompiler
$(COMPILER_FLAGS
) $^