Commit | Line | Data |
---|---|---|
970ed795 EL |
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 | # WARNING! This Makefile can be used with GNU make only. | |
12 | # Other versions of make may report syntax errors in it. | |
13 | ||
14 | # | |
15 | # Do NOT touch this line... | |
16 | # | |
17 | .PHONY: all archive check clean dep objects | |
18 | ||
19 | .SUFFIXES: .d | |
20 | ||
21 | # | |
22 | # Set these variables... | |
23 | # | |
24 | ||
25 | ||
26 | # Flags for the C++ preprocessor (and makedepend as well): | |
27 | #CPPFLAGS += | |
28 | ||
29 | # Flags for dependency generation | |
30 | CXXDEPFLAGS = -MM | |
31 | ||
32 | # Flags for the C++ compiler: | |
33 | #CXXFLAGS += | |
34 | ||
35 | # Flags for the linker: | |
36 | #LDFLAGS += | |
37 | ||
38 | ||
39 | # Flags for the TTCN-3 and ASN.1 compiler: | |
40 | COMPILER_FLAGS += -Lg | |
41 | ||
42 | # Execution mode: (either ttcn3 or ttcn3-parallel) | |
43 | TTCN3_LIB = ttcn3$(RT2_SUFFIX)-parallel$(DYNAMIC_SUFFIX) | |
44 | ||
45 | # | |
46 | # You may change these variables. Add your files if necessary... | |
47 | # | |
48 | ||
49 | # TTCN-3 modules of this project: | |
50 | TTCN3_MODULES = concat.ttcn | |
51 | ||
52 | # ASN.1 modules of this project: | |
53 | ASN1_MODULES = | |
54 | ||
55 | # C++ source & header files generated from the TTCN-3 & ASN.1 modules of | |
56 | # this project: | |
57 | GENERATED_SOURCES = $(TTCN3_MODULES:.ttcn=.cc) $(ASN1_MODULES:.asn=.cc) | |
58 | GENERATED_HEADERS = $(GENERATED_SOURCES:.cc=.hh) | |
59 | ||
60 | # C/C++ Source & header files of Test Ports, external functions and | |
61 | # other modules: | |
62 | USER_SOURCES = | |
63 | USER_HEADERS = $(USER_SOURCES:.cc=.hh) | |
64 | ||
65 | # Object files of this project that are needed for the executable test suite: | |
66 | OBJECTS = $(GENERATED_OBJECTS) $(USER_OBJECTS) | |
67 | ||
68 | GENERATED_OBJECTS = $(GENERATED_SOURCES:.cc=.o) | |
69 | ||
70 | USER_OBJECTS = $(USER_SOURCES:.cc=.o) | |
71 | ||
72 | DEPFILES = $(USER_OBJECTS:.o=.d) $(GENERATED_OBJECTS:.o=.d) | |
73 | ||
74 | # Other files of the project (Makefile, configuration files, etc.) | |
75 | # that will be added to the archived source files: | |
76 | OTHER_FILES = config.cfg Makefile | |
77 | ||
78 | # The name of the executable test suite: | |
79 | TARGET = concat | |
80 | ||
81 | # | |
82 | # Rules for building the executable... | |
83 | # | |
84 | ||
85 | all: $(TARGET) ; | |
86 | ||
87 | objects: $(OBJECTS) compile; | |
88 | ||
89 | $(TARGET): $(OBJECTS) | |
90 | if $(CXX) $(LDFLAGS) -o $@ $^ \ | |
91 | -L$(TTCN3_DIR)/lib -l$(TTCN3_LIB) \ | |
92 | -L$(OPENSSL_DIR)/lib -lcrypto \ | |
93 | -L$(XMLDIR)/lib $($(PLATFORM)_LIBS); \ | |
94 | then : ; else $(TTCN3_DIR)/bin/titanver $(OBJECTS); exit 1; fi | |
95 | ||
96 | .cc.o .c.o: | |
97 | $(CXX) -c $(CPPFLAGS) $(CXXFLAGS) -o $@ $< | |
98 | ||
99 | .cc.d .c.d: | |
100 | @echo Creating dependency file for '$<'; set -e; \ | |
101 | $(CXX) $(CXXDEPFLAGS) $(CPPFLAGS) $(CXXFLAGS) $< \ | |
102 | | sed 's/\($*\)\.o[ :]*/\1.o $@ : /g' > $@; \ | |
103 | [ -s $@ ] || rm -f $@ | |
104 | ||
105 | $(GENERATED_SOURCES) $(GENERATED_HEADERS): compile | |
106 | @if [ ! -f $@ ]; then $(RM) compile; $(MAKE) compile; fi | |
107 | ||
108 | compile: $(TTCN3_MODULES) $(ASN1_MODULES) | |
109 | $(TTCN3_DIR)/bin/compiler $(COMPILER_FLAGS) $^ - $? | |
110 | touch $@ | |
111 | ||
112 | clean: | |
113 | -$(RM) $(TARGET) $(OBJECTS) $(GENERATED_HEADERS) \ | |
114 | $(GENERATED_SOURCES) compile \ | |
115 | tags *.log | |
116 | ||
117 | distclean: clean | |
118 | -$(RM) $(DEPFILES) | |
119 | ||
120 | dep: $(GENERATED_SOURCES) $(USER_SOURCES) ; | |
121 | ||
122 | ifeq ($(findstring n,$(MAKEFLAGS)),) | |
123 | ifeq ($(filter clean distclean check compile archive diag,$(MAKECMDGOALS)),) | |
124 | -include $(DEPFILES) | |
125 | endif | |
126 | endif | |
127 | ||
128 | ||
129 | diag: | |
130 | $(TTCN3_DIR)/bin/compiler -v 2>&1 | |
131 | $(TTCN3_DIR)/bin/mctr_cli -v 2>&1 | |
132 | $(CXX) -v 2>&1 | |
133 | @echo TTCN3_DIR=$(TTCN3_DIR) | |
134 | @echo OPENSSL_DIR=$(OPENSSL_DIR) | |
135 | @echo XMLDIR=$(XMLDIR) | |
136 | @echo PLATFORM=$(PLATFORM) | |
137 | ||
138 | # | |
139 | # Add your rules here if necessary... | |
140 | # | |
141 | ||
142 | RUN := $(shell which colortitan 2>/dev/null) | |
143 | ifeq ($(firstword $(RUN)),no) | |
144 | # stupid /bin/which on Solaris writes errors to stdout instead of stderr | |
145 | RUN := | |
146 | endif | |
147 | ||
148 | run: $(TARGET) everything.cfg | |
149 | ifeq ($(findstring parallel,$(TTCN3_LIB)),) | |
150 | $(RUN) ./$^ | |
151 | else | |
152 | $(TTCN3_DIR)/bin/ttcn3_start $^ | |
153 | endif | |
154 | ||
155 | debug: | |
156 | $(MAKE) run RUN='gdb --args' | |
157 | ||
158 | # The end |