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 | # Kovacs, Ferenc | |
12 | # Raduly, Csaba | |
14e21cff | 13 | # Szabo, Bence Janos |
d44e3c4f | 14 | # |
15 | ############################################################################## | |
970ed795 EL |
16 | TOPDIR := .. |
17 | include ../Makefile.regression | |
18 | ||
19 | # | |
20 | # Do NOT touch this line... | |
21 | # | |
22 | .PHONY: all run archive check clean dep objects | |
23 | ||
24 | .SUFFIXES: .d | |
25 | ||
26 | # | |
27 | # Set these variables... | |
28 | # | |
29 | ||
30 | #CXXFLAGS += -save-temps | |
31 | CXXFLAGS += -g | |
32 | ||
33 | # Flags for dependency generation | |
34 | CXXDEPFLAGS = -MM | |
35 | ||
36 | #COMPILER_FLAGS += | |
37 | ||
38 | # Flags for the linker: | |
39 | LDFLAGS += -g | |
40 | ||
41 | ifeq ($(PLATFORM), WIN32) | |
42 | # Silence linker warnings. | |
43 | LDFLAGS += -Wl,--enable-auto-import,--enable-runtime-pseudo-reloc | |
44 | endif | |
45 | ||
46 | # Flags for the TTCN-3 and ASN.1 compiler: | |
47 | #COMPILER_FLAGS += -L | |
48 | ||
49 | # Execution mode: (either ttcn3 or ttcn3-parallel) | |
50 | TTCN3_LIB = ttcn3$(RT2_SUFFIX)$(DYNAMIC_SUFFIX) | |
51 | ||
52 | ||
53 | # TTCN-3 modules of this project: | |
54 | TTCN3_MODULES = slider.ttcn dual.ttcn dual2.ttcn | |
55 | ||
56 | ifdef RT2 | |
57 | TTCN3_MODULES += dualnegtest.ttcn | |
58 | RT2CFG := run-rt2.cfg | |
59 | endif | |
60 | ||
61 | # ASN.1 modules of this project: | |
62 | ASN1_MODULES = | |
63 | ||
64 | # C++ source & header files generated from the TTCN-3 & ASN.1 modules of | |
65 | # this project: | |
66 | GENERATED_SOURCES = $(TTCN3_MODULES:.ttcn=.cc) $(ASN1_MODULES:.asn=.cc) | |
67 | GENERATED_HEADERS = $(GENERATED_SOURCES:.cc=.hh) | |
14e21cff | 68 | ifdef SPLIT_TO_SLICES |
69 | POSTFIXES := $(foreach file, $(SPLIT_TO_SLICES), $(addsuffix $(file), _part_)) | |
70 | POSTFIXES := $(foreach file, $(POSTFIXES), $(addprefix $(file), .cc)) | |
71 | GENERATED_SOURCES2 := $(foreach file, $(GENERATED_SOURCES:.cc=), $(addprefix $(file), $(POSTFIXES))) | |
72 | GENERATED_SOURCES += $(GENERATED_SOURCES2) | |
73 | endif | |
970ed795 EL |
74 | # C/C++ Source & header files of Test Ports, external functions and |
75 | # other modules: | |
76 | USER_SOURCES = PT1.cc UNDER.cc | |
77 | USER_HEADERS = $(USER_SOURCES:.cc=.hh) | |
78 | ||
79 | # Object files of this project that are needed for the executable test suite: | |
80 | OBJECTS = $(GENERATED_OBJECTS) $(USER_OBJECTS) | |
81 | ||
82 | GENERATED_OBJECTS = $(GENERATED_SOURCES:.cc=.o) | |
83 | ||
84 | USER_OBJECTS = $(USER_SOURCES:.cc=.o) | |
85 | ||
86 | DEPFILES = $(USER_OBJECTS:.o=.d) $(GENERATED_OBJECTS:.o=.d) | |
87 | ||
88 | # Other files of the project (Makefile, configuration files, etc.) | |
89 | # that will be added to the archived source files: | |
90 | OTHER_FILES = Makefile | |
91 | ||
92 | # The name of the executable test suite: | |
93 | TARGET = slider$(EXESUFFIX) | |
94 | ||
95 | # | |
96 | # Rules for building the executable... | |
97 | # | |
98 | ||
99 | all: $(TARGET) ; | |
100 | ||
101 | objects: $(OBJECTS) ; | |
102 | ||
103 | $(TARGET): $(OBJECTS) | |
104 | $(TTCN3_DIR)/bin/titanver $(OBJECTS) | |
105 | $(CXX) $(LDFLAGS) -o $@ $^ \ | |
106 | -L$(TTCN3_DIR)/lib -l$(TTCN3_LIB) \ | |
107 | -L$(OPENSSL_DIR)/lib -lcrypto \ | |
108 | -L$(XMLDIR)/lib $($(PLATFORM)_LIBS) | |
109 | ||
110 | .cc.o .c.o: | |
111 | $(CXX) -c $(CPPFLAGS) $(CXXFLAGS) -o $@ $< | |
112 | ||
113 | .cc.d .c.d: | |
114 | @echo Creating dependency file for '$<'; set -e; \ | |
115 | $(CXX) $(CXXDEPFLAGS) $(CPPFLAGS) $(CXXFLAGS) $< \ | |
116 | | sed 's/\($*\)\.o[ :]*/\1.o $@ : /g' > $@; \ | |
117 | [ -s $@ ] || rm -f $@ | |
118 | ||
119 | $(GENERATED_SOURCES) $(GENERATED_HEADERS): compile | |
120 | @if [ ! -f $@ ]; then $(RM) compile; $(MAKE) compile; fi | |
121 | ||
122 | compile:: $(TTCN3_DIR)/bin/compiler # $(TTCN3_COMPILER) | |
123 | @if [ -f $@ ]; then $(RM) compile; $(MAKE) compile; fi | |
124 | ||
125 | compile:: $(TTCN3_MODULES) $(ASN1_MODULES) | |
126 | $(TTCN3_COMPILER) $(COMPILER_FLAGS) $^ - $? | |
127 | touch $@ | |
128 | ||
129 | clean distclean: | |
130 | -$(RM) $(TARGET) $(OBJECTS) $(GENERATED_HEADERS) \ | |
131 | $(GENERATED_SOURCES) compile $(DEPFILES) \ | |
132 | tags *.log $(RT2CFG) | |
133 | ||
134 | dep: $(GENERATED_SOURCES) $(USER_SOURCES) ; | |
135 | ||
136 | ifeq ($(findstring n,$(MAKEFLAGS)),) | |
137 | ifeq ($(filter clean distclean check compile archive diag,$(MAKECMDGOALS)),) | |
138 | -include $(DEPFILES) | |
139 | endif | |
140 | endif | |
141 | ||
142 | ||
143 | # | |
144 | # Add your rules here if necessary... | |
145 | # | |
146 | run: $(TARGET) run$(RT2_SUFFIX).cfg | |
147 | ./$^ | |
148 | # cat $(TARGET).log | |
149 | # don't write the log, it confuses Eclipse | |
150 | ||
151 | rerun: | |
152 | rm -f compile; $(MAKE) run | |
153 | ||
154 | run-rt2.cfg: run.cfg Makefile | |
155 | perl -pwle 's/^(dual2)$$/$$1\ndualnegtest/' $< > $@ | |
156 | ||
157 | run-dynamic.cfg: run.cfg | |
158 | ln -s $^ $@ | |
159 | ||
160 | run-rt2-dynamic.cfg: run-rt2.cfg | |
161 | ln -s $^ $@ | |
162 | ||
163 | ||
164 | ifdef SRCDIR | |
165 | $(foreach src, $(USER_SOURCES), $(eval vpath $(src) $(ABS_SRC))) | |
166 | endif |