Debian Codegraph @

regression_test/EncodeDecode/RAW/issue575/Makefile

raw
1 ##############################################################################
2 # Copyright (c) 2000-2021 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 v2.0
5 # which accompanies this distribution, and is available at
6 # https://www.eclipse.org/org/documents/epl-2.0/EPL-2.0.html
7 #
8 # Contributors:
9 # Gabor, Szalai – initial implementation
10 #
11 ##############################################################################
12 TOPDIR := ../../..
13 include $(TOPDIR)/Makefile.regression
14
15 # WARNING! This Makefile can be used with GNU make only.
16 # Other versions of make may report syntax errors in it.
17
18 #
19 # Do NOT touch this line...
20 #
21 .PHONY: all archive check clean dep objects
22
23 .SUFFIXES: .d
24
25 #
26 # Set these variables...
27 #
28
29 # Flags for dependency generation
30 CXXDEPFLAGS = -MM
31
32 ifeq ($(PLATFORM), WIN32)
33 # Silence linker warnings.
34 # Overridden by Makefile.cfg
35 endif
36
37 # Flags for the TTCN-3 and ASN.1 compiler:
38 COMPILER_FLAGS +=
39
40 # Execution mode: (either ttcn3 or ttcn3-parallel)
41 TTCN3_LIB = ttcn3$(RT2_SUFFIX)$(DYNAMIC_SUFFIX)
42
43
44 #
45 # You may change these variables. Add your files if necessary...
46 #
47
48 # TTCN-3 modules of this project:
49 TTCN3_MODULES = Issue575.ttcn
50
51 # ASN.1 modules of this project:
52 ASN1_MODULES =
53
54 # C++ source & header files generated from the TTCN-3 & ASN.1 modules of
55 # this project:
56 GENERATED_SOURCES = $(TTCN3_MODULES:.ttcn=.cc) $(ASN1_MODULES:.asn=.cc)
57 GENERATED_HEADERS = $(GENERATED_SOURCES:.cc=.hh)
58 ifdef SPLIT_TO_SLICES
59 POSTFIXES := $(foreach file, $(SPLIT_TO_SLICES), $(addsuffix $(file), _part_))
60 POSTFIXES := $(foreach file, $(POSTFIXES), $(addprefix $(file), .cc))
61 GENERATED_SOURCES2 := $(foreach file, $(GENERATED_SOURCES:.cc=), $(addprefix $(file), $(POSTFIXES)))
62 GENERATED_SOURCES += $(GENERATED_SOURCES2)
63 endif
64 # C/C++ Source & header files of Test Ports, external functions and
65 # other modules:
66 USER_SOURCES =
67 USER_HEADERS = $(USER_SOURCES:.cc=.hh)
68
69 # Object files of this project that are needed for the executable test suite:
70 OBJECTS = $(GENERATED_OBJECTS) $(USER_OBJECTS)
71
72 GENERATED_OBJECTS = $(GENERATED_SOURCES:.cc=.o)
73
74 USER_OBJECTS = $(USER_SOURCES:.cc=.o)
75
76 DEPFILES = $(USER_OBJECTS:.o=.d) $(GENERATED_OBJECTS:.o=.d)
77
78
79 # The name of the executable test suite:
80 TARGET = Issue575$(EXESUFFIX)
81
82
83 # Rules for building the executable...
84 #
85
86 all: $(TARGET)
87
88 objects: $(OBJECTS) ;
89
90 $(TARGET): $(OBJECTS)
91 if $(CXX) $(LDFLAGS) -o $@ $^ \
92 -L$(TTCN3_DIR)/lib -l$(TTCN3_LIB) \
93 -L$(OPENSSL_DIR)/lib -lcrypto \
94 -L$(XMLDIR)/lib $($(PLATFORM)_LIBS); \
95 then : ; else $(TTCN3_DIR)/bin/titanver $(OBJECTS); exit 1; fi
96
97 .cc.o .c.o:
98 $(CXX) -c $(CPPFLAGS) $(CXXFLAGS) -o $@ $<
99
100 .cc.d .c.d:
101 @echo Creating dependency file for '$<'; set -e; \
102 $(CXX) $(CXXDEPFLAGS) $(CPPFLAGS) $(CXXFLAGS) $< \
103 | sed 's/\($*\)\.o[ :]*/\1.o $@ : /g' > $@; \
104 [ -s $@ ] || rm -f $@
105
106 $(GENERATED_SOURCES) $(GENERATED_HEADERS): compile
107 @if [ ! -f $@ ]; then $(RM) compile; $(MAKE) compile; fi
108
109 compile: $(TTCN3_MODULES) $(ASN1_MODULES)
110 $(TTCN3_COMPILER) $(COMPILER_FLAGS) $^ - $?
111 touch $@
112
113
114 clean:
115 -$(RM) $(TARGET) $(OBJECTS) $(GENERATED_HEADERS) \
116 $(GENERATED_SOURCES) compile $(DEPFILES) \
117 tags *.log
118
119 distclean: clean
120 -$(RM) $(DEPFILES)
121
122
123 dep: $(GENERATED_SOURCES) $(USER_SOURCES) ;
124
125 ifeq ($(findstring n,$(MAKEFLAGS)),)
126 ifeq ($(filter clean distclean check compile archive diag,$(MAKECMDGOALS)),)
127 -include $(DEPFILES)
128 endif
129 endif
130
131
132
133 diag:
134 $(TTCN3_COMPILER) -v 2>&1
135 $(TTCN3_DIR)/bin/mctr_cli -v 2>&1
136 $(CXX) -v 2>&1
137 @echo TTCN3_DIR=$(TTCN3_DIR)
138 @echo OPENSSL_DIR=$(OPENSSL_DIR)
139 @echo XMLDIR=$(XMLDIR)
140 @echo PLATFORM=$(PLATFORM)
141
142 #
143 # Add your rules here if necessary...
144 #
145
146 run: $(TARGET) ./config.cfg
147 ./$^ 2> result.txt
148 cat result.txt
149 grep "Overall verdict: pass" result.txt