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