OSDN Git Service

a003497ecaf7d78f16456cbb21e72158cc4e55cf
[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         = $(shell ${testsuite_flags_script} --build-cxx)
34 AM_CXXFLAGS = $(shell ${testsuite_flags_script} --cxxflags)
35
36 GLIBGCC_DIR=`$(CC) -print-libgcc-file-name | sed 's,/[^/]*$$,,'`
37 GLIBCXX_DIR=${glibcxx_builddir}/src/.libs
38
39 CXXLINK = \
40         $(LIBTOOL) --tag=CXX --mode=link $(CXX) \
41         -R $(GLIBGCC_DIR) -R $(GLIBCXX_DIR) \
42         $(AM_CXXFLAGS) $(CXXFLAGS) $(LDFLAGS) -lv3test -L. -o $@
43
44 ## Build support library.
45 noinst_LIBRARIES = libv3test.a
46 libv3test_a_SOURCES = \
47         testsuite_abi.cc \
48         testsuite_allocator.cc \
49         testsuite_hooks.cc 
50
51 ## Build support utilities.
52 if GLIBCXX_TEST_ABI
53 noinst_PROGRAMS = abi_check
54 else
55 noinst_PROGRAMS =
56 endif
57 abi_check_SOURCES = abi_check.cc
58 abi_check_DEPENDENCIES = libv3test.a
59
60 all-local: stamp_wchar stamp_thread testsuite_files
61
62 # Enable wchar_t tests if capable.
63 if GLIBCXX_TEST_WCHAR_T
64 stamp_wchar:
65         touch testsuite_wchar_t
66 else
67 stamp_wchar:
68 endif
69
70 # Enable thread tests if capable.
71 if GLIBCXX_TEST_THREAD
72 stamp_thread:
73         touch testsuite_thread
74 else
75 stamp_thread:
76 endif
77
78 # Generated lists of files to run.  All of these names are valid make
79 # targets, if you wish to generate a list manually.
80 lists_of_files = \
81    testsuite_files \
82    testsuite_files_interactive \
83    testsuite_files_performance
84
85
86 # We need more things in site.exp, but automake completely controls the
87 # creation of that file; there's no way to append to it without messing up
88 # the dependancy chains.  So we overrule automake.  This rule is exactly
89 # what it would have generated, plus our own additions.
90 site.exp: Makefile
91         @echo 'Making a new site.exp file...'
92         @echo '## these variables are automatically generated by make ##' >site.tmp
93         @echo '# Do not edit here.  If you wish to override these values' >>site.tmp
94         @echo '# edit the last section' >>site.tmp
95         @echo 'set srcdir $(srcdir)' >>site.tmp
96         @echo "set objdir `pwd`" >>site.tmp
97         @echo 'set build_alias "$(build_alias)"' >>site.tmp
98         @echo 'set build_triplet $(build_triplet)' >>site.tmp
99         @echo 'set host_alias "$(host_alias)"' >>site.tmp
100         @echo 'set host_triplet $(host_triplet)' >>site.tmp
101         @echo 'set target_alias "$(target_alias)"' >>site.tmp
102         @echo 'set target_triplet $(target_triplet)' >>site.tmp
103         @echo 'set target_triplet $(target_triplet)' >>site.tmp
104         @echo 'set libiconv "$(LIBICONV)"' >>site.tmp
105         @echo '## All variables above are generated by configure. Do Not Edit ##' >>site.tmp
106         @test ! -f site.exp || \
107           sed '1,/^## All variables above are.*##/ d' site.exp >> site.tmp
108         @-rm -f site.bak
109         @test ! -f site.exp || mv site.exp site.bak
110         @mv site.tmp site.exp
111
112 # This is automatically run after the generated check-DEJAGNU rule.
113 check-local: check-abi
114
115 baseline_file = ${baseline_dir}/baseline_symbols.txt
116 extract_symvers = $(glibcxx_srcdir)/scripts/extract_symvers
117
118 current_symbols.txt: ${extract_symvers} ../src/.libs/libstdc++.so
119           -@(${extract_symvers} ../src/.libs/libstdc++.so current_symbols.txt)
120
121 baseline_symbols:
122         -@(output=${baseline_file}; \
123           if test ! -f $${output}; then \
124             echo "Baseline file doesn't exist."; \
125             echo "Try 'make new-abi-baseline' to create it."; \
126             exit 1; \
127           fi; true)
128
129 new-abi-baseline:
130         -@$(mkinstalldirs) ${baseline_dir}
131         -@(output=${baseline_file}; \
132           if test -f $${output}; then \
133             output=$${output}.new; \
134             t=`echo $${output} | sed 's=.*config/abi/=='`; \
135             echo "Baseline file already exists, writing to $${t} instead."; \
136           fi; \
137           ${extract_symvers} ../src/.libs/libstdc++.so $${output})
138
139 if GLIBCXX_TEST_ABI
140 # Use 'new-abi-baseline' to create an initial symbol file.  Then run
141 # 'check-abi' to test for changes against that file.
142 check-abi: abi_check baseline_symbols current_symbols.txt
143         -@./abi_check --check ./current_symbols.txt ${baseline_file} \
144           2>&1 | tee libstdc++-abi.sum
145         -@cp libstdc++-abi.sum libstdc++-abi.log
146
147 check-abi-verbose: abi_check baseline_symbols current_symbols.txt
148         -@./abi_check --check-verbose ./current_symbols.txt ${baseline_file} \
149           2>&1 | tee libstdc++-abi.sum
150         -@cp libstdc++-abi.sum libstdc++-abi.log
151
152 else
153 check-abi:
154 check-abi-verbose:
155 endif
156
157
158 # These two special 'check-script' rules use the bash script
159 # 'check_survey' to do testing. This script is not as portable as the
160 # dejagnu test harness, and is thus off by default. It does produce
161 # interesting output however, including various performance analysis
162 # items like compile time, execution time, and binary size.
163 survey_script = ${glibcxx_builddir}/scripts/check_survey
164 check-script: ${survey_script}
165         -@(chmod + ${survey_script}; \
166           ${survey_script} 0)
167
168 check-script-install: ${survey_script}
169         -@(chmod + ${survey_script}; \
170           ${survey_script} 0)
171
172
173 # Runs the testsuite/performance tests.
174 # Some of these tests create large (~75MB) files, allocate huge
175 # ammounts of memory, or otherwise tie up machine resources. Thus,
176 # running this is off by default.
177 performance_script=${glibcxx_srcdir}/scripts/check_performance
178 check-performance: testsuite_files_performance ${performance_script}
179         -@(chmod + ${performance_script}; \
180           ${performance_script} ${glibcxx_srcdir} ${glibcxx_builddir})
181
182
183 # This rule generates all of the testsuite_files* lists at once.
184 ${lists_of_files}:
185         ${glibcxx_srcdir}/scripts/create_testsuite_files \
186           ${glibcxx_srcdir}/testsuite `${PWD_COMMAND}`
187
188
189 .PHONY: baseline_symbols new-abi-baseline check-abi check-abi-verbose \
190 check-script check-script-install check-performance
191
192 # By adding these files here, automake will remove them for 'make clean'
193 CLEANFILES = *.txt *.tst *.exe core* filebuf_* tmp* ostream_* *.log *.sum \
194              testsuite_* site.exp abi_check baseline_symbols *TEST*