implemented new code splitting mechanism (split to equal slices)
[deliverable/titan.core.git] / regression_test / all_from / 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# Baranyi, Botond
12# Raduly, Csaba
14e21cff 13# Szabo, Bence Janos
d44e3c4f 14#
15##############################################################################
970ed795
EL
16TOPDIR := ..
17include ../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
37CXXDEPFLAGS = -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)
49TTCN3_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:
56TTCN3_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:
61ASN1_MODULES =
62
63# C++ source & header files generated from the TTCN-3 & ASN.1 modules of
64# this project:
65GENERATED_SOURCES = $(TTCN3_MODULES:.ttcn=.cc) $(ASN1_MODULES:.asn=.cc)
66GENERATED_HEADERS = $(GENERATED_SOURCES:.cc=.hh)
14e21cff 67ifdef SPLIT_TO_SLICES
68POSTFIXES := $(foreach file, $(SPLIT_TO_SLICES), $(addsuffix $(file), _part_))
69POSTFIXES := $(foreach file, $(POSTFIXES), $(addprefix $(file), .cc))
70GENERATED_SOURCES2 := $(foreach file, $(GENERATED_SOURCES:.cc=), $(addprefix $(file), $(POSTFIXES)))
71GENERATED_SOURCES += $(GENERATED_SOURCES2)
72endif
970ed795
EL
73# C/C++ Source & header files of Test Ports, external functions and
74# other modules:
75USER_SOURCES = f_ext.cc
76USER_HEADERS = $(USER_SOURCES:.cc=.hh)
77
78# Object files of this project that are needed for the executable test suite:
79OBJECTS = $(GENERATED_OBJECTS) $(USER_OBJECTS)
80
81GENERATED_OBJECTS = $(GENERATED_SOURCES:.cc=.o)
82
83USER_OBJECTS = $(USER_SOURCES:.cc=.o)
84
85DEPFILES = $(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:
89OTHER_FILES = Makefile
90
91# The name of the executable test suite:
92TARGET = all_from
93
94#
95# Rules for building the executable...
96#
97
98all: $(TARGET) ;
99
100objects: $(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
118compile:: $(firstword $(TTCN3_COMPILER))
119 if [ -f $@ ]; then $(RM) $@; $(MAKE) $@; fi
120
121compile:: $(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
128clean distclean:
129 -$(RM) $(TARGET) $(OBJECTS) $(GENERATED_HEADERS) \
130 $(GENERATED_SOURCES) compile $(DEPFILES) \
131 tags *.log
132
133dep: $(GENERATED_SOURCES) $(USER_SOURCES) ;
134
135ifeq ($(findstring n,$(MAKEFLAGS)),)
136ifeq ($(filter clean distclean check compile archive diag,$(MAKECMDGOALS)),)
137-include $(DEPFILES)
138endif
139endif
140
141diag:
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
154run.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
158run: $(TARGET) run.cfg
159 ./$^
160# ; cat $(TARGET).log
This page took 0.032426 seconds and 5 git commands to generate.