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
13 ##############################################################################
15 include ${TOPDIR}/Makefile.regression
18 # Do NOT touch this line...
20 .PHONY
: all archive
check clean dep objects
25 # Set these variables...
28 # The path of your TTCN-3 Test Executor installation:
29 # Uncomment this line to override the environment variable.
32 # Your platform: (SOLARIS, SOLARIS8, LINUX, FREEBSD or WIN32)
36 # (if you change the platform, you may need to change the compiler)
39 # Flags for the C++ preprocessor (and makedepend as well):
40 CPPFLAGS
= -D
$(PLATFORM
) -I
$(TTCN3_DIR
)/include
42 # Flags for dependency generation
45 # Flags for the C++ compiler:
48 # Flags for the linker:
51 ifeq ($(PLATFORM
), WIN32
)
52 # Silence linker warnings.
53 LDFLAGS
+= -Wl
,--enable-auto-import
,--enable-runtime-pseudo-reloc
56 # Flags for the TTCN-3 and ASN.1 compiler:
59 # Execution mode: (either ttcn3 or ttcn3-parallel)
60 TTCN3_LIB
= ttcn3-parallel
62 # The path of your OpenSSL installation:
63 # If you do not have your own one, leave it unchanged.
64 OPENSSL_DIR
= $(TTCN3_DIR
)
66 # The path of your libxml2 installation:
67 # If you do not have your own one, leave it unchanged.
70 # Directory to store the archived source files:
74 # You may change these variables. Add your files if necessary...
77 # TTCN-3 modules of this project:
78 TTCN3_MODULES
= Titan_LogTestDefinitions.ttcn Titan_LogTest.ttcn
80 # ASN.1 modules of this project:
83 # C++ source & header files generated from the TTCN-3 & ASN.1 modules of
85 GENERATED_SOURCES
= $(TTCN3_MODULES
:.ttcn
=.
cc) $(ASN1_MODULES
:.asn
=.
cc)
86 GENERATED_HEADERS
= $(GENERATED_SOURCES
:.
cc=.hh
)
88 # C/C++ Source & header files of Test Ports, external functions and
90 USER_SOURCES
= PCO_PT.
cc
91 USER_HEADERS
= $(USER_SOURCES
:.
cc=.hh
)
93 # Object files of this project that are needed for the executable test suite:
94 OBJECTS
= $(GENERATED_OBJECTS
) $(USER_OBJECTS
)
96 GENERATED_OBJECTS
= $(GENERATED_SOURCES
:.
cc=.o
)
98 USER_OBJECTS
= $(USER_SOURCES
:.
cc=.o
)
100 DEPFILES
= $(USER_OBJECTS
:.o
=.d
) $(GENERATED_OBJECTS
:.o
=.d
)
102 # Other files of the project (Makefile, configuration files, etc.)
103 # that will be added to the archived source files:
104 OTHER_FILES
= Makefile
106 # The name of the executable test suite:
107 TARGET
= Titan_LogTest
110 # Do not modify these unless you know what you are doing...
111 # Platform specific additional libraries:
113 SOLARIS_LIBS
+= -lsocket
-lnsl
-lxml2
114 SOLARIS8_LIBS
+= -lsocket
-lnsl
-lxml2
116 FREEBSD_LIBS
+= -lxml2
120 # Rules for building the executable...
125 objects
: $(OBJECTS
) compile
;
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
135 $(CXX
) -c
$(CPPFLAGS
) $(CXXFLAGS
) -o
$@
$<
138 @echo Creating dependency file for
'$<'; set
-e
; \
139 $(CXX
) $(CXXDEPFLAGS
) $(CPPFLAGS
) $(CXXFLAGS
) $< \
140 | sed
's/\($*\)\.o[ :]*/\1.o $@ : /g' > $@
; \
141 [ -s
$@
] ||
rm -f
$@
143 $(GENERATED_SOURCES
) $(GENERATED_HEADERS
): compile
144 @if
[ ! -f
$@
]; then
$(RM
) compile
; $(MAKE
) compile
; fi
146 check: $(TTCN3_MODULES
) $(ASN1_MODULES
)
147 $(TTCN3_DIR
)/bin
/compiler
-s
$(COMPILER_FLAGS
) $^
149 compile
: $(TTCN3_MODULES
) $(ASN1_MODULES
)
150 $(TTCN3_DIR
)/bin
/compiler
$(COMPILER_FLAGS
) $^
- $?
154 -$(RM
) $(TARGET
) $(OBJECTS
) $(GENERATED_HEADERS
) \
155 $(GENERATED_SOURCES
) compile
$(DEPFILES
) \
158 dep
: $(GENERATED_SOURCES
) $(USER_SOURCES
) ;
160 ifeq ($(findstring n
,$(MAKEFLAGS
)),)
161 ifeq ($(filter clean check compile archive diag
,$(MAKECMDGOALS
)),)
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
173 $(TTCN3_DIR
)/bin
/compiler
-v
2>&1
174 $(TTCN3_DIR
)/bin
/mctr_cli
-v
2>&1
176 @echo TTCN3_DIR
=$(TTCN3_DIR
)
177 @echo OPENSSL_DIR
=$(OPENSSL_DIR
)
178 @echo XMLDIR
=$(XMLDIR
)
179 @echo PLATFORM
=$(PLATFORM
)
182 # Add your rules here if necessary...