Makefile 14.1 KB
Newer Older
Elemer Lelik's avatar
Elemer Lelik committed
1
##############################################################################
balaskoa's avatar
balaskoa committed
2
# Copyright (c) 2000-2020 Ericsson Telecom AB
Elemer Lelik's avatar
Elemer Lelik committed
3
# All rights reserved. This program and the accompanying materials
4
# are made available under the terms of the Eclipse Public License v2.0
Elemer Lelik's avatar
Elemer Lelik committed
5
# which accompanies this distribution, and is available at
6
# https://www.eclipse.org/org/documents/epl-2.0/EPL-2.0.html
Elemer Lelik's avatar
Elemer Lelik committed
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
#
# Contributors:
#   
#   Baji, Laszlo
#   Balasko, Jeno
#   Baranyi, Botond
#   Beres, Szabolcs
#   Delic, Adam
#   Feher, Csaba
#   Forstner, Matyas
#   Horvath, Gabriella
#   Koppany, Csaba
#   Kovacs, Ferenc
#   Raduly, Csaba
#   Szabados, Kristof
#   Szabo, Janos Zoltan – initial implementation
#   Szalai, Gabor
#   Zalanyi, Balazs Andor
#
##############################################################################
Elemer Lelik's avatar
Elemer Lelik committed
27
28
29
30
31
32
33
# Makefile for the Base Library of TTCN-3 Test Executor
TOP := ..
include $(TOP)/Makefile.cfg

SCHEMAS := TitanLoggerApi.xsd
# Generated from `TitanLoggerApi.xsd'.
GENERATED_MODULES := TitanLoggerApi.ttcn
Elemer Lelik's avatar
Elemer Lelik committed
34
35
	
PREGENERATOR_MODULES := PreGenRecordOf.ttcn
Elemer Lelik's avatar
Elemer Lelik committed
36
37
38

GENERATED_LOGGERAPI_SOURCES := $(GENERATED_MODULES:.ttcn=.cc)
GENERATED_LOGGERCONTROL_SOURCES := TitanLoggerControl.cc
Elemer Lelik's avatar
Elemer Lelik committed
39
40
	
PREGENERATED_SOURCES := $(PREGENERATOR_MODULES:.ttcn=.cc)
Elemer Lelik's avatar
Elemer Lelik committed
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58

ORIGINATORS := TitanLoggerApi.xsd TitanLoggerApi.ttcn TitanLoggerControl.ttcn gccversion.c \
config_process.l config_process.y

ifneq ($(FUNCTION_TEST_RUNTIME), yes)
APIDIR := RT1
else
APIDIR := RT2
endif

# RT1 (load test) generates cc/hh files into the RT1/ directory,
# RT2 (function test) into the RT2/ directory. This has two purposes:
# * To prevent the vpath directive in core2/Makefile from finding files in RT1.
#   This way, RT2 has to generate these files for itself (with RT2 settings).
# * To allow TTCN3.hh to include the right kind of TitanLoggerApi.hh
# These directories (RT1/RT2) are replicated inside $(INCDIR)
GENERATED_LOGGERAPI_SOURCES     := $(addprefix $(APIDIR)/,$(GENERATED_LOGGERAPI_SOURCES))
GENERATED_LOGGERCONTROL_SOURCES := $(addprefix $(APIDIR)/,$(GENERATED_LOGGERCONTROL_SOURCES))
Elemer Lelik's avatar
Elemer Lelik committed
59
PREGENERATED_SOURCES		:= $(addprefix $(APIDIR)/,$(PREGENERATED_SOURCES))
Elemer Lelik's avatar
Elemer Lelik committed
60
61

GENERATED_SOURCES := $(GENERATED_LOGGERAPI_SOURCES)          $(GENERATED_LOGGERCONTROL_SOURCES)         config_process.lex.cc config_process.tab.cc
Elemer Lelik's avatar
Elemer Lelik committed
62
GENERATED_SOURCES += $(PREGENERATED_SOURCES)
Elemer Lelik's avatar
Elemer Lelik committed
63
GENERATED_HEADERS := $(GENERATED_LOGGERAPI_SOURCES:.cc=.hh)  $(GENERATED_LOGGERCONTROL_SOURCES:.cc=.hh) config_process.tab.hh config_process.lex.hh
Elemer Lelik's avatar
Elemer Lelik committed
64
GENERATED_HEADERS += $(GENERATED_LOGGERAPI_SOURCES:.cc=Simple.hh) $(PREGENERATED_SOURCES:.cc=.hh)
Elemer Lelik's avatar
Elemer Lelik committed
65
GENERATED_OTHERS  := $(GENERATED_LOGGERAPI_SOURCES).compiled $(GENERATED_LOGGERCONTROL_SOURCES).compiled
Elemer Lelik's avatar
Elemer Lelik committed
66
GENERATED_OTHERS  += $(PREGENERATED_SOURCES).compiled config_process.output lex.backup
Elemer Lelik's avatar
Elemer Lelik committed
67
68
69
70
71
72
73
74
75
76
77

TTCN_COMPILER_FLAGS :=
ifeq ($(FUNCTION_TEST_RUNTIME), yes)
  TTCN_COMPILER_FLAGS += -R
endif

TTCN_COMPILER_FLAGS += -o $(APIDIR)

# -I. is needed because TitanLoggerApi.hh (generated) does #include <TTCN3.hh>
CPPFLAGS += -I. -I$(APIDIR)

78
79
80
81
82
83
84
85
SOLARIS_LIBS   := -lsocket -lnsl -lxml2
SOLARIS8_LIBS  := -lsocket -lnsl -lxml2
LINUX_LIBS     := -lxml2
FREEBSD_LIBS   := -lxml2
WIN32_LIBS     := -lxml2
INTERIX_LIBS   := -lxml2
	
ifeq ($(ADVANCED_DEBUGGER_UI), yes)
86
87
88
89
90
91
  SOLARIS_LIBS   += -lcurses -lbsd -ledit
  SOLARIS8_LIBS  += -lcurses -lbsd -ledit
  LINUX_LIBS     += -lncurses -lbsd -ledit
  FREEBSD_LIBS   += -lncurses -lbsd -ledit
  WIN32_LIBS     += -lncurses -lbsd -ledit
  INTERIX_LIBS   += -lncurses -lbsd -ledit
92
endif
Elemer Lelik's avatar
Elemer Lelik committed
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114

ifeq ($(USAGE_STATS), yes)
  SOLARIS_LIBS  += -lresolv
  SOLARIS8_LIBS += -lresolv
  LINUX_LIBS += -lpthread -lrt
endif

# No need for `-Wl,-export-dynamic' until we're using shared objects.  All
# `dl*()' related stuff is disabled for now.
ifeq ($(DYNAMIC_LOGGER_PLUGINS), yes)
  $(PLATFORM)_LIBS += -ldl
endif

# Note: RT2_SOURCES is set in core2/Makefile
STATIC_SOURCES := Addfunc.cc Array.cc ASN_Any.cc ASN_CharacterString.cc \
ASN_EmbeddedPDV.cc ASN_External.cc ASN_Null.cc Basetype.cc BER.cc Bitstring.cc \
Boolean.cc Charstring.cc Communication.cc Component.cc Default.cc Encdec.cc \
Error.cc Float.cc Hexstring.cc RInt.cc Integer.cc Logger.cc LoggerPlugin.cc \
LoggerPluginManager.cc LegacyLogger.cc LoggingBits.cc \
Module_list.cc Objid.cc Octetstring.cc Parallel_main.cc Port.cc RAW.cc \
Runtime.cc Single_main.cc Snapshot.cc Struct_of.cc Template.cc TEXT.cc \
Textbuf.cc Timer.cc Param_Types.cc Universal_charstring.cc \
Elemer Lelik's avatar
Elemer Lelik committed
115
Verdicttype.cc XER.cc XmlReader.cc TitanLoggerControlImpl.cc TCov.cc JSON.cc \
116
Profiler.cc ProfilerTools.cc ProfMerge_main.cc Debugger.cc DebuggerUI.cc \
117
OER.cc $(RT2_SOURCES)
Elemer Lelik's avatar
Elemer Lelik committed
118
119
120
121

# Keep GENERATED_SOURCES at the beginning. This may speed up parallel builds
# by starting early the compilation of the largest files.
SOURCES := $(GENERATED_SOURCES) $(STATIC_SOURCES)
Elemer Lelik's avatar
Elemer Lelik committed
122
	
Elemer Lelik's avatar
Elemer Lelik committed
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155

ifeq ($(FUNCTION_TEST_RUNTIME), yes)
  RT2_SUFFIX := -rt2
  CPPFLAGS += -DTITAN_RUNTIME_2
endif

ifdef XMLDIR
ifeq ($(XMLDIR), default)
  # Do not change XMLDIR !
  ACTUAL_XMLDIR := /usr
  # do not add -L/usr/lib to LDFLAGS, it's redundant
else
  ACTUAL_XMLDIR := $(XMLDIR)
  LDFLAGS  += -L$(ACTUAL_XMLDIR)/lib
endif
  # This addition to CPPFLAGS is always needed
  CPPFLAGS += -I$(ACTUAL_XMLDIR)/include/libxml2
endif

ifdef OPENSSL_DIR
ifneq ($(OPENSSL_DIR), default)
  CPPFLAGS += -I$(OPENSSL_DIR)/include
  LDFLAGS  += -L$(OPENSSL_DIR)/lib
endif
endif

ifeq ($(PLATFORM),INTERIX)
  # to get the "right" iconv, used by libxml2
  CPPFLAGS += -I/usr/local/include
endif


OBJECTS := $(patsubst %.cc,%.o,$(patsubst %.c,%.o,$(SOURCES)))
Elemer Lelik's avatar
Elemer Lelik committed
156
157
158
	
PROFMERGE_OBJECTS := ProfMerge_main.o ProfilerTools.profmerge.o \
	../common/JSON_Tokenizer.o ../common/memory.o
Elemer Lelik's avatar
Elemer Lelik committed
159
160
161
162

COMMON_OBJECTS := $(addprefix ../common/, memory.o pattern_la.o pattern_p.o \
	            config_preproc.o config_preproc_la.o config_preproc_p.tab.o \
	            path.o pattern_uni.o Quadruple.o NetworkHandler.o Path2.o \
163
	            ModuleVersion.o JSON_Tokenizer.o UnicharPattern.o)
Elemer Lelik's avatar
Elemer Lelik committed
164
165
166
167
168
169
170

ifeq ($(DEBUG), yes)
  COMMON_OBJECTS += ../common/new.o
endif

ifeq ($(LICENSING), yes)
  COMMON_OBJECTS += ../common/license.o
Elemer Lelik's avatar
Elemer Lelik committed
171
  PROFMERGE_OBJECTS += ../common/license.o
Elemer Lelik's avatar
Elemer Lelik committed
172
173
174
175
176
177
178
179
180
181
endif

ifdef REGEX_DIR
  COMMON_OBJECTS += $(REGEX_DIR)/lib/regex.o
endif

ifeq ($(USAGE_STATS), yes)
  COMMON_OBJECTS += ../common/usage_stats.o
endif

182

Elemer Lelik's avatar
Elemer Lelik committed
183
LIBRARY_OBJECTS_NOMAIN := $(filter-out Single_main.o Parallel_main.o ProfMerge_main.o, \
184
  $(OBJECTS)) $(COMMON_OBJECTS)
Elemer Lelik's avatar
Elemer Lelik committed
185

Elemer Lelik's avatar
Elemer Lelik committed
186
TOBECLEANED := LoggerPlugin_static.o LoggerPlugin_dynamic.o ProfilerTools.profmerge.o
Elemer Lelik's avatar
Elemer Lelik committed
187
188
189
190
191
192
193
194
195
196
197
198
199

DEPFILES := $(patsubst %.cc,%.d,$(patsubst %.c,%.d,$(SOURCES)))

SUBDIRS :=

HEADERS := TTCN3.hh Types.h Param_Types.hh Basetype.hh Template.hh RInt.hh \
Integer.hh Float.hh Boolean.hh Objid.hh Verdicttype.hh Bitstring.hh \
Hexstring.hh Octetstring.hh Charstring.hh Universal_charstring.hh Component.hh \
Logger.hh ILoggerPlugin.hh Error.hh Timer.hh Runtime.hh Snapshot.hh Default.hh \
Port.hh Event_Handler.hh Struct_of.hh Array.hh Optional.hh Textbuf.hh Encdec.hh \
Module_list.hh Parameters.h Addfunc.hh RAW.hh BER.hh TEXT.hh ASN_Null.hh \
ASN_Any.hh ASN_External.hh ASN_EmbeddedPDV.hh ASN_CharacterString.hh XER.hh \
XmlReader.hh cversion.h TitanLoggerControl.ttcn TitanLoggerApi.xsd Vector.hh \
200
JSON.hh Profiler.hh RefdIndex.hh ProfilerTools.hh Debugger.hh DebugCommands.hh \
201
DebuggerUI.hh OER.hh OOP.hh
Elemer Lelik's avatar
Elemer Lelik committed
202
203
204
205
206
207
208
209
210
211
212
# Copied during "make install"

ifdef REGEX_DIR
  HEADERS += $(REGEX_DIR)/include/regex.h
endif

# # # # Library and shared lib names
LIBRARY := libttcn3$(RT2_SUFFIX).a
PARALLEL_LIBRARY := libttcn3$(RT2_SUFFIX)-parallel.a
SHAREDLIB := libttcn3$(RT2_SUFFIX)-dynamic.so
PARALLEL_SHAREDLIB := libttcn3$(RT2_SUFFIX)-parallel-dynamic.so
Elemer Lelik's avatar
Elemer Lelik committed
213
214
	
# Executables
Elemer Lelik's avatar
Elemer Lelik committed
215
ifneq ($(FUNCTION_TEST_RUNTIME), yes)
Elemer Lelik's avatar
Elemer Lelik committed
216
PROGRAMS := ttcn3_profmerge$(EXESUFFIX)
Elemer Lelik's avatar
Elemer Lelik committed
217
endif
Elemer Lelik's avatar
Elemer Lelik committed
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242

TARGETS := $(LIBRARY) $(PARALLEL_LIBRARY)

# Determine whether to build shared libraries:
DYNAMIC_LINKING := yes
ifeq ($(PLATFORM), WIN32)
  LDFLAGS += -Xlinker --out-implib -Xlinker $(basename $@).a
endif
ifeq ($(PLATFORM), INTERIX)
  DYNAMIC_LINKING := no
endif

ifeq ($(DYNAMIC_LINKING), yes)
  TARGETS += $(SHAREDLIB) $(PARALLEL_SHAREDLIB)
  ifeq ($(PLATFORM), WIN32)
    # import libraries are generated as a side-effect; need to be cleaned
    TOBECLEANED += $(SHAREDLIB:.so=.a) $(PARALLEL_SHAREDLIB:.so=.a)
  endif
endif

ifneq ($(FUNCTION_TEST_RUNTIME), yes)
  TARGETS += cversion.h
endif

# Only for testing the consistency of libraries:
Elemer Lelik's avatar
Elemer Lelik committed
243
TEST_PROGRAMS := single$(RT2_SUFFIX)$(EXESUFFIX) parallel$(RT2_SUFFIX)$(EXESUFFIX)
Elemer Lelik's avatar
Elemer Lelik committed
244
ifeq ($(DYNAMIC_LINKING), yes)
Elemer Lelik's avatar
Elemer Lelik committed
245
TEST_PROGRAMS += single$(RT2_SUFFIX)-dynamic$(EXESUFFIX) parallel$(RT2_SUFFIX)-dynamic$(EXESUFFIX)
Elemer Lelik's avatar
Elemer Lelik committed
246
247
endif
ifneq ($(FUNCTION_TEST_RUNTIME), yes)
Elemer Lelik's avatar
Elemer Lelik committed
248
TEST_PROGRAMS += gccversion$(EXESUFFIX)
Elemer Lelik's avatar
Elemer Lelik committed
249
250
251
endif


Elemer Lelik's avatar
Elemer Lelik committed
252
TOBECLEANED += $(TEST_PROGRAMS) cversion.h $(GENERATED_MODULES)
Elemer Lelik's avatar
Elemer Lelik committed
253
254
255
256
257
258
259
260
261
262
263
264
265
266

ifdef REGEX_DIR
  CPPFLAGS += -I$(REGEX_DIR)/include
endif


ifdef SRCDIR
COMMON_DIR := $(SRCDIR)/common
else
COMMON_DIR := ../common
endif

CPPFLAGS += -I$(COMMON_DIR)

Elemer Lelik's avatar
Elemer Lelik committed
267
268
MANPAGES := ttcn3_profmerge.1

Elemer Lelik's avatar
Elemer Lelik committed
269
# # # # # # # # # targets
Elemer Lelik's avatar
Elemer Lelik committed
270
all: $(TARGETS) $(PROGRAMS) $(TEST_PROGRAMS)
Elemer Lelik's avatar
Elemer Lelik committed
271
272
273

run: all
# Verify that the executables are runnable.
Elemer Lelik's avatar
Elemer Lelik committed
274
	for p in $(filter-out gccversion%,$(TEST_PROGRAMS)); do echo $$p; LD_LIBRARY_PATH=.:$$LD_LIBRARY_PATH ./$$p -l; if [ $$? -ne 0 ] ; then exit $$?; fi done
Elemer Lelik's avatar
Elemer Lelik committed
275
276
277
278
279
280
281

# xsd -> ttcn
$(GENERATED_MODULES): $(SCHEMAS) ../xsdconvert/xsd2ttcn$(EXESUFFIX)
	../xsdconvert/xsd2ttcn$(EXESUFFIX) -p $<
	sed -e 's/XSD.String/charstring/g;s/XSD.AnySimpleType/charstring/g;s/XSD.Integer/integer/g;s/XSD.Float/float/g;s/XSD.Double/float/g;s/XSD.Boolean/boolean/g;s/import from XSD all;//g' TitanLoggerApi.ttcn >TitanLoggerApi.ttcn_
	mv TitanLoggerApi.ttcn_ TitanLoggerApi.ttcn

Elemer Lelik's avatar
Elemer Lelik committed
282
install: $(TARGETS) $(PROGRAMS)
Elemer Lelik's avatar
Elemer Lelik committed
283
284
285
286
287
288
289
290
291
292
ifeq ($(DYNAMIC_LINKING), yes)
  ifeq ($(DEBUG), no)
	$(STRIP) $(SHAREDLIB) $(PARALLEL_SHAREDLIB)
  endif
endif
	mkdir -p $(LIBDIR)
	cp $(TARGETS) $(LIBDIR)
ifneq ($(FUNCTION_TEST_RUNTIME), yes)
	mkdir -p $(INCDIR)
	cp $(HEADERS) $(INCDIR)
Elemer Lelik's avatar
Elemer Lelik committed
293
294
295
296
	mkdir -p $(BINDIR)
	cp $(PROGRAMS) $(BINDIR)
	mkdir -p $(MANDIR)/man1
	cp $(MANPAGES) $(MANDIR)/man1
Elemer Lelik's avatar
Elemer Lelik committed
297
298
299
300
301
302
303
304
305
306
307
308
309
ifeq ($(DYNAMIC_LINKING), yes)
ifneq ($(OPENSSL_DIR), default)
	(cd $(OPENSSL_DIR)/lib && tar -cf - libcrypto.so*) |\
	(cd $(LIBDIR) && tar -xf -)
endif
ifneq ($(XMLDIR), default)
	(cd $(XMLDIR)/lib && tar -cf - libxml2.so*) |\
	(cd $(LIBDIR) && tar -xf -)
endif
endif
endif
	mkdir -p $(INCDIR)/$(APIDIR)
	cp $(APIDIR)/TitanLoggerApi*.hh $(INCDIR)/$(APIDIR)
Elemer Lelik's avatar
Elemer Lelik committed
310
	cp $(APIDIR)/PreGenRecordOf.hh $(INCDIR)/$(APIDIR)
Elemer Lelik's avatar
Elemer Lelik committed
311
312
313
314
315
316
317
318
319
320
321
322
323

# # # # executables
single$(RT2_SUFFIX)$(EXESUFFIX): $(LIBRARY)
	$(CXX) $(LDFLAGS) -o $@ $^ -lcrypto $($(PLATFORM)_LIBS)

single$(RT2_SUFFIX)-dynamic$(EXESUFFIX): Single_main.o $(SHAREDLIB)
	$(CXX) $(LDFLAGS) -o $@ $^ -lcrypto $($(PLATFORM)_LIBS)

parallel$(RT2_SUFFIX)$(EXESUFFIX): $(PARALLEL_LIBRARY)
	$(CXX) $(LDFLAGS) -o $@ $^ -lcrypto $($(PLATFORM)_LIBS)

parallel$(RT2_SUFFIX)-dynamic$(EXESUFFIX): Parallel_main.o $(PARALLEL_SHAREDLIB)
	$(CXX) $(LDFLAGS) -o $@ $^ -lcrypto $($(PLATFORM)_LIBS)
Elemer Lelik's avatar
Elemer Lelik committed
324
325
326
	
ttcn3_profmerge$(EXESUFFIX): $(PROFMERGE_OBJECTS)
	$(CXX) $(LDFLAGS) -o $@ $^ $(LICENSE_LIBS) $($(PLATFORM)_LIBS)
Elemer Lelik's avatar
Elemer Lelik committed
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406

# # # # static link libraries
$(LIBRARY): $(LIBRARY_OBJECTS_NOMAIN) LoggerPlugin_static.o Single_main.o
	$(AR) -r $@ $?

$(PARALLEL_LIBRARY): $(LIBRARY_OBJECTS_NOMAIN) LoggerPlugin_static.o Parallel_main.o
	$(AR) -r $@ $?

# # # # dynamic link libraries

$(SHAREDLIB): $(LIBRARY_OBJECTS_NOMAIN) LoggerPlugin_dynamic.o Single_main.o
	$(LD) $(LDFLAGS) -o $@ $^ -L$(OPENSSL_DIR)/lib -lcrypto $($(PLATFORM)_LIBS)

$(PARALLEL_SHAREDLIB): $(LIBRARY_OBJECTS_NOMAIN) LoggerPlugin_dynamic.o Parallel_main.o
	$(LD) $(LDFLAGS) -o $@ $^ -L$(OPENSSL_DIR)/lib -lcrypto $($(PLATFORM)_LIBS)

ifneq ($(FUNCTION_TEST_RUNTIME), yes)
# core2 -> core dependency, core2 does not run flex and bison
# core must be made before core2

%.lex.cc %.lex.hh: %.l
	$(FLEX) $(FLEXFLAGS) -P$(subst .l,_,$<) --header-file=$(subst .l,.lex.hh,$<) \
		-o$(subst .l,.lex.cc,$<) $<

%.tab.cc %.tab.hh: %.y %.lex.hh
	$(BISON) $(BISONFLAGS) -o $(subst .y,.tab.cc,$<) -p $(subst .y,_,$<) $<

cversion.h: gccversion$(EXESUFFIX)
	./$< > $@.tmp
	if [ -f $@ ] ; then \
	  if diff $@.tmp $@ >/dev/null ; then \
	    rm $@.tmp ; \
	  else \
	    mv $@.tmp $@ ; \
	  fi \
	else \
	  mv $@.tmp $@ ; \
	fi

gccversion$(EXESUFFIX): gccversion.c ../Makefile.cfg
# The line before the backslash is $(LINK.c), except it uses CCFLAGS
# instead of CFLAGS. TARGET_ARCH is not used by Titan.
	$(CC) $(CCFLAGS) $(CPPFLAGS) $(LDFLAGS) $(TARGET_ARCH) \
	$< $(LOADLIBES) $(LDLIBS) -o $@
endif

#LegacyLogger.d: cversion.h
$(DEPFILES): cversion.h

#TitanLoggerControlImpl.d Single_main.d Runtime.d Port.d LegacyLogger.d \
#LoggerPlugin.d LoggerPluginManager.d Error.d Default.d Communication.d \
#Addfunc.d: $(GENERATED_LOGGERAPI_SOURCES:.cc=.cc)

TitanLoggerControlImpl.d: $(GENERATED_LOGGERCONTROL_SOURCES)


$(GENERATED_LOGGERAPI_SOURCES): $(GENERATED_LOGGERAPI_SOURCES).compiled
	@if [ ! -f $@ ]; then $(RM) $<; $(MAKE) $<; fi

$(GENERATED_LOGGERAPI_SOURCES).compiled:: ../compiler2/compiler$(EXESUFFIX)
	@if [ -f $@ ]; then $(RM) $@; $(MAKE) $@; fi

$(GENERATED_LOGGERAPI_SOURCES).compiled:: $(GENERATED_MODULES)
	mkdir -p $(APIDIR)
# The input (TitanLoggerApi.ttcn) is a generated file and might get corrupted
# by parallel execution of xsd2ttcn. Get it out of the way but save it for later.
	if ../compiler2/compiler$(EXESUFFIX) $(TTCN_COMPILER_FLAGS) $^ - $?; then :; else mv $? $?.$$$$.bad; exit 1; fi
	perl $(ABS_SRC)/../core/simplify.pl $(GENERATED_LOGGERAPI_SOURCES:.cc=.hh) > $(GENERATED_LOGGERAPI_SOURCES:.cc=Simple.hh) 
	touch $@

$(GENERATED_LOGGERCONTROL_SOURCES): $(GENERATED_LOGGERCONTROL_SOURCES).compiled
	@if [ ! -f $@ ]; then $(RM) $<; $(MAKE) $<; fi

$(GENERATED_LOGGERCONTROL_SOURCES).compiled:: ../compiler2/compiler$(EXESUFFIX)
	@if [ -f $@ ]; then $(RM) $@; $(MAKE) $@; fi

$(GENERATED_LOGGERCONTROL_SOURCES).compiled:: TitanLoggerControl.ttcn
	mkdir -p $(APIDIR)
	../compiler2/compiler$(EXESUFFIX) $(TTCN_COMPILER_FLAGS) $^ - $?
	touch $@
Elemer Lelik's avatar
Elemer Lelik committed
407
408
409
410
411
412
413
414
415
416
417
	
$(PREGENERATED_SOURCES): $(PREGENERATED_SOURCES).compiled
	@if [ ! -f $@ ]; then $(RM) $<; $(MAKE) $<; fi

$(PREGENERATED_SOURCES).compiled:: ../compiler2/compiler$(EXESUFFIX)
	@if [ -f $@ ]; then $(RM) $@; $(MAKE) $@; fi

$(PREGENERATED_SOURCES).compiled:: $(PREGENERATOR_MODULES)
	mkdir -p $(APIDIR)
	../compiler2/compiler$(EXESUFFIX) -F $(TTCN_COMPILER_FLAGS) $^ - $?
	touch $@
Elemer Lelik's avatar
Elemer Lelik committed
418
	
Elemer Lelik's avatar
Elemer Lelik committed
419
420
421
422
423
include ../Makefile.genrules

# These are not in STATIC_SOURCES, so vpath is not created for them
vpath LoggerPlugin_dynamic.cc $(ABS_SRC)
vpath LoggerPlugin_static.cc  $(ABS_SRC)