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