Sync with 5.4.0
[deliverable/titan.core.git] / regression_test / logger / logtest / Makefile
1 ###############################################################################
2 # Copyright (c) 2000-2015 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 ${TOPDIR}/Makefile.regression
10
11 #
12 # Do NOT touch this line...
13 #
14 .PHONY: all archive check clean dep objects
15
16 .SUFFIXES: .d
17
18 #
19 # Set these variables...
20 #
21
22 # The path of your TTCN-3 Test Executor installation:
23 # Uncomment this line to override the environment variable.
24 # TTCN3_DIR =
25
26 # Your platform: (SOLARIS, SOLARIS8, LINUX, FREEBSD or WIN32)
27 #PLATFORM = LINUX
28
29 # Your C++ compiler:
30 # (if you change the platform, you may need to change the compiler)
31 CXX = g++
32
33 # Flags for the C++ preprocessor (and makedepend as well):
34 CPPFLAGS = -D$(PLATFORM) -I$(TTCN3_DIR)/include
35
36 # Flags for dependency generation
37 CXXDEPFLAGS = -MM
38
39 # Flags for the C++ compiler:
40 CXXFLAGS = -Wall
41
42 # Flags for the linker:
43 LDFLAGS =
44
45 ifeq ($(PLATFORM), WIN32)
46 # Silence linker warnings.
47 LDFLAGS += -Wl,--enable-auto-import,--enable-runtime-pseudo-reloc
48 endif
49
50 # Flags for the TTCN-3 and ASN.1 compiler:
51 COMPILER_FLAGS = -L
52
53 # Execution mode: (either ttcn3 or ttcn3-parallel)
54 TTCN3_LIB = ttcn3-parallel
55
56 # The path of your OpenSSL installation:
57 # If you do not have your own one, leave it unchanged.
58 OPENSSL_DIR = $(TTCN3_DIR)
59
60 # The path of your libxml2 installation:
61 # If you do not have your own one, leave it unchanged.
62 XMLDIR = $(TTCN3_DIR)
63
64 # Directory to store the archived source files:
65 ARCHIVE_DIR = backup
66
67 #
68 # You may change these variables. Add your files if necessary...
69 #
70
71 # TTCN-3 modules of this project:
72 TTCN3_MODULES = Titan_LogTestDefinitions.ttcn Titan_LogTest.ttcn
73
74 # ASN.1 modules of this project:
75 ASN1_MODULES =
76
77 # C++ source & header files generated from the TTCN-3 & ASN.1 modules of
78 # this project:
79 GENERATED_SOURCES = $(TTCN3_MODULES:.ttcn=.cc) $(ASN1_MODULES:.asn=.cc)
80 GENERATED_HEADERS = $(GENERATED_SOURCES:.cc=.hh)
81
82 # C/C++ Source & header files of Test Ports, external functions and
83 # other modules:
84 USER_SOURCES = PCO_PT.cc
85 USER_HEADERS = $(USER_SOURCES:.cc=.hh)
86
87 # Object files of this project that are needed for the executable test suite:
88 OBJECTS = $(GENERATED_OBJECTS) $(USER_OBJECTS)
89
90 GENERATED_OBJECTS = $(GENERATED_SOURCES:.cc=.o)
91
92 USER_OBJECTS = $(USER_SOURCES:.cc=.o)
93
94 DEPFILES = $(USER_OBJECTS:.o=.d) $(GENERATED_OBJECTS:.o=.d)
95
96 # Other files of the project (Makefile, configuration files, etc.)
97 # that will be added to the archived source files:
98 OTHER_FILES = Makefile
99
100 # The name of the executable test suite:
101 TARGET = Titan_LogTest
102
103 #
104 # Do not modify these unless you know what you are doing...
105 # Platform specific additional libraries:
106 #
107 SOLARIS_LIBS = -lsocket -lnsl -lxml2
108 SOLARIS8_LIBS = -lsocket -lnsl -lxml2
109 LINUX_LIBS = -lxml2
110 FREEBSD_LIBS = -lxml2
111 WIN32_LIBS = -lxml2
112
113 #
114 # Rules for building the executable...
115 #
116
117 all: $(TARGET) ;
118
119 objects: $(OBJECTS) compile;
120
121 $(TARGET): $(OBJECTS)
122 if $(CXX) $(LDFLAGS) -o $@ $^ \
123 -L$(TTCN3_DIR)/lib -l$(TTCN3_LIB) \
124 -L$(OPENSSL_DIR)/lib -lcrypto \
125 -L$(XMLDIR)/lib $($(PLATFORM)_LIBS); \
126 then : ; else $(TTCN3_DIR)/bin/titanver $(OBJECTS); exit 1; fi
127
128 .cc.o .c.o:
129 $(CXX) -c $(CPPFLAGS) $(CXXFLAGS) -o $@ $<
130
131 .cc.d .c.d:
132 @echo Creating dependency file for '$<'; set -e; \
133 $(CXX) $(CXXDEPFLAGS) $(CPPFLAGS) $(CXXFLAGS) $< \
134 | sed 's/\($*\)\.o[ :]*/\1.o $@ : /g' > $@; \
135 [ -s $@ ] || rm -f $@
136
137 $(GENERATED_SOURCES) $(GENERATED_HEADERS): compile
138 @if [ ! -f $@ ]; then $(RM) compile; $(MAKE) compile; fi
139
140 check: $(TTCN3_MODULES) $(ASN1_MODULES)
141 $(TTCN3_DIR)/bin/compiler -s $(COMPILER_FLAGS) $^
142
143 compile: $(TTCN3_MODULES) $(ASN1_MODULES)
144 $(TTCN3_DIR)/bin/compiler $(COMPILER_FLAGS) $^ - $?
145 touch $@
146
147 clean distclean:
148 -$(RM) $(TARGET) $(OBJECTS) $(GENERATED_HEADERS) \
149 $(GENERATED_SOURCES) compile $(DEPFILES) \
150 tags *c.log
151
152 dep: $(GENERATED_SOURCES) $(USER_SOURCES) ;
153
154 ifeq ($(findstring n,$(MAKEFLAGS)),)
155 ifeq ($(filter clean check compile archive diag,$(MAKECMDGOALS)),)
156 -include $(DEPFILES)
157 endif
158 endif
159
160 archive:
161 mkdir -p $(ARCHIVE_DIR)
162 tar -cvhf - $(TTCN3_MODULES) $(ASN1_MODULES) \
163 $(USER_HEADERS) $(USER_SOURCES) $(OTHER_FILES) \
164 | gzip >$(ARCHIVE_DIR)/`basename $(TARGET) .exe`-`date '+%y%m%d-%H%M'`.tgz
165
166 diag:
167 $(TTCN3_DIR)/bin/compiler -v 2>&1
168 $(TTCN3_DIR)/bin/mctr_cli -v 2>&1
169 $(CXX) -v 2>&1
170 @echo TTCN3_DIR=$(TTCN3_DIR)
171 @echo OPENSSL_DIR=$(OPENSSL_DIR)
172 @echo XMLDIR=$(XMLDIR)
173 @echo PLATFORM=$(PLATFORM)
174
175 #
176 # Add your rules here if necessary...
177 #
178 run: $(TARGET)
179 ./logtest.sh
180
This page took 0.070164 seconds and 5 git commands to generate.