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 ###############################################################################
9 include ${TOPDIR}/Makefile.regression
12 # Do NOT touch this line...
14 .PHONY
: all archive
check clean dep objects
19 # Set these variables...
22 # The path of your TTCN-3 Test Executor installation:
23 # Uncomment this line to override the environment variable.
26 # Your platform: (SOLARIS, SOLARIS8, LINUX, FREEBSD or WIN32)
30 # (if you change the platform, you may need to change the compiler)
33 # Flags for the C++ preprocessor (and makedepend as well):
34 CPPFLAGS
= -D
$(PLATFORM
) -I
$(TTCN3_DIR
)/include
36 # Flags for dependency generation
39 # Flags for the C++ compiler:
42 # Flags for the linker:
45 ifeq ($(PLATFORM
), WIN32
)
46 # Silence linker warnings.
47 LDFLAGS
+= -Wl
,--enable-auto-import
,--enable-runtime-pseudo-reloc
50 # Flags for the TTCN-3 and ASN.1 compiler:
53 # Execution mode: (either ttcn3 or ttcn3-parallel)
54 TTCN3_LIB
= ttcn3-parallel
56 # The path of your OpenSSL installation:
57 # If you do not have your own one, leave it unchanged.
58 OPENSSL_DIR
= $(TTCN3_DIR
)
60 # The path of your libxml2 installation:
61 # If you do not have your own one, leave it unchanged.
64 # Directory to store the archived source files:
68 # You may change these variables. Add your files if necessary...
71 # TTCN-3 modules of this project:
72 TTCN3_MODULES
= Titan_LogTestDefinitions.ttcn Titan_LogTest.ttcn
74 # ASN.1 modules of this project:
77 # C++ source & header files generated from the TTCN-3 & ASN.1 modules of
79 GENERATED_SOURCES
= $(TTCN3_MODULES
:.ttcn
=.
cc) $(ASN1_MODULES
:.asn
=.
cc)
80 GENERATED_HEADERS
= $(GENERATED_SOURCES
:.
cc=.hh
)
82 # C/C++ Source & header files of Test Ports, external functions and
84 USER_SOURCES
= PCO_PT.
cc
85 USER_HEADERS
= $(USER_SOURCES
:.
cc=.hh
)
87 # Object files of this project that are needed for the executable test suite:
88 OBJECTS
= $(GENERATED_OBJECTS
) $(USER_OBJECTS
)
90 GENERATED_OBJECTS
= $(GENERATED_SOURCES
:.
cc=.o
)
92 USER_OBJECTS
= $(USER_SOURCES
:.
cc=.o
)
94 DEPFILES
= $(USER_OBJECTS
:.o
=.d
) $(GENERATED_OBJECTS
:.o
=.d
)
96 # Other files of the project (Makefile, configuration files, etc.)
97 # that will be added to the archived source files:
98 OTHER_FILES
= Makefile
100 # The name of the executable test suite:
101 TARGET
= Titan_LogTest
104 # Do not modify these unless you know what you are doing...
105 # Platform specific additional libraries:
107 SOLARIS_LIBS
+= -lsocket
-lnsl
-lxml2
108 SOLARIS8_LIBS
+= -lsocket
-lnsl
-lxml2
110 FREEBSD_LIBS
+= -lxml2
114 # Rules for building the executable...
119 objects
: $(OBJECTS
) compile
;
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
129 $(CXX
) -c
$(CPPFLAGS
) $(CXXFLAGS
) -o
$@
$<
132 @echo Creating dependency file for
'$<'; set
-e
; \
133 $(CXX
) $(CXXDEPFLAGS
) $(CPPFLAGS
) $(CXXFLAGS
) $< \
134 | sed
's/\($*\)\.o[ :]*/\1.o $@ : /g' > $@
; \
135 [ -s
$@
] ||
rm -f
$@
137 $(GENERATED_SOURCES
) $(GENERATED_HEADERS
): compile
138 @if
[ ! -f
$@
]; then
$(RM
) compile
; $(MAKE
) compile
; fi
140 check: $(TTCN3_MODULES
) $(ASN1_MODULES
)
141 $(TTCN3_DIR
)/bin
/compiler
-s
$(COMPILER_FLAGS
) $^
143 compile
: $(TTCN3_MODULES
) $(ASN1_MODULES
)
144 $(TTCN3_DIR
)/bin
/compiler
$(COMPILER_FLAGS
) $^
- $?
148 -$(RM
) $(TARGET
) $(OBJECTS
) $(GENERATED_HEADERS
) \
149 $(GENERATED_SOURCES
) compile
$(DEPFILES
) \
152 dep
: $(GENERATED_SOURCES
) $(USER_SOURCES
) ;
154 ifeq ($(findstring n
,$(MAKEFLAGS
)),)
155 ifeq ($(filter clean check compile archive diag
,$(MAKECMDGOALS
)),)
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
167 $(TTCN3_DIR
)/bin
/compiler
-v
2>&1
168 $(TTCN3_DIR
)/bin
/mctr_cli
-v
2>&1
170 @echo TTCN3_DIR
=$(TTCN3_DIR
)
171 @echo OPENSSL_DIR
=$(OPENSSL_DIR
)
172 @echo XMLDIR
=$(XMLDIR
)
173 @echo PLATFORM
=$(PLATFORM
)
176 # Add your rules here if necessary...