1 ###############################################################################
2 # Copyright (c) 2000-2014 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
11 # WARNING! This Makefile can be used with GNU make only.
12 # Other versions of make may report syntax errors in it.
15 # Do NOT touch this line...
17 .PHONY
: all archive
check clean distclean dep objects
22 # Set these variables...
26 # Flags for the C++ preprocessor (and makedepend as well):
27 #CPPFLAGS := -I. $(CPPFLAGS)
29 # Flags for dependency generation
32 # Flags for the C++ compiler:
35 # Flags for the linker:
38 ifeq ($(PLATFORM
), WIN32
)
39 # Silence linker warnings.
40 LDFLAGS
+= -Wl
,--enable-auto-import
,--enable-runtime-pseudo-reloc
43 # Flags for the TTCN-3 and ASN.1 compiler:
44 COMPILER_FLAGS
+= -L
$(RT2_FLAG
)
45 # sort removes duplicates
46 COMPILER_FLAGS
:= $(sort $(COMPILER_FLAGS
))
48 # Execution mode: (either ttcn3 or ttcn3-parallel)
49 TTCN3_LIB
= ttcn3
$(RT2_SUFFIX
)$(DYNAMIC_SUFFIX
)
52 # You may change these variables. Add your files if necessary...
55 # TTCN-3 modules of this project:
56 COMPILE_TIME_TTCN
:= $(wildcard $(ABS_SRC
)/*_SW.ttcn
)
57 RUN_TIME_TTCN
:= $(wildcard $(ABS_SRC
)/*_OK.ttcn
)
58 # The naming convention is not exactly obvious; _SW stands for semantic warnings
59 # *_SW.ttcn are the compile-time tests which have lots (1000+) warnings of type
60 # "Control never reaches this code because of previous effective condition(s)"
62 # *_OK.ttcn are the runtime tests. Ideally, they would be warning-free :)
63 # But at least there should be no "Control never reaches ..." warnings.
64 TTCN3_MODULES
:= $(COMPILE_TIME_TTCN
) $(RUN_TIME_TTCN
)
66 # ASN.1 modules of this project:
69 # C++ source & header files generated by TTCN-3 & ASN.1 compilers:
70 GENERATED_SOURCES
:= $(notdir $(TTCN3_MODULES
:.ttcn
=.
cc))
71 GENERATED_HEADERS
:= $(notdir $(TTCN3_MODULES
:.ttcn
=.hh
))
73 GENERATED_SOURCES
:= $(foreach file
, $(GENERATED_SOURCES
:.
cc=), $(addprefix $(file
), .
cc _seq.
cc _set.
cc _seqof.
cc _setof.
cc _union.
cc))
76 # Source & header files of Test Ports and your other modules:
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:
94 TARGET
:= PreDef
$(EXESUFFIX
)
97 # Rules for building the executable...
101 objects
: $(OBJECTS
) ;
103 $(TARGET
): $(OBJECTS
)
104 $(CXX
) $(LDFLAGS
) -o
$@
$^ \
105 -L
$(TTCN3_DIR
)/lib
-l
$(TTCN3_LIB
) \
106 -L
$(OPENSSL_DIR
)/lib
-lcrypto \
107 -L
$(XMLDIR
)/lib
$($(PLATFORM
)_LIBS
) \
108 ||
$(TTCN3_DIR
)/bin
/titanver
$(OBJECTS
)
111 $(CXX
) -c
$(CPPFLAGS
) $(CXXFLAGS
) -o
$@
$<
114 @echo Creating dependency file for
'$<'; set
-e
; \
115 $(CXX
) $(CXXDEPFLAGS
) $(CPPFLAGS
) $(CXXFLAGS
) $< \
116 | sed
's/\($*\)\.o[ :]*/\1.o $@ : /g' > $@
; \
117 [ -s
$@
] ||
rm -f
$@
119 $(GENERATED_SOURCES
) $(GENERATED_HEADERS
): compile
120 @if
[ ! -f
$@
]; then
$(RM
) compile
; $(MAKE
) compile
; fi
122 compile
: $(TTCN3_MODULES
) $(ASN1_MODULES
)
123 $(TOP_SRC
)/..
/function_test
/Semantic_Analyser
/cw.pl
$(COMPILER_FLAGS
) $^
- $?
127 -$(RM
) $(TARGET
) $(OBJECTS
) $(GENERATED_HEADERS
) \
128 $(GENERATED_SOURCES
) compile
$(DEPFILES
) \
134 dep
: $(GENERATED_SOURCES
) $(USER_SOURCES
) ;
136 ifeq ($(findstring n
,$(MAKEFLAGS
)),)
137 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
)
153 # Add your rules here if necessary...
155 run
: $(TARGET
) PreDef.cfg
160 mycompiler
$(COMPILER_FLAGS
) $^