Titan Core Initial Contribution
[deliverable/titan.core.git] / regression_test / slider / 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#
12# Do NOT touch this line...
13#
14.PHONY: all run archive check clean dep objects
15
16.SUFFIXES: .d
17
18#
19# Set these variables...
20#
21
22#CXXFLAGS += -save-temps
23CXXFLAGS += -g
24
25# Flags for dependency generation
26CXXDEPFLAGS = -MM
27
28#COMPILER_FLAGS +=
29
30# Flags for the linker:
31LDFLAGS += -g
32
33ifeq ($(PLATFORM), WIN32)
34# Silence linker warnings.
35LDFLAGS += -Wl,--enable-auto-import,--enable-runtime-pseudo-reloc
36endif
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# TTCN-3 modules of this project:
46TTCN3_MODULES = slider.ttcn dual.ttcn dual2.ttcn
47
48ifdef RT2
49TTCN3_MODULES += dualnegtest.ttcn
50RT2CFG := run-rt2.cfg
51endif
52
53# ASN.1 modules of this project:
54ASN1_MODULES =
55
56# C++ source & header files generated from the TTCN-3 & ASN.1 modules of
57# this project:
58GENERATED_SOURCES = $(TTCN3_MODULES:.ttcn=.cc) $(ASN1_MODULES:.asn=.cc)
59GENERATED_HEADERS = $(GENERATED_SOURCES:.cc=.hh)
60
61# C/C++ Source & header files of Test Ports, external functions and
62# other modules:
63USER_SOURCES = PT1.cc UNDER.cc
64USER_HEADERS = $(USER_SOURCES:.cc=.hh)
65
66# Object files of this project that are needed for the executable test suite:
67OBJECTS = $(GENERATED_OBJECTS) $(USER_OBJECTS)
68
69GENERATED_OBJECTS = $(GENERATED_SOURCES:.cc=.o)
70
71USER_OBJECTS = $(USER_SOURCES:.cc=.o)
72
73DEPFILES = $(USER_OBJECTS:.o=.d) $(GENERATED_OBJECTS:.o=.d)
74
75# Other files of the project (Makefile, configuration files, etc.)
76# that will be added to the archived source files:
77OTHER_FILES = Makefile
78
79# The name of the executable test suite:
80TARGET = slider$(EXESUFFIX)
81
82#
83# Rules for building the executable...
84#
85
86all: $(TARGET) ;
87
88objects: $(OBJECTS) ;
89
90$(TARGET): $(OBJECTS)
91 $(TTCN3_DIR)/bin/titanver $(OBJECTS)
92 $(CXX) $(LDFLAGS) -o $@ $^ \
93 -L$(TTCN3_DIR)/lib -l$(TTCN3_LIB) \
94 -L$(OPENSSL_DIR)/lib -lcrypto \
95 -L$(XMLDIR)/lib $($(PLATFORM)_LIBS)
96
97.cc.o .c.o:
98 $(CXX) -c $(CPPFLAGS) $(CXXFLAGS) -o $@ $<
99
100.cc.d .c.d:
101 @echo Creating dependency file for '$<'; set -e; \
102 $(CXX) $(CXXDEPFLAGS) $(CPPFLAGS) $(CXXFLAGS) $< \
103 | sed 's/\($*\)\.o[ :]*/\1.o $@ : /g' > $@; \
104 [ -s $@ ] || rm -f $@
105
106$(GENERATED_SOURCES) $(GENERATED_HEADERS): compile
107 @if [ ! -f $@ ]; then $(RM) compile; $(MAKE) compile; fi
108
109compile:: $(TTCN3_DIR)/bin/compiler # $(TTCN3_COMPILER)
110 @if [ -f $@ ]; then $(RM) compile; $(MAKE) compile; fi
111
112compile:: $(TTCN3_MODULES) $(ASN1_MODULES)
113 $(TTCN3_COMPILER) $(COMPILER_FLAGS) $^ - $?
114 touch $@
115
116clean distclean:
117 -$(RM) $(TARGET) $(OBJECTS) $(GENERATED_HEADERS) \
118 $(GENERATED_SOURCES) compile $(DEPFILES) \
119 tags *.log $(RT2CFG)
120
121dep: $(GENERATED_SOURCES) $(USER_SOURCES) ;
122
123ifeq ($(findstring n,$(MAKEFLAGS)),)
124ifeq ($(filter clean distclean check compile archive diag,$(MAKECMDGOALS)),)
125-include $(DEPFILES)
126endif
127endif
128
129
130#
131# Add your rules here if necessary...
132#
133run: $(TARGET) run$(RT2_SUFFIX).cfg
134 ./$^
135# cat $(TARGET).log
136# don't write the log, it confuses Eclipse
137
138rerun:
139 rm -f compile; $(MAKE) run
140
141run-rt2.cfg: run.cfg Makefile
142 perl -pwle 's/^(dual2)$$/$$1\ndualnegtest/' $< > $@
143
144run-dynamic.cfg: run.cfg
145 ln -s $^ $@
146
147run-rt2-dynamic.cfg: run-rt2.cfg
148 ln -s $^ $@
149
150
151ifdef SRCDIR
152$(foreach src, $(USER_SOURCES), $(eval vpath $(src) $(ABS_SRC)))
153endif
This page took 0.033836 seconds and 5 git commands to generate.