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 | # Baranyi, Botond | |
12 | # Raduly, Csaba | |
14e21cff | 13 | # Szabo, Bence Janos |
d44e3c4f | 14 | # |
15 | ############################################################################## | |
970ed795 EL |
16 | TOPDIR := .. |
17 | include ../Makefile.regression | |
18 | ||
19 | # WARNING! This Makefile can be used with GNU make only. | |
20 | # Other versions of make may report syntax errors in it. | |
21 | ||
22 | # | |
23 | # Do NOT touch this line... | |
24 | # | |
25 | .PHONY: all archive check clean dep objects | |
26 | ||
27 | .SUFFIXES: .d | |
28 | ||
29 | # | |
30 | # Set these variables... | |
31 | # | |
32 | ||
33 | # Flags for the C++ preprocessor (and makedepend as well): | |
34 | #CPPFLAGS += | |
35 | ||
36 | # Flags for dependency generation | |
37 | CXXDEPFLAGS = -MM | |
38 | ||
39 | # Flags for the C++ compiler: | |
40 | CXXFLAGS += -g | |
41 | ||
42 | # Flags for the linker: | |
a38c6d4c | 43 | #LDFLAGS += -g -rdynamic |
970ed795 EL |
44 | |
45 | ||
46 | # Flags for the TTCN-3 and ASN.1 compiler: | |
47 | #COMPILER_FLAGS = -L | |
48 | ||
49 | # Execution mode: (either ttcn3 or ttcn3-parallel) | |
50 | TTCN3_LIB = ttcn3$(RT2_SUFFIX)$(DYNAMIC_SUFFIX) | |
51 | ||
52 | # | |
53 | # You may change these variables. Add your files if necessary... | |
54 | # | |
55 | ||
56 | # TTCN-3 modules of this project: | |
57 | TTCN3_MODULES = tcdefparam.ttcn | |
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) | |
14e21cff | 66 | ifdef SPLIT_TO_SLICES |
67 | POSTFIXES := $(foreach file, $(SPLIT_TO_SLICES), $(addsuffix $(file), _part_)) | |
68 | POSTFIXES := $(foreach file, $(POSTFIXES), $(addprefix $(file), .cc)) | |
69 | GENERATED_SOURCES2 := $(foreach file, $(GENERATED_SOURCES:.cc=), $(addprefix $(file), $(POSTFIXES))) | |
70 | GENERATED_SOURCES += $(GENERATED_SOURCES2) | |
71 | endif | |
970ed795 EL |
72 | # C/C++ Source & header files of Test Ports, external functions and |
73 | # other modules: | |
74 | USER_SOURCES = | |
75 | USER_HEADERS = $(USER_SOURCES:.cc=.hh) | |
76 | ||
77 | # Object files of this project that are needed for the executable test suite: | |
78 | OBJECTS = $(GENERATED_OBJECTS) $(USER_OBJECTS) | |
79 | ||
80 | GENERATED_OBJECTS = $(GENERATED_SOURCES:.cc=.o) | |
81 | ||
82 | USER_OBJECTS = $(USER_SOURCES:.cc=.o) | |
83 | ||
84 | DEPFILES = $(USER_OBJECTS:.o=.d) $(GENERATED_OBJECTS:.o=.d) | |
85 | ||
86 | # Other files of the project (Makefile, configuration files, etc.) | |
87 | # that will be added to the archived source files: | |
88 | OTHER_FILES = config.cfg Makefile | |
89 | ||
90 | # The name of the executable test suite: | |
91 | TARGET = tcdefparam | |
92 | ||
93 | # | |
94 | # Rules for building the executable... | |
95 | # | |
96 | ||
97 | all: $(TARGET) ; | |
98 | ||
99 | objects: $(OBJECTS) compile; | |
100 | ||
101 | $(TARGET): $(OBJECTS) | |
102 | if $(CXX) $(LDFLAGS) -o $@ $^ \ | |
103 | -L$(TTCN3_DIR)/lib -l$(TTCN3_LIB) \ | |
104 | -L$(OPENSSL_DIR)/lib -lcrypto \ | |
105 | -L$(XMLDIR)/lib $($(PLATFORM)_LIBS); \ | |
106 | then : ; else $(TTCN3_DIR)/bin/titanver $(OBJECTS); exit 1; fi | |
107 | ||
108 | .cc.o .c.o: | |
109 | $(CXX) -c $(CPPFLAGS) $(CXXFLAGS) -o $@ $< | |
110 | ||
111 | .cc.d .c.d: | |
112 | @echo Creating dependency file for '$<'; set -e; \ | |
113 | $(CXX) $(CXXDEPFLAGS) $(CPPFLAGS) $(CXXFLAGS) $< \ | |
114 | | sed 's/\($*\)\.o[ :]*/\1.o $@ : /g' > $@; \ | |
115 | [ -s $@ ] || rm -f $@ | |
116 | ||
117 | $(GENERATED_SOURCES) $(GENERATED_HEADERS): compile | |
118 | @if [ ! -f $@ ]; then $(RM) compile; $(MAKE) compile; fi | |
119 | ||
120 | compile: $(TTCN3_MODULES) $(ASN1_MODULES) | |
121 | $(TTCN3_COMPILER) $(COMPILER_FLAGS) $^ - $? | |
122 | touch $@ | |
123 | ||
124 | clean: | |
125 | -$(RM) $(TARGET) $(OBJECTS) $(GENERATED_HEADERS) \ | |
126 | $(GENERATED_SOURCES) compile $(DEPFILES) \ | |
127 | tags *.log | |
128 | ||
129 | distclean: clean | |
130 | -$(RM) $(DEPFILES) | |
131 | ||
132 | dep: $(GENERATED_SOURCES) $(USER_SOURCES) ; | |
133 | ||
134 | ifeq ($(findstring n,$(MAKEFLAGS)),) | |
135 | ifeq ($(filter clean distclean check compile archive diag,$(MAKECMDGOALS)),) | |
136 | -include $(DEPFILES) | |
137 | endif | |
138 | endif | |
139 | ||
140 | diag: | |
141 | $(TTCN3_DIR)/bin/compiler -v 2>&1 | |
142 | $(TTCN3_DIR)/bin/mctr_cli -v 2>&1 | |
143 | $(CXX) -v 2>&1 | |
144 | @echo TTCN3_DIR=$(TTCN3_DIR) | |
145 | @echo OPENSSL_DIR=$(OPENSSL_DIR) | |
146 | @echo XMLDIR=$(XMLDIR) | |
147 | @echo PLATFORM=$(PLATFORM) | |
148 | ||
149 | # If using -dynamic runtime, the following may be needed: | |
150 | # LD_LIBRARY_PATH=${TTCN3_DIR}/lib:${LD_LIBRARY_PATH} | |
151 | run: $(TARGET) config.cfg | |
152 | ./$^ | |
153 | # Run each testcase from the command line (but not the control part) | |
154 | for t in `./${TARGET} -l | egrep '^[^ ]*\.[^ ]*' | grep -vw control` ; do ./$^ $$t; done |