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