4c7456be9a37797fb663b1f9fb970ac4777437bd
[deliverable/titan.core.git] / regression_test / transparent / 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 # Raduly, Csaba
12 #
13 ##############################################################################
14 TOPDIR := ..
15 include ../Makefile.regression
16
17 # WARNING! This Makefile can be used with GNU make only.
18 # Other versions of make may report syntax errors in it.
19
20 #
21 # Do NOT touch this line...
22 #
23 .PHONY: all archive check clean dep objects
24
25 .SUFFIXES: .d
26
27 #
28 # Set these variables...
29 #
30
31 # Flags for the C++ preprocessor (and makedepend as well):
32 #CPPFLAGS +=
33
34 # Flags for dependency generation
35 CXXDEPFLAGS = -MM
36
37 # Flags for the C++ compiler:
38 #CXXFLAGS +=
39
40 # Flags for the linker:
41 #LDFLAGS +=
42
43 # Flags for the TTCN-3 and ASN.1 compiler:
44 #COMPILER_FLAGS +=
45
46 #
47 # This test requires location info (when checking the generated log file).
48 # Add -L to COMPILER_FLAGS, *unless* it's already present in COMPILER_FLAGS
49 # or TTCN3_COMPILER: the compiler doesn't like it if a flag is set more than once.
50 #
51 ifeq ($(findstring L, $(COMPILER_FLAGS)),)
52 ifeq ($(findstring -L, $(TTCN3_COMPILER)),)
53 COMPILER_FLAGS += -L
54 endif
55 endif
56
57 # Execution mode: (either ttcn3 or ttcn3-parallel)
58 TTCN3_LIB = ttcn3$(RT2_SUFFIX)$(DYNAMIC_SUFFIX)
59
60 #
61 # You may change these variables. Add your files if necessary...
62 #
63
64 # TTCN-3 modules of this project:
65 TTCN3_MODULES = transparent.ttcn
66
67 # ASN.1 modules of this project:
68 ASN1_MODULES =
69
70 # C++ source & header files generated from the TTCN-3 & ASN.1 modules of
71 # this project:
72 GENERATED_SOURCES = $(TTCN3_MODULES:.ttcn=.cc) $(ASN1_MODULES:.asn=.cc)
73 GENERATED_HEADERS = $(GENERATED_SOURCES:.cc=.hh)
74
75 # C/C++ Source & header files of Test Ports, external functions and
76 # other modules:
77 USER_SOURCES =
78 USER_HEADERS = $(USER_SOURCES:.cc=.hh)
79
80 # Object files of this project that are needed for the executable test suite:
81 OBJECTS = $(GENERATED_OBJECTS) $(USER_OBJECTS)
82
83 GENERATED_OBJECTS = $(GENERATED_SOURCES:.cc=.o)
84
85 USER_OBJECTS = $(USER_SOURCES:.cc=.o)
86
87 DEPFILES = $(USER_OBJECTS:.o=.d) $(GENERATED_OBJECTS:.o=.d)
88
89 # Other files of the project (Makefile, configuration files, etc.)
90 # that will be added to the archived source files:
91 OTHER_FILES = Makefile
92
93 # The name of the executable test suite:
94 TARGET = transparent
95
96 #
97 # Rules for building the executable...
98 #
99
100 all: $(TARGET) ;
101
102 objects: $(OBJECTS) compile;
103
104 $(TARGET): $(OBJECTS)
105 if $(CXX) $(LDFLAGS) -o $@ $^ \
106 -L$(TTCN3_DIR)/lib -l$(TTCN3_LIB) \
107 -L$(OPENSSL_DIR)/lib -lcrypto \
108 -L$(XMLDIR)/lib $($(PLATFORM)_LIBS); \
109 then : ; else $(TTCN3_DIR)/bin/titanver $(OBJECTS); exit 1; fi
110
111 .cc.o .c.o:
112 $(CXX) -c $(CPPFLAGS) $(CXXFLAGS) -o $@ $<
113
114 .cc.d .c.d:
115 @echo Creating dependency file for '$<'; set -e; \
116 $(CXX) $(CXXDEPFLAGS) $(CPPFLAGS) $(CXXFLAGS) $< \
117 | sed 's/\($*\)\.o[ :]*/\1.o $@ : /g' > $@; \
118 [ -s $@ ] || rm -f $@
119
120 $(GENERATED_SOURCES) $(GENERATED_HEADERS): compile
121 @if [ ! -f $@ ]; then $(RM) compile; $(MAKE) compile; fi
122
123 compile: $(TTCN3_MODULES) $(ASN1_MODULES)
124 $(TTCN3_COMPILER) $(COMPILER_FLAGS) $^ - $?
125 touch $@
126
127 clean:
128 -$(RM) $(TARGET) $(OBJECTS) $(GENERATED_HEADERS) \
129 $(GENERATED_SOURCES) compile $(DEPFILES) \
130 tags *.log
131
132 distclean: clean
133 -$(RM) $(DEPFILES)
134
135 dep: $(GENERATED_SOURCES) $(USER_SOURCES) ;
136
137 ifeq ($(findstring n,$(MAKEFLAGS)),)
138 ifeq ($(filter clean distclean check compile archive diag,$(MAKECMDGOALS)),)
139 -include $(DEPFILES)
140 endif
141 endif
142
143 diag:
144 $(TTCN3_DIR)/bin/compiler -v 2>&1
145 $(TTCN3_DIR)/bin/mctr_cli -v 2>&1
146 $(CXX) -v 2>&1
147 @echo TTCN3_DIR=$(TTCN3_DIR)
148 @echo OPENSSL_DIR=$(OPENSSL_DIR)
149 @echo XMLDIR=$(XMLDIR)
150 @echo PLATFORM=$(PLATFORM)
151
152 run: $(TARGET) run.cfg
153 ./$^
154 # the setverdict line should contain the testcase as the location
155 grep '(testcase:comp) setverdict' $(TARGET:.exe=).log
156
This page took 0.035034 seconds and 4 git commands to generate.