c0d381b5bb25b5d3ce8a8656a2a967ff9a5a3aed
[deliverable/titan.core.git] / regression_test / all_from / 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 # Baranyi, Botond
12 # Raduly, Csaba
13 #
14 ##############################################################################
15 TOPDIR := ..
16 include ../Makefile.regression
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 dep objects
25
26 .SUFFIXES: .d
27
28 #
29 # Set these variables...
30 #
31
32 # Flags for the C++ preprocessor (and makedepend as well):
33 #CPPFLAGS +=
34
35 # Flags for dependency generation
36 CXXDEPFLAGS = -MM
37
38 # Flags for the C++ compiler:
39 #CXXFLAGS +=
40
41 # Flags for the linker:
42 #LDFLAGS +=
43
44 # Flags for the TTCN-3 and ASN.1 compiler:
45 #COMPILER_FLAGS +=
46
47 # Execution mode: (either ttcn3 or ttcn3-parallel)
48 TTCN3_LIB = ttcn3$(RT2_SUFFIX)$(DYNAMIC_SUFFIX)
49
50 #
51 # You may change these variables. Add your files if necessary...
52 #
53
54 # TTCN-3 modules of this project:
55 TTCN3_MODULES = $(wildcard all_from*.ttcn) types.ttcn sapc.ttcn functions.ttcn imported_templates.ttcn
56 #TTCN3_MODULES = everything.ttcn
57
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
67 # C/C++ Source & header files of Test Ports, external functions and
68 # other modules:
69 USER_SOURCES = f_ext.cc
70 USER_HEADERS = $(USER_SOURCES:.cc=.hh)
71
72 # Object files of this project that are needed for the executable test suite:
73 OBJECTS = $(GENERATED_OBJECTS) $(USER_OBJECTS)
74
75 GENERATED_OBJECTS = $(GENERATED_SOURCES:.cc=.o)
76
77 USER_OBJECTS = $(USER_SOURCES:.cc=.o)
78
79 DEPFILES = $(USER_OBJECTS:.o=.d) $(GENERATED_OBJECTS:.o=.d)
80
81 # Other files of the project (Makefile, configuration files, etc.)
82 # that will be added to the archived source files:
83 OTHER_FILES = Makefile
84
85 # The name of the executable test suite:
86 TARGET = all_from
87
88 #
89 # Rules for building the executable...
90 #
91
92 all: $(TARGET) ;
93
94 objects: $(OBJECTS) compile;
95
96 $(TARGET): $(OBJECTS)
97 if $(CXX) $(LDFLAGS) -o $@ $^ \
98 -L$(TTCN3_DIR)/lib -l$(TTCN3_LIB) \
99 -L$(OPENSSL_DIR)/lib -lcrypto \
100 -L$(XMLDIR)/lib $($(PLATFORM)_LIBS); \
101 then : ; else $(TTCN3_DIR)/bin/titanver $(OBJECTS); exit 1; fi
102
103 .cc.o .c.o:
104 $(CXX) -c $(CPPFLAGS) $(CXXFLAGS) -o $@ $<
105
106 .cc.d .c.d:
107 @echo Creating dependency file for '$<'; set -e; \
108 $(CXX) $(CXXDEPFLAGS) $(CPPFLAGS) $(CXXFLAGS) $< \
109 | sed 's/\($*\)\.o[ :]*/\1.o $@ : /g' > $@; \
110 [ -s $@ ] || rm -f $@
111
112 compile:: $(firstword $(TTCN3_COMPILER))
113 if [ -f $@ ]; then $(RM) $@; $(MAKE) $@; fi
114
115 compile:: $(TTCN3_MODULES) $(ASN1_MODULES)
116 $(TTCN3_COMPILER) $(COMPILER_FLAGS) $^ - $?
117 touch $@
118
119 $(GENERATED_SOURCES) $(GENERATED_HEADERS): compile
120 @if [ ! -f $@ ]; then $(RM) compile; $(MAKE) compile; fi
121
122 clean distclean:
123 -$(RM) $(TARGET) $(OBJECTS) $(GENERATED_HEADERS) \
124 $(GENERATED_SOURCES) compile $(DEPFILES) \
125 tags *.log
126
127 dep: $(GENERATED_SOURCES) $(USER_SOURCES) ;
128
129 ifeq ($(findstring n,$(MAKEFLAGS)),)
130 ifeq ($(filter clean distclean check compile archive diag,$(MAKECMDGOALS)),)
131 -include $(DEPFILES)
132 endif
133 endif
134
135 diag:
136 $(TTCN3_DIR)/bin/compiler -v 2>&1
137 $(TTCN3_DIR)/bin/mctr_cli -v 2>&1
138 $(CXX) -v 2>&1
139 @echo TTCN3_DIR=$(TTCN3_DIR)
140 @echo OPENSSL_DIR=$(OPENSSL_DIR)
141 @echo XMLDIR=$(XMLDIR)
142 @echo PLATFORM=$(PLATFORM)
143
144 #
145 # Add your rules here if necessary...
146 #
147
148 run.cfg: $(TARGET) Makefile
149 ./$< -l | perl -nwle 'BEGIN { print "[LOGGING]\nLogSourceInfo:=Yes\nLogEventTypes:=Detailed[EXECUTE]" } print if /\.tc/' > $@
150 # Reimplementing the above with sed and awk is left as an exericse
151
152 run: $(TARGET) run.cfg
153 ./$^
154 # ; cat $(TARGET).log
This page took 0.03327 seconds and 4 git commands to generate.