Sync with 5.4.0
[deliverable/titan.core.git] / regression_test / XML / NegativeTest / Makefile
1 ###############################################################################
2 # Copyright (c) 2000-2015 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 #only works with RT2
9 RT2=1
10
11 TOPDIR := ../..
12 include ../../Makefile.regression
13
14 ifndef RT2
15 $(error note: XML/NegativeTest requires RT2)
16 endif
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 distclean dep objects
25
26 .SUFFIXES: .d
27
28 # Flags for dependency generation
29 CXXDEPFLAGS = -MM
30
31 # Flags for the C++ compiler:
32 #CXXFLAGS = -Wall -g -coverage
33
34 # Flags for the linker:
35 #LDFLAGS = -g -rdynamic -coverage
36
37 # Flags for the TTCN-3 and ASN.1 compiler (-R already added)
38 #COMPILER_FLAGS +=
39
40 # Execution mode: (either ttcn3 or ttcn3-parallel)
41 TTCN3_LIB := ttcn3-rt2
42
43 #
44 # You may change these variables. Add your files if necessary...
45 #
46
47 # TTCN-3 modules of this project:
48 TTCN3_MODULES = rec.ttcn rec_of.ttcn uni.ttcn exer_rec.ttcn exer_rec_of.ttcn exer_uni.ttcn \
49 ReadXml.ttcn runner.ttcn
50
51 # ASN.1 modules of this project:
52 ASN1_MODULES =
53
54 # C++ source & header files generated from the TTCN-3 & ASN.1 modules of
55 # this project:
56 GENERATED_SOURCES = $(TTCN3_MODULES:.ttcn=.cc) $(ASN1_MODULES:.asn=.cc)
57 GENERATED_HEADERS = $(GENERATED_SOURCES:.cc=.hh)
58
59 # C/C++ Source & header files of Test Ports, external functions and
60 # other modules:
61 USER_SOURCES = ReadXmlImpl.cc
62 USER_HEADERS = $(USER_SOURCES:.cc=.hh)
63
64 # Object files of this project that are needed for the executable test suite:
65 OBJECTS = $(GENERATED_OBJECTS) $(USER_OBJECTS)
66
67 GENERATED_OBJECTS = $(GENERATED_SOURCES:.cc=.o)
68
69 USER_OBJECTS = $(USER_SOURCES:.cc=.o)
70
71 DEPFILES = $(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:
75 OTHER_FILES = Makefile
76
77 # The name of the executable test suite:
78 TARGET = neg$(EXESUFFIX)
79
80 #
81 # Rules for building the executable...
82 #
83
84 all: $(TARGET) ;
85
86 objects: $(OBJECTS) ;
87
88 $(TARGET): $(OBJECTS) $(TTCN3_DIR)/lib/lib$(TTCN3_LIB).a
89 $(CXX) $(LDFLAGS) -o $@ $^ \
90 -L$(TTCN3_DIR)/lib -l$(TTCN3_LIB) \
91 -L$(OPENSSL_DIR)/lib -lcrypto \
92 -L$(XMLDIR)/lib $($(PLATFORM)_LIBS) \
93 || $(TTCN3_DIR)/bin/titanver $(OBJECTS)
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
107 compile:: $(firstword $(TTCN3_COMPILER)) $(TTCN3_DIR)/lib/lib$(TTCN3_LIB).a
108 @if [ -f $@ ]; then $(RM) compile; $(MAKE) compile; fi
109
110 compile:: $(TTCN3_MODULES) $(ASN1_MODULES)
111 $(TTCN3_COMPILER) $(COMPILER_FLAGS) $^ - $?
112 touch $@
113
114 clean:
115 -$(RM) $(TARGET) $(OBJECTS) $(GENERATED_HEADERS) \
116 $(GENERATED_SOURCES) compile $(DEPFILES) \
117 tags *.log
118
119 distclean: clean
120 -$(RM) $(DEPFILES)
121
122 dep: $(GENERATED_SOURCES) $(USER_SOURCES) ;
123
124 ifeq ($(findstring n,$(MAKEFLAGS)),)
125 ifeq ($(filter clean distclean check compile archive diag,$(MAKECMDGOALS)),)
126 -include $(DEPFILES)
127 endif
128 endif
129
130 diag:
131 $(TTCN3_DIR)/bin/compiler -v 2>&1
132 $(TTCN3_DIR)/bin/mctr_cli -v 2>&1
133 $(CXX) -v 2>&1
134 @echo TTCN3_DIR=$(TTCN3_DIR)
135 @echo OPENSSL_DIR=$(OPENSSL_DIR)
136 @echo XMLDIR=$(XMLDIR)
137 @echo PLATFORM=$(PLATFORM)
138
139 #
140 # Add your rules here if necessary...
141 #
142
143 RUN := $(shell which colortitan 2>/dev/null)
144 ifeq ($(firstword $(RUN)),no)
145 # stupid /bin/which on Solaris writes errors to stdout instead of stderr
146 RUN :=
147 endif
148
149 run: $(TARGET) run.cfg
150 if $(RUN) ./$^; then ./indent.pl neg.log; else ./indent.pl neg.log; exit 1; fi
151
This page took 0.041084 seconds and 5 git commands to generate.