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