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