4f45e739ee3537b0465e2cde7de6659511f6adb4
[deliverable/titan.core.git] / regression_test / anytype / 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 ORIG ?= .
19
20 # WARNING! This Makefile can be used with GNU make only.
21 # Other versions of make may report syntax errors in it.
22
23 #
24 # Do NOT touch this line...
25 #
26 .PHONY: all check clean dep objects preprocess
27
28 #
29 # Set these variables...
30 #
31
32
33 # C preprocessor used for TTCN-3 files:
34 CPP = cpp
35
36 # Flags for the C++ preprocessor (and makedepend as well):
37 CPPFLAGS += -D$(PLATFORM)
38 # -I$(TTCN3_DIR)/include
39
40 # Flags for preprocessing TTCN-3 files:
41 #CPPFLAGS_TTCN3 +=
42
43 # Flags for the C++ compiler: (-Wall already in)
44 CXXFLAGS += -g -W -Wformat=2
45
46 # Flags for the linker:
47 LDFLAGS += -g
48
49 # Local flags for Titan (can be overridden from the environment or commandline)
50 TTCNFLAGS += -b -r -x
51
52 # Flags for the TTCN-3 and ASN.1 compiler
53 # (common flags already set in Makefile.regression)
54 COMPILER_FLAGS += $(TTCNFLAGS)
55
56 # $(sort ) also eliminates duplicates
57 COMPILER_FLAGS := $(sort $(COMPILER_FLAGS))
58
59 # Execution mode: (either ttcn3 or ttcn3-parallel)
60 TTCN3_LIB = ttcn3$(RT2_SUFFIX)$(DYNAMIC_SUFFIX)
61
62
63 #
64 # You may change these variables. Add your files if necessary...
65 #
66
67 # TTCN-3 modules to preprocess:
68 TTCN3_PP_MODULES = $(wildcard $(ABS_SRC)/*.ttcnpp)
69
70 # Files to include in TTCN-3 preprocessed modules:
71 TTCN3_INCLUDES = $(TOP_SRC)/XML/macros.ttcnin
72
73 # ASN.1 modules of this project:
74 ASN1_MODULES =
75
76 # TTCN-3 source files generated by the C preprocessor:
77 PREPROCESSED_TTCN3_MODULES := $(notdir $(TTCN3_PP_MODULES:.ttcnpp=.ttcn))
78
79 # TTCN-3 modules of this project:
80 TTCN3_MODULES = smallany.ttcn noany.ttcn
81
82 # C++ source & header files generated from the TTCN-3 & ASN.1 modules of
83 # this project:
84 GENERATED_SOURCES = $(TTCN3_MODULES:.ttcn=.cc) $(PREPROCESSED_TTCN3_MODULES:.ttcn=.cc) $(ASN1_MODULES:.asn=.cc)
85 GENERATED_HEADERS = $(GENERATED_SOURCES:.cc=.hh)
86 ifdef CODE_SPLIT
87 GENERATED_SOURCES := $(foreach file, $(GENERATED_SOURCES:.cc=), $(addprefix $(file), .cc _seq.cc _set.cc _seqof.cc _setof.cc _union.cc))
88 endif
89
90 # C/C++ Source & header files of Test Ports, external functions and
91 # other modules:
92 USER_SOURCES =
93 USER_HEADERS = $(USER_SOURCES:.cc=.hh)
94
95 # Object files of this project that are needed for the executable test suite:
96 OBJECTS = $(GENERATED_SOURCES:.cc=.o) $(USER_SOURCES:.cc=.o)
97
98 # The name of the executable test suite:
99 TARGET = AnytypeTest
100
101
102 #
103 # Rules for building the executable...
104 #
105
106 all: $(TARGET) ;
107
108 objects: $(OBJECTS) ;
109
110 $(TARGET): $(GENERATED_SOURCES) $(USER_SOURCES)
111 $(CXX) $(CPPFLAGS) $(CXXFLAGS) $(LDFLAGS) -o $@ $^ \
112 -L$(TTCN3_DIR)/lib -l$(TTCN3_LIB) \
113 -L$(OPENSSL_DIR)/lib -lcrypto \
114 -L$(XMLDIR)/lib $($(PLATFORM)_LIBS)
115
116 %.ttcn: %.ttcnpp $(TTCN3_INCLUDES)
117 $(CPP) -x c -nostdinc $(CPPFLAGS_TTCN3) $< $@
118
119 preprocess: $(PREPROCESSED_TTCN3_MODULES) ;
120
121 $(GENERATED_SOURCES) $(GENERATED_HEADERS): compile
122 @if [ ! -f $@ ]; then $(RM) compile; $(MAKE) compile; fi
123
124 ifeq ($(findstring dynamic,$(TTCN3_LIB)),)
125 # not dynamic
126 CORELIB_BINARY := $(TTCN3_DIR)/lib/lib$(TTCN3_LIB).a
127 else
128 CORELIB_BINARY := $(TTCN3_DIR)/lib/lib$(TTCN3_LIB).so
129 endif
130
131
132 compile:: $(firstword $(TTCN3_COMPILER)) $(CORELIB_BINARY)
133 @if [ -f $@ ]; then $(RM) compile; $(MAKE) compile; fi
134
135 compile:: $(TTCN3_MODULES) $(PREPROCESSED_TTCN3_MODULES) $(ASN1_MODULES)
136 # no old names due to modulepar verbose
137 $(filter-out -Nold -E, $(TTCN3_COMPILER) $(COMPILER_FLAGS)) $^ - $?
138 touch $@
139
140 clean distclean:
141 -$(RM) $(TARGET) $(OBJECTS) $(GENERATED_HEADERS) \
142 $(GENERATED_SOURCES) $(PREPROCESSED_TTCN3_MODULES) compile \
143 tags *.log
144
145 dep: $(GENERATED_SOURCES) $(USER_SOURCES)
146 makedepend $(CPPFLAGS) $^
147
148 #
149 # Add your rules here if necessary...
150 #
151
152 install:
153 @echo You cannot be serious!
154
155 re:
156 rm -f compile
157
158 RUN := $(shell which colortitan)
159 ifeq ($(firstword $(RUN)),no)
160 # stupid /bin/which on Solaris writes errors to stdout instead of stderr
161 RUN :=
162 endif
163
164
165 run: $(TARGET) config.cfg
166 $(RUN) ./$^
167
This page took 0.035564 seconds and 4 git commands to generate.