OSDN Git Service

* acconfig.h: Add _GLIBCXX_USE_C99_MATH.
[pf3gnuchains/gcc-fork.git] / libstdc++-v3 / testsuite / Makefile.am
1 ## Makefile for the testsuite subdirectory of the GNU C++ Standard library.
2 ##
3 ## Copyright (C) 2001, 2002, 2003 Free Software Foundation, Inc.
4 ##
5 ## This file is part of the libstdc++ version 3 distribution.
6 ## Process this file with automake to produce Makefile.in.
7
8 ## This file is part of the GNU ISO C++ Library.  This library is free
9 ## software; you can redistribute it and/or modify it under the
10 ## terms of the GNU General Public License as published by the
11 ## Free Software Foundation; either version 2, or (at your option)
12 ## any later version.
13
14 ## This library is distributed in the hope that it will be useful,
15 ## but WITHOUT ANY WARRANTY; without even the implied warranty of
16 ## MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
17 ## GNU General Public License for more details.
18
19 ## You should have received a copy of the GNU General Public License along
20 ## with this library; see the file COPYING.  If not, write to the Free
21 ## Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307,
22 ## USA.
23
24 AUTOMAKE_OPTIONS = dejagnu
25
26 include $(top_srcdir)/fragment.am
27
28 AM_MAKEFLAGS = -j1
29 AM_RUNTESTFLAGS =
30
31 ## CXX is actually a "C" compiler. These are real C++ programs.
32 testsuite_flags_script=${glibcxx_builddir}/scripts/testsuite_flags
33 CXX=`${testsuite_flags_script} --build-cxx`
34
35 GLIBGCC_DIR=`$(CC) -print-libgcc-file-name | sed 's,/[^/]*$$,,'`
36 GLIBCXX_DIR=${glibcxx_builddir}/src/.libs
37
38 CXXLINK = \
39         $(LIBTOOL) --tag=CXX --mode=link $(CXX) \
40         -R $(GLIBGCC_DIR) -R $(GLIBCXX_DIR) \
41         $(AM_CXXFLAGS) $(CXXFLAGS) $(LDFLAGS) -o $@
42
43 # Generated lists of files to run.  All of these names are valid make
44 # targets, if you wish to generate a list manually.
45 lists_of_files = \
46    testsuite_files \
47    testsuite_files_interactive \
48    testsuite_files_performance
49
50 ## Build support library.
51 noinst_LIBRARIES = libv3test.a
52 libv3test_a_SOURCES = testsuite_hooks.cc testsuite_allocator.cc
53
54 ## Build support utilities.
55 if GLIBCXX_TEST_ABI
56 noinst_PROGRAMS = abi_check
57 else
58 noinst_PROGRAMS =
59 endif
60 abi_check_SOURCES = abi_check.cc
61
62 all-local: stamp_wchar testsuite_files
63
64 # Enable wchar_t tests if capable.
65 if GLIBCXX_TEST_WCHAR_T
66 stamp_wchar:
67         touch testsuite_wchar_t
68 else
69 stamp_wchar:
70 endif
71
72 # This is automatically run after the generated check-DEJAGNU rule.
73 check-local: check-abi
74
75 baseline_file = ${baseline_dir}/baseline_symbols.txt
76 extract_symvers = $(glibcxx_srcdir)/scripts/extract_symvers
77
78 current_symbols.txt: ${extract_symvers} ../src/.libs/libstdc++.so
79           -@(${extract_symvers} ../src/.libs/libstdc++.so current_symbols.txt)
80
81 baseline_symbols:
82         -@(output=${baseline_file}; \
83           if test ! -f $${output}; then \
84             echo "Baseline file doesn't exist."; \
85             echo "Try 'make new-abi-baseline' to create it."; \
86             exit 1; \
87           fi; true)
88
89 new-abi-baseline:
90         -@$(mkinstalldirs) ${baseline_dir}
91         -@(output=${baseline_file}; \
92           if test -f $${output}; then \
93             output=$${output}.new; \
94             t=`echo $${output} | sed 's=.*config/abi/=='`; \
95             echo "Baseline file already exists, writing to $${t} instead."; \
96           fi; \
97           ${extract_symvers} ../src/.libs/libstdc++.so $${output})
98
99 if GLIBCXX_TEST_ABI
100 # Use 'new-abi-baseline' to create an initial symbol file.  Then run
101 # 'check-abi' to test for changes against that file.
102 check-abi: abi_check baseline_symbols current_symbols.txt
103         -@(./abi_check --check ./current_symbols.txt ${baseline_file} \
104         2>&1 | tee libstdc++-abi.sum)
105
106 check-abi-verbose: abi_check baseline_symbols current_symbols.txt
107         -@(./abi_check --check-verbose ./current_symbols.txt ${baseline_file} \
108         2>&1 | tee libstdc++-abi.sum)
109
110 else
111 check-abi:
112 check-abi-verbose:
113 endif
114
115
116 # These two special 'check-script' rules use the bash script
117 # 'check_survey' to do testing. This script is not as portable as the
118 # dejagnu test harness, and is thus off by default. It does produce
119 # interesting output however, including various performance analysis
120 # items like compile time, execution time, and binary size.
121 survey_script = ${glibcxx_builddir}/scripts/check_survey
122 check-script: ${survey_script}
123         -@(chmod + ${survey_script}; \
124           ${survey_script} 0)
125
126 check-script-install: ${survey_script}
127         -@(chmod + ${survey_script}; \
128           ${survey_script} 0)
129
130
131 # Runs the testsuite/performance tests.
132 # Some of these tests create large (~75MB) files, allocate huge
133 # ammounts of memory, or otherwise tie up machine resources. Thus,
134 # running this is off by default.
135 performance_script=${glibcxx_srcdir}/scripts/check_performance
136 check-performance: testsuite_files_performance ${performance_script}
137         -@(chmod + ${performance_script}; \
138           ${performance_script} ${glibcxx_srcdir} ${glibcxx_builddir})
139
140
141 # This rule generates all of the testsuite_files* lists at once.
142 ${lists_of_files}:
143         ${glibcxx_srcdir}/scripts/create_testsuite_files \
144           ${glibcxx_srcdir}/testsuite `${PWD_COMMAND}`
145
146
147 .PHONY: baseline_symbols new-abi-baseline check-abi check-abi-verbose \
148 check-script check-script-install check-performance
149
150 # By adding these files here, automake will remove them for 'make clean'
151 CLEANFILES = *.txt *.tst *.exe core* filebuf_* tmp* ostream_* *.log *.sum \
152              testsuite_* site.exp abi_check baseline_symbols