527ff5a6d343a36b4a9a7c078ed73203907a2c76
[deliverable/titan.core.git] / regression_test / predefFunction / Makefile
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
7 #
8 # Contributors:
9 # Baji, Laszlo
10 # Balasko, Jeno
11 # Delic, Adam
12 # Forstner, Matyas
13 # Hanko, Matyas
14 # Kovacs, Ferenc
15 # Raduly, Csaba
16 # Szabados, Kristof
17 #
18 ##############################################################################
19 TOPDIR := ..
20 include ../Makefile.regression
21
22 # WARNING! This Makefile can be used with GNU make only.
23 # Other versions of make may report syntax errors in it.
24
25 #
26 # Do NOT touch this line...
27 #
28 .PHONY: all archive check clean distclean dep objects
29
30 .SUFFIXES: .d
31
32 #
33 # Set these variables...
34 #
35
36
37 # Flags for the C++ preprocessor (and makedepend as well):
38 #CPPFLAGS := -I. $(CPPFLAGS)
39
40 # Flags for dependency generation
41 CXXDEPFLAGS = -MM
42
43 # Flags for the C++ compiler:
44 CXXFLAGS +=
45
46 # Flags for the linker:
47 LDFLAGS +=
48
49 ifeq ($(PLATFORM), WIN32)
50 # Silence linker warnings.
51 LDFLAGS += -Wl,--enable-auto-import,--enable-runtime-pseudo-reloc
52 endif
53
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))
58
59 # Execution mode: (either ttcn3 or ttcn3-parallel)
60 TTCN3_LIB = ttcn3$(RT2_SUFFIX)$(DYNAMIC_SUFFIX)
61
62 #
63 # You may change these variables. Add your files if necessary...
64 #
65
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)"
72 #
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)
76
77 # ASN.1 modules of this project:
78 ASN1_MODULES :=
79
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))
83 ifdef CODE_SPLIT
84 GENERATED_SOURCES := $(foreach file, $(GENERATED_SOURCES:.cc=), $(addprefix $(file), .cc _seq.cc _set.cc _seqof.cc _setof.cc _union.cc))
85 endif
86
87 # Source & header files of Test Ports and your other modules:
88 USER_SOURCES =
89 USER_HEADERS = $(USER_SOURCES:.cc=.hh)
90
91 # Object files of this project that are needed for the executable test suite:
92 OBJECTS = $(GENERATED_OBJECTS) $(USER_OBJECTS)
93
94 GENERATED_OBJECTS = $(GENERATED_SOURCES:.cc=.o)
95
96 USER_OBJECTS = $(USER_SOURCES:.cc=.o)
97
98 DEPFILES = $(USER_OBJECTS:.o=.d) $(GENERATED_OBJECTS:.o=.d)
99
100 # Other files of the project (Makefile, configuration files, etc.)
101 # that will be added to the archived source files:
102 OTHER_FILES = Makefile
103
104 # The name of the executable test suite:
105 TARGET := PreDef$(EXESUFFIX)
106
107 #
108 # Rules for building the executable...
109 #
110 all: $(TARGET) ;
111
112 objects: $(OBJECTS) ;
113
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)
120
121 .cc.o .c.o:
122 $(CXX) -c $(CPPFLAGS) $(CXXFLAGS) -o $@ $<
123
124 .cc.d .c.d:
125 @echo Creating dependency file for '$<'; set -e; \
126 $(CXX) $(CXXDEPFLAGS) $(CPPFLAGS) $(CXXFLAGS) $< \
127 | sed 's/\($*\)\.o[ :]*/\1.o $@ : /g' > $@; \
128 [ -s $@ ] || rm -f $@
129
130 $(GENERATED_SOURCES) $(GENERATED_HEADERS): compile
131 @if [ ! -f $@ ]; then $(RM) compile; $(MAKE) compile; fi
132
133 compile: $(TTCN3_MODULES) $(ASN1_MODULES)
134 $(TOP_SRC)/../function_test/Semantic_Analyser/cw.pl $(COMPILER_FLAGS) $^ - $?
135 touch $@
136
137 clean:
138 -$(RM) $(TARGET) $(OBJECTS) $(GENERATED_HEADERS) \
139 $(GENERATED_SOURCES) compile $(DEPFILES) \
140 tags *.log
141
142 distclean: clean
143 -$(RM) $(DEPFILES)
144
145 dep: $(GENERATED_SOURCES) $(USER_SOURCES) ;
146
147 ifeq ($(findstring n,$(MAKEFLAGS)),)
148 ifeq ($(filter clean distclean check compile archive diag,$(MAKECMDGOALS)),)
149 -include $(DEPFILES)
150 endif
151 endif
152
153
154 diag:
155 $(TTCN3_DIR)/bin/compiler -v 2>&1
156 $(TTCN3_DIR)/bin/mctr_cli -v 2>&1
157 $(CXX) -v 2>&1
158 @echo TTCN3_DIR=$(TTCN3_DIR)
159 @echo OPENSSL_DIR=$(OPENSSL_DIR)
160 @echo XMLDIR=$(XMLDIR)
161 @echo PLATFORM=$(PLATFORM)
162
163 #
164 # Add your rules here if necessary...
165 #
166 run: $(TARGET) PreDef.cfg
167 ./$^
168
169
170 %.cc: %.ttcn
171 mycompiler $(COMPILER_FLAGS) $^
172
173 .PRECIOUS: %.cc
This page took 0.032905 seconds and 4 git commands to generate.