Debian Codegraph @

regression_test/logFiles/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 # Balasko, Jeno
10 # Delic, Adam
11 # Kovacs, Ferenc
12 # Raduly, Csaba
13 # Szabo, Bence Janos
14 #
15 ##############################################################################
16 TOPDIR := ..
17 include $(TOPDIR)/Makefile.regression
18
19 .SUFFIXES: .ttcn .hh
20 .PHONY: all clean dep run
21
22 # Remove any swtches incorporated into the name of the compiler
23 # to avoid "duplicate switch" errors.
24 TTCN3_COMPILER := $(filter %compiler, $(TTCN3_COMPILER))
25
26 ifndef COMPILER_FLAGS
27 COMPILER_FLAGS :=
28 endif
29
30 # There is a testcase which requires -L (location information)
31 COMPILER_FLAGS += -L -g $(RT2_FLAG)
32
33 TTCN3_LIB = ttcn3$(RT2_SUFFIX)-parallel$(DYNAMIC_SUFFIX)
34
35 TTCN3_MODULES = LogFiles.ttcn CommonStuff.ttcn TitanLogTest.ttcn
36
37 GENERATED_SOURCES = $(TTCN3_MODULES:.ttcn=.cc)
38 GENERATED_HEADERS = $(GENERATED_SOURCES:.cc=.hh)
39
40 ifdef CODE_SPLIT
41 GENERATED_SOURCES := $(foreach file, $(GENERATED_SOURCES:.cc=), $(addprefix $(file), .cc _seq.cc _set.cc _seqof.cc _setof.cc _union.cc))
42 else ifdef SPLIT_TO_SLICES
43 COMPILER_FLAGS += $(SPLIT_FLAG)
44 POSTFIXES := $(foreach file, $(SPLIT_TO_SLICES), $(addsuffix $(file), _part_))
45 POSTFIXES := $(foreach file, $(POSTFIXES), $(addprefix $(file), .cc))
46 GENERATED_SOURCES2 := $(foreach file, $(GENERATED_SOURCES:.cc=), $(addprefix $(file), $(POSTFIXES)))
47 GENERATED_SOURCES += $(GENERATED_SOURCES2)
48 endif
49
50 USER_SOURCES := $(ABS_SRC)/extfunc.cc
51
52 OBJECTS = $(GENERATED_SOURCES:.cc=.o) $(USER_SOURCES:.cc=.o)
53
54 TARGET = LogFiles$(EXESUFFIX)
55
56 all: $(TARGET)
57
58 $(GENERATED_SOURCES) $(GENERATED_HEADERS): compile
59 @if [ ! -f $@ ]; then $(RM) compile; $(MAKE) compile; fi
60
61 ifeq ($(findstring dynamic,$(TTCN3_LIB)),)
62 # not dynamic
63 CORELIB_BINARY := $(TTCN3_DIR)/lib/lib$(TTCN3_LIB).a
64 else
65 CORELIB_BINARY := $(TTCN3_DIR)/lib/lib$(TTCN3_LIB).so
66 endif
67
68
69
70 $(TARGET): $(GENERATED_SOURCES) $(USER_SOURCES) $(CORELIB_BINARY)
71 $(CXX) $(CPPFLAGS) $(CXXFLAGS) -g $(LDFLAGS) -o $@ $(GENERATED_SOURCES) $(USER_SOURCES) -L$(TTCN3_DIR)/lib -l$(TTCN3_LIB) -L$(OPENSSL_DIR)/lib -lcrypto $($(PLATFORM)_LIBS)
72
73 compile: $(TTCN3_MODULES)
74 $(TTCN3_COMPILER) $(COMPILER_FLAGS) $^ - $?
75 touch $@
76
77 clean distclean:
78 -rm -f $(TARGET) $(OBJECTS) \
79 compile $(GENERATED_HEADERS) $(GENERATED_SOURCES) \
80 *.log baseline_logs/*.lo2 Makefile.bak
81 rm -rf new_logs
82
83 dep: $(GENERATED_SOURCES)
84 makedepend $(CPPFLAGS) $(GENERATED_SOURCES) extfunc.cc
85
86 run: $(TARGET)
87 ./logfilter.sh
88 $(TTCN3_DIR)/bin/ttcn3_start $(TARGET) LogFiles.cfg
89 $(TTCN3_DIR)/bin/ttcn3_start $(TARGET) LogFiles2.cfg
90 $(TTCN3_DIR)/bin/ttcn3_start $(TARGET) LogFilesProc.cfg
91 $(TTCN3_DIR)/bin/ttcn3_start $(TARGET) TitanLogTest.cfg
92 for l in *MTC.log *mtc.log; do grep 'pass (100\.00 %)' >/dev/null $$l || echo "!!!! $$l not 100% !!!!"; done
93 # Bangjohansen produces incomplete xml logs sometimes; delete them
94 # Check that $j exists: unmatched wildcards are returned as-is
95 if xmllint --version 2>/dev/null; then \
96 for j in junit-xml*.log; do \
97 if [ -f $$j ]; then \
98 xmllint --noout $$j || sh -xc "rm $$j"; \
99 else :; fi \
100 done; \
101 else :; fi
102 #./diffLogs new_logs/ baseline_logs/
103
104 #LogFiles.o: LogFiles.hh
105 #extfunc.o: LogFiles.hh
106
107 .NOTPARALLEL:
108
109 #ifdef SRCDIR
110 #$(foreach src, $(USER_SOURCES), $(eval vpath $(src) $(ABS_SRC)))
111 #endif
112 # vpath doesn't work with direct cc -> exe