implemented new code splitting mechanism (split to equal slices)
[deliverable/titan.core.git] / regression_test / XML / NegativeTest / 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 # Raduly, Csaba
12 # Szabados, Kristof
13 # Szabo, Bence Janos
14 #
15 ##############################################################################
16 #only works with RT2
17 RT2=1
18
19 TOPDIR := ../..
20 include ../../Makefile.regression
21
22 ifndef RT2
23 $(error note: XML/NegativeTest requires RT2)
24 endif
25
26 # WARNING! This Makefile can be used with GNU make only.
27 # Other versions of make may report syntax errors in it.
28
29 #
30 # Do NOT touch this line...
31 #
32 .PHONY: all archive check clean distclean dep objects
33
34 .SUFFIXES: .d
35
36 # Flags for dependency generation
37 CXXDEPFLAGS = -MM
38
39 # Flags for the C++ compiler:
40 #CXXFLAGS = -Wall -g -coverage
41
42 # Flags for the linker:
43 #LDFLAGS = -g -rdynamic -coverage
44
45 # Flags for the TTCN-3 and ASN.1 compiler (-R already added)
46 #COMPILER_FLAGS +=
47
48 # Execution mode: (either ttcn3 or ttcn3-parallel)
49 TTCN3_LIB := ttcn3-rt2
50
51 #
52 # You may change these variables. Add your files if necessary...
53 #
54
55 # TTCN-3 modules of this project:
56 TTCN3_MODULES = rec.ttcn rec_of.ttcn uni.ttcn exer_rec.ttcn exer_rec_of.ttcn exer_uni.ttcn \
57 ReadXml.ttcn runner.ttcn
58
59 # ASN.1 modules of this project:
60 ASN1_MODULES =
61
62 # C++ source & header files generated from the TTCN-3 & ASN.1 modules of
63 # this project:
64 GENERATED_SOURCES = $(TTCN3_MODULES:.ttcn=.cc) $(ASN1_MODULES:.asn=.cc)
65 GENERATED_HEADERS = $(GENERATED_SOURCES:.cc=.hh)
66 ifdef SPLIT_TO_SLICES
67 POSTFIXES := $(foreach file, $(SPLIT_TO_SLICES), $(addsuffix $(file), _part_))
68 POSTFIXES := $(foreach file, $(POSTFIXES), $(addprefix $(file), .cc))
69 GENERATED_SOURCES2 := $(foreach file, $(GENERATED_SOURCES:.cc=), $(addprefix $(file), $(POSTFIXES)))
70 GENERATED_SOURCES += $(GENERATED_SOURCES2)
71 endif
72 # C/C++ Source & header files of Test Ports, external functions and
73 # other modules:
74 USER_SOURCES = ReadXmlImpl.cc
75 USER_HEADERS = $(USER_SOURCES:.cc=.hh)
76
77 # Object files of this project that are needed for the executable test suite:
78 OBJECTS = $(GENERATED_OBJECTS) $(USER_OBJECTS)
79
80 GENERATED_OBJECTS = $(GENERATED_SOURCES:.cc=.o)
81
82 USER_OBJECTS = $(USER_SOURCES:.cc=.o)
83
84 DEPFILES = $(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:
88 OTHER_FILES = Makefile
89
90 # The name of the executable test suite:
91 TARGET = neg$(EXESUFFIX)
92
93 #
94 # Rules for building the executable...
95 #
96
97 all: $(TARGET) ;
98
99 objects: $(OBJECTS) ;
100
101 $(TARGET): $(OBJECTS) $(TTCN3_DIR)/lib/lib$(TTCN3_LIB).a
102 $(CXX) $(LDFLAGS) -o $@ $^ \
103 -L$(TTCN3_DIR)/lib -l$(TTCN3_LIB) \
104 -L$(OPENSSL_DIR)/lib -lcrypto \
105 -L$(XMLDIR)/lib $($(PLATFORM)_LIBS) \
106 || $(TTCN3_DIR)/bin/titanver $(OBJECTS)
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
120 compile:: $(firstword $(TTCN3_COMPILER)) $(TTCN3_DIR)/lib/lib$(TTCN3_LIB).a
121 @if [ -f $@ ]; then $(RM) compile; $(MAKE) compile; fi
122
123 compile:: $(TTCN3_MODULES) $(ASN1_MODULES)
124 $(TTCN3_COMPILER) $(COMPILER_FLAGS) $^ - $?
125 touch $@
126
127 clean:
128 -$(RM) $(TARGET) $(OBJECTS) $(GENERATED_HEADERS) \
129 $(GENERATED_SOURCES) compile $(DEPFILES) \
130 tags *.log
131
132 distclean: clean
133 -$(RM) $(DEPFILES)
134
135 dep: $(GENERATED_SOURCES) $(USER_SOURCES) ;
136
137 ifeq ($(findstring n,$(MAKEFLAGS)),)
138 ifeq ($(filter clean distclean check compile archive diag,$(MAKECMDGOALS)),)
139 -include $(DEPFILES)
140 endif
141 endif
142
143 diag:
144 $(TTCN3_DIR)/bin/compiler -v 2>&1
145 $(TTCN3_DIR)/bin/mctr_cli -v 2>&1
146 $(CXX) -v 2>&1
147 @echo TTCN3_DIR=$(TTCN3_DIR)
148 @echo OPENSSL_DIR=$(OPENSSL_DIR)
149 @echo XMLDIR=$(XMLDIR)
150 @echo PLATFORM=$(PLATFORM)
151
152 #
153 # Add your rules here if necessary...
154 #
155
156 RUN := $(shell which colortitan 2>/dev/null)
157 ifeq ($(firstword $(RUN)),no)
158 # stupid /bin/which on Solaris writes errors to stdout instead of stderr
159 RUN :=
160 endif
161
162 run: $(TARGET) run.cfg
163 if $(RUN) ./$^; then ./indent.pl neg.log; else ./indent.pl neg.log; exit 1; fi
164
This page took 0.033124 seconds and 5 git commands to generate.