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