implemented new code splitting mechanism (split to equal slices)
[deliverable/titan.core.git] / regression_test / slider / Makefile
CommitLineData
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
16TOPDIR := ..
17include ../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
31CXXFLAGS += -g
32
33# Flags for dependency generation
34CXXDEPFLAGS = -MM
35
36#COMPILER_FLAGS +=
37
38# Flags for the linker:
39LDFLAGS += -g
40
41ifeq ($(PLATFORM), WIN32)
42# Silence linker warnings.
43LDFLAGS += -Wl,--enable-auto-import,--enable-runtime-pseudo-reloc
44endif
45
46# Flags for the TTCN-3 and ASN.1 compiler:
47#COMPILER_FLAGS += -L
48
49# Execution mode: (either ttcn3 or ttcn3-parallel)
50TTCN3_LIB = ttcn3$(RT2_SUFFIX)$(DYNAMIC_SUFFIX)
51
52
53# TTCN-3 modules of this project:
54TTCN3_MODULES = slider.ttcn dual.ttcn dual2.ttcn
55
56ifdef RT2
57TTCN3_MODULES += dualnegtest.ttcn
58RT2CFG := run-rt2.cfg
59endif
60
61# ASN.1 modules of this project:
62ASN1_MODULES =
63
64# C++ source & header files generated from the TTCN-3 & ASN.1 modules of
65# this project:
66GENERATED_SOURCES = $(TTCN3_MODULES:.ttcn=.cc) $(ASN1_MODULES:.asn=.cc)
67GENERATED_HEADERS = $(GENERATED_SOURCES:.cc=.hh)
14e21cff 68ifdef SPLIT_TO_SLICES
69POSTFIXES := $(foreach file, $(SPLIT_TO_SLICES), $(addsuffix $(file), _part_))
70POSTFIXES := $(foreach file, $(POSTFIXES), $(addprefix $(file), .cc))
71GENERATED_SOURCES2 := $(foreach file, $(GENERATED_SOURCES:.cc=), $(addprefix $(file), $(POSTFIXES)))
72GENERATED_SOURCES += $(GENERATED_SOURCES2)
73endif
970ed795
EL
74# C/C++ Source & header files of Test Ports, external functions and
75# other modules:
76USER_SOURCES = PT1.cc UNDER.cc
77USER_HEADERS = $(USER_SOURCES:.cc=.hh)
78
79# Object files of this project that are needed for the executable test suite:
80OBJECTS = $(GENERATED_OBJECTS) $(USER_OBJECTS)
81
82GENERATED_OBJECTS = $(GENERATED_SOURCES:.cc=.o)
83
84USER_OBJECTS = $(USER_SOURCES:.cc=.o)
85
86DEPFILES = $(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:
90OTHER_FILES = Makefile
91
92# The name of the executable test suite:
93TARGET = slider$(EXESUFFIX)
94
95#
96# Rules for building the executable...
97#
98
99all: $(TARGET) ;
100
101objects: $(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
122compile:: $(TTCN3_DIR)/bin/compiler # $(TTCN3_COMPILER)
123 @if [ -f $@ ]; then $(RM) compile; $(MAKE) compile; fi
124
125compile:: $(TTCN3_MODULES) $(ASN1_MODULES)
126 $(TTCN3_COMPILER) $(COMPILER_FLAGS) $^ - $?
127 touch $@
128
129clean distclean:
130 -$(RM) $(TARGET) $(OBJECTS) $(GENERATED_HEADERS) \
131 $(GENERATED_SOURCES) compile $(DEPFILES) \
132 tags *.log $(RT2CFG)
133
134dep: $(GENERATED_SOURCES) $(USER_SOURCES) ;
135
136ifeq ($(findstring n,$(MAKEFLAGS)),)
137ifeq ($(filter clean distclean check compile archive diag,$(MAKECMDGOALS)),)
138-include $(DEPFILES)
139endif
140endif
141
142
143#
144# Add your rules here if necessary...
145#
146run: $(TARGET) run$(RT2_SUFFIX).cfg
147 ./$^
148# cat $(TARGET).log
149# don't write the log, it confuses Eclipse
150
151rerun:
152 rm -f compile; $(MAKE) run
153
154run-rt2.cfg: run.cfg Makefile
155 perl -pwle 's/^(dual2)$$/$$1\ndualnegtest/' $< > $@
156
157run-dynamic.cfg: run.cfg
158 ln -s $^ $@
159
160run-rt2-dynamic.cfg: run-rt2.cfg
161 ln -s $^ $@
162
163
164ifdef SRCDIR
165$(foreach src, $(USER_SOURCES), $(eval vpath $(src) $(ABS_SRC)))
166endif
This page took 0.031766 seconds and 5 git commands to generate.