Titan Core Initial Contribution
[deliverable/titan.core.git] / regression_test / XML / HM60295 / Makefile
1 ###############################################################################
2 # Copyright (c) 2000-2014 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 TOPDIR := ../..
9 include ../../Makefile.regression
10
11 .SUFFIXES: .ttcn .hh .cc .d
12 .PHONY: all clean dep run convert
13
14 # Execution mode: (either ttcn3 or ttcn3-parallel)
15 TTCN3_LIB := ttcn3$(RT2_SUFFIX)$(DYNAMIC_SUFFIX)
16
17 #CPPFLAGS
18 #CXXFLAGS
19 #COMPILER_FLAGS +=
20
21 GENERATED_TTCN := XSD.ttcn UsefulTtcn3Types.ttcn \
22 www_example_org_Schema1.ttcn www_example_org_Schema2.ttcn www_example_org_Import.ttcn
23
24 TTCN3_MODULES := tester.ttcn $(GENERATED_TTCN)
25
26 #ttcn_ericsson_se_protocolModules_xtdp1_0_xtdl2.ttcn
27 #ttcn_ericsson_se_protocolModules_xtdp1_0_xtdl.ttcn
28
29 GENERATED_SOURCES := $(TTCN3_MODULES:.ttcn=.cc)
30 GENERATED_HEADERS := $(GENERATED_SOURCES:.cc=.hh)
31 ifdef CODE_SPLIT
32 GENERATED_SOURCES := $(foreach file, $(GENERATED_SOURCES:.cc=), $(addprefix $(file), .cc _seq.cc _set.cc _seqof.cc _setof.cc _union.cc))
33 endif
34 USER_SOURCES =
35 USER_HEADERS = $(USER_SOURCES:.cc=.hh)
36
37 OBJECTS = $(GENERATED_SOURCES:.cc=.o) $(USER_SOURCES:.cc=.o)
38
39 DEPFILES := $(OBJECTS:.o=.d)
40
41 TARGET = Schemas$(EXESUFFIX)
42
43 all: $(TARGET)
44
45 ifeq ($(findstring dynamic,$(TTCN3_LIB)),)
46 # not dynamic
47 CORELIB_BINARY := $(TTCN3_DIR)/lib/lib$(TTCN3_LIB).a
48 else
49 CORELIB_BINARY := $(TTCN3_DIR)/lib/lib$(TTCN3_LIB).so
50 endif
51
52 # libttcn3.a appears twice; this should be harmless
53 $(TARGET): $(OBJECTS) $(CORELIB_BINARY)
54 $(CXX) $(LDFLAGS) -o $@ $(OBJECTS) \
55 -L$(TTCN3_DIR)/lib -l$(TTCN3_LIB) \
56 -L$(OPENSSL_DIR)/lib -lcrypto $($(PLATFORM)_LIBS) \
57 || $(TTCN3_DIR)/bin/titanver $(OBJECTS)
58
59 %.o: %.cc
60 @echo '(C++)' $<; $(CXX) -c $(CPPFLAGS) $(CXXFLAGS) $<
61
62 %.d: %.cc
63 @echo '(dep)' $<; $(CXX) -MM -MP -MF $@ $(CPPFLAGS) $(CXXFLAGS) $<
64
65 $(GENERATED_SOURCES) $(GENERATED_HEADERS): compile
66 @if [ ! -f $@ ]; then $(RM) compile; $(MAKE) compile; fi
67
68
69 compile:: $(firstword $(TTCN3_COMPILER))
70 @if [ -f $@ ]; then $(RM) compile; $(MAKE) compile; fi
71 # if [ -f $(GENERATED_SOURCES) ]; then rm -f $(GENERATED_SOURCES); $(MAKE) $(GENERATED_SOURCES); fi
72
73 compile:: $(TTCN3_MODULES) $(PREPROCESSED_TTCN3_MODULES) $(ASN1_MODULES)
74 # "modulepar boolean verbose" makes this unusable with old names
75 $(TTCN3_COMPILER) $(COMPILER_FLAGS) $^ - $?
76 touch $@
77
78 clean celan clena:
79 -$(RM) $(TARGET) $(OBJECTS) $(GENERATED_HEADERS) \
80 $(GENERATED_SOURCES) $(PREPROCESSED_TTCN3_MODULES) compile \
81 tags *.log
82
83 distclean: clean
84 rm -f $(GENERATED_TTCN) $(DEPFILES)
85
86 $(GENERATED_TTCN) convert: Schema1.xsd Schema2.xsd Importer.xsd
87 $(TTCN3_DIR)/bin/xsd2ttcn -z $^
88
89 RUN := $(shell which colortitan 2>/dev/null)
90 ifeq ($(firstword $(RUN)),no)
91 # stupid /bin/which on Solaris writes errors to stdout instead of stderr
92 RUN :=
93 endif
94
95 run: $(TARGET) config.cfg
96 $(RUN) ./$^
97
98 debug:
99 $(MAKE) run RUN='gdb --args'
100
101
102 dep: ;
103
104 ifeq (,$(findstring n,$(MAKEFLAGS)))
105 ifeq (,$(filter clean distclean,$(MAKECMDGOALS)))
106 #-include $(DEPFILES)
107 endif
108 endif
109
110 vpath %.xsd $(ABS_SRC)
111
This page took 0.037911 seconds and 5 git commands to generate.