implemented new code splitting mechanism (split to equal slices)
[deliverable/titan.core.git] / regression_test / testcase_defparam / 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:
40CXXFLAGS += -g
41
42# Flags for the linker:
a38c6d4c 43#LDFLAGS += -g -rdynamic
970ed795
EL
44
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# You may change these variables. Add your files if necessary...
54#
55
56# TTCN-3 modules of this project:
57TTCN3_MODULES = tcdefparam.ttcn
58
59# ASN.1 modules of this project:
60ASN1_MODULES =
61
62# C++ source & header files generated from the TTCN-3 & ASN.1 modules of
63# this project:
64GENERATED_SOURCES = $(TTCN3_MODULES:.ttcn=.cc) $(ASN1_MODULES:.asn=.cc)
65GENERATED_HEADERS = $(GENERATED_SOURCES:.cc=.hh)
14e21cff 66ifdef SPLIT_TO_SLICES
67POSTFIXES := $(foreach file, $(SPLIT_TO_SLICES), $(addsuffix $(file), _part_))
68POSTFIXES := $(foreach file, $(POSTFIXES), $(addprefix $(file), .cc))
69GENERATED_SOURCES2 := $(foreach file, $(GENERATED_SOURCES:.cc=), $(addprefix $(file), $(POSTFIXES)))
70GENERATED_SOURCES += $(GENERATED_SOURCES2)
71endif
970ed795
EL
72# C/C++ Source & header files of Test Ports, external functions and
73# other modules:
74USER_SOURCES =
75USER_HEADERS = $(USER_SOURCES:.cc=.hh)
76
77# Object files of this project that are needed for the executable test suite:
78OBJECTS = $(GENERATED_OBJECTS) $(USER_OBJECTS)
79
80GENERATED_OBJECTS = $(GENERATED_SOURCES:.cc=.o)
81
82USER_OBJECTS = $(USER_SOURCES:.cc=.o)
83
84DEPFILES = $(USER_OBJECTS:.o=.d) $(GENERATED_OBJECTS:.o=.d)
85
86# Other files of the project (Makefile, configuration files, etc.)
87# that will be added to the archived source files:
88OTHER_FILES = config.cfg Makefile
89
90# The name of the executable test suite:
91TARGET = tcdefparam
92
93#
94# Rules for building the executable...
95#
96
97all: $(TARGET) ;
98
99objects: $(OBJECTS) compile;
100
101$(TARGET): $(OBJECTS)
102 if $(CXX) $(LDFLAGS) -o $@ $^ \
103 -L$(TTCN3_DIR)/lib -l$(TTCN3_LIB) \
104 -L$(OPENSSL_DIR)/lib -lcrypto \
105 -L$(XMLDIR)/lib $($(PLATFORM)_LIBS); \
106 then : ; else $(TTCN3_DIR)/bin/titanver $(OBJECTS); exit 1; fi
107
108.cc.o .c.o:
109 $(CXX) -c $(CPPFLAGS) $(CXXFLAGS) -o $@ $<
110
111.cc.d .c.d:
112 @echo Creating dependency file for '$<'; set -e; \
113 $(CXX) $(CXXDEPFLAGS) $(CPPFLAGS) $(CXXFLAGS) $< \
114 | sed 's/\($*\)\.o[ :]*/\1.o $@ : /g' > $@; \
115 [ -s $@ ] || rm -f $@
116
117$(GENERATED_SOURCES) $(GENERATED_HEADERS): compile
118 @if [ ! -f $@ ]; then $(RM) compile; $(MAKE) compile; fi
119
120compile: $(TTCN3_MODULES) $(ASN1_MODULES)
121 $(TTCN3_COMPILER) $(COMPILER_FLAGS) $^ - $?
122 touch $@
123
124clean:
125 -$(RM) $(TARGET) $(OBJECTS) $(GENERATED_HEADERS) \
126 $(GENERATED_SOURCES) compile $(DEPFILES) \
127 tags *.log
128
129distclean: clean
130 -$(RM) $(DEPFILES)
131
132dep: $(GENERATED_SOURCES) $(USER_SOURCES) ;
133
134ifeq ($(findstring n,$(MAKEFLAGS)),)
135ifeq ($(filter clean distclean check compile archive diag,$(MAKECMDGOALS)),)
136-include $(DEPFILES)
137endif
138endif
139
140diag:
141 $(TTCN3_DIR)/bin/compiler -v 2>&1
142 $(TTCN3_DIR)/bin/mctr_cli -v 2>&1
143 $(CXX) -v 2>&1
144 @echo TTCN3_DIR=$(TTCN3_DIR)
145 @echo OPENSSL_DIR=$(OPENSSL_DIR)
146 @echo XMLDIR=$(XMLDIR)
147 @echo PLATFORM=$(PLATFORM)
148
149# If using -dynamic runtime, the following may be needed:
150# LD_LIBRARY_PATH=${TTCN3_DIR}/lib:${LD_LIBRARY_PATH}
151run: $(TARGET) config.cfg
152 ./$^
153 # Run each testcase from the command line (but not the control part)
154 for t in `./${TARGET} -l | egrep '^[^ ]*\.[^ ]*' | grep -vw control` ; do ./$^ $$t; done
This page took 0.029707 seconds and 5 git commands to generate.