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