Last sync 2016.04.01
[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
13#
14##############################################################################
970ed795
EL
15TOPDIR := ..
16include ../Makefile.regression
17
18# WARNING! This Makefile can be used with GNU make only.
19# Other versions of make may report syntax errors in it.
20
21#
22# Do NOT touch this line...
23#
24.PHONY: all archive check clean dep objects
25
26.SUFFIXES: .d
27
28#
29# Set these variables...
30#
31
32# Flags for the C++ preprocessor (and makedepend as well):
33#CPPFLAGS +=
34
35# Flags for dependency generation
36CXXDEPFLAGS = -MM
37
38# Flags for the C++ compiler:
39CXXFLAGS += -g
40
41# Flags for the linker:
a38c6d4c 42#LDFLAGS += -g -rdynamic
970ed795
EL
43
44
45# Flags for the TTCN-3 and ASN.1 compiler:
46#COMPILER_FLAGS = -L
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 = tcdefparam.ttcn
57
58# ASN.1 modules of this project:
59ASN1_MODULES =
60
61# C++ source & header files generated from the TTCN-3 & ASN.1 modules of
62# this project:
63GENERATED_SOURCES = $(TTCN3_MODULES:.ttcn=.cc) $(ASN1_MODULES:.asn=.cc)
64GENERATED_HEADERS = $(GENERATED_SOURCES:.cc=.hh)
65
66# C/C++ Source & header files of Test Ports, external functions and
67# other modules:
68USER_SOURCES =
69USER_HEADERS = $(USER_SOURCES:.cc=.hh)
70
71# Object files of this project that are needed for the executable test suite:
72OBJECTS = $(GENERATED_OBJECTS) $(USER_OBJECTS)
73
74GENERATED_OBJECTS = $(GENERATED_SOURCES:.cc=.o)
75
76USER_OBJECTS = $(USER_SOURCES:.cc=.o)
77
78DEPFILES = $(USER_OBJECTS:.o=.d) $(GENERATED_OBJECTS:.o=.d)
79
80# Other files of the project (Makefile, configuration files, etc.)
81# that will be added to the archived source files:
82OTHER_FILES = config.cfg Makefile
83
84# The name of the executable test suite:
85TARGET = tcdefparam
86
87#
88# Rules for building the executable...
89#
90
91all: $(TARGET) ;
92
93objects: $(OBJECTS) compile;
94
95$(TARGET): $(OBJECTS)
96 if $(CXX) $(LDFLAGS) -o $@ $^ \
97 -L$(TTCN3_DIR)/lib -l$(TTCN3_LIB) \
98 -L$(OPENSSL_DIR)/lib -lcrypto \
99 -L$(XMLDIR)/lib $($(PLATFORM)_LIBS); \
100 then : ; else $(TTCN3_DIR)/bin/titanver $(OBJECTS); exit 1; fi
101
102.cc.o .c.o:
103 $(CXX) -c $(CPPFLAGS) $(CXXFLAGS) -o $@ $<
104
105.cc.d .c.d:
106 @echo Creating dependency file for '$<'; set -e; \
107 $(CXX) $(CXXDEPFLAGS) $(CPPFLAGS) $(CXXFLAGS) $< \
108 | sed 's/\($*\)\.o[ :]*/\1.o $@ : /g' > $@; \
109 [ -s $@ ] || rm -f $@
110
111$(GENERATED_SOURCES) $(GENERATED_HEADERS): compile
112 @if [ ! -f $@ ]; then $(RM) compile; $(MAKE) compile; fi
113
114compile: $(TTCN3_MODULES) $(ASN1_MODULES)
115 $(TTCN3_COMPILER) $(COMPILER_FLAGS) $^ - $?
116 touch $@
117
118clean:
119 -$(RM) $(TARGET) $(OBJECTS) $(GENERATED_HEADERS) \
120 $(GENERATED_SOURCES) compile $(DEPFILES) \
121 tags *.log
122
123distclean: clean
124 -$(RM) $(DEPFILES)
125
126dep: $(GENERATED_SOURCES) $(USER_SOURCES) ;
127
128ifeq ($(findstring n,$(MAKEFLAGS)),)
129ifeq ($(filter clean distclean check compile archive diag,$(MAKECMDGOALS)),)
130-include $(DEPFILES)
131endif
132endif
133
134diag:
135 $(TTCN3_DIR)/bin/compiler -v 2>&1
136 $(TTCN3_DIR)/bin/mctr_cli -v 2>&1
137 $(CXX) -v 2>&1
138 @echo TTCN3_DIR=$(TTCN3_DIR)
139 @echo OPENSSL_DIR=$(OPENSSL_DIR)
140 @echo XMLDIR=$(XMLDIR)
141 @echo PLATFORM=$(PLATFORM)
142
143# If using -dynamic runtime, the following may be needed:
144# LD_LIBRARY_PATH=${TTCN3_DIR}/lib:${LD_LIBRARY_PATH}
145run: $(TARGET) config.cfg
146 ./$^
147 # Run each testcase from the command line (but not the control part)
148 for t in `./${TARGET} -l | egrep '^[^ ]*\.[^ ]*' | grep -vw control` ; do ./$^ $$t; done
This page took 0.029177 seconds and 5 git commands to generate.