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