1 ## Makefile for the testsuite subdirectory of the GNU C++ Standard library.
3 ## Copyright (C) 2001, 2002, 2003 Free Software Foundation, Inc.
5 ## This file is part of the libstdc++ version 3 distribution.
6 ## Process this file with automake to produce Makefile.in.
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)
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.
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,
24 AUTOMAKE_OPTIONS = dejagnu
26 include $(top_srcdir)/fragment.am
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)
36 GLIBGCC_DIR=`$(CC) -print-libgcc-file-name | sed 's,/[^/]*$$,,'`
37 GLIBCXX_DIR=${glibcxx_builddir}/src/.libs
40 $(LIBTOOL) --tag=CXX --mode=link $(CXX) \
41 -R $(GLIBGCC_DIR) -R $(GLIBCXX_DIR) \
42 $(AM_CXXFLAGS) $(CXXFLAGS) $(LDFLAGS) -lv3test -L. -o $@
44 ## Build support library.
45 noinst_LIBRARIES = libv3test.a
46 libv3test_a_SOURCES = \
48 testsuite_allocator.cc \
51 ## Build support utilities.
53 noinst_PROGRAMS = abi_check
57 abi_check_SOURCES = abi_check.cc
58 abi_check_DEPENDENCIES = libv3test.a
60 all-local: stamp_wchar testsuite_files
62 # Enable wchar_t tests if capable.
63 if GLIBCXX_TEST_WCHAR_T
65 touch testsuite_wchar_t
70 # Generated lists of files to run. All of these names are valid make
71 # targets, if you wish to generate a list manually.
74 testsuite_files_interactive \
75 testsuite_files_performance
78 # We need more things in site.exp, but automake completely controls the
79 # creation of that file; there's no way to append to it without messing up
80 # the dependancy chains. So we overrule automake. This rule is exactly
81 # what it would have generated, plus our own additions.
83 @echo 'Making a new site.exp file...'
84 @echo '## these variables are automatically generated by make ##' >site.tmp
85 @echo '# Do not edit here. If you wish to override these values' >>site.tmp
86 @echo '# edit the last section' >>site.tmp
87 @echo 'set srcdir $(srcdir)' >>site.tmp
88 @echo "set objdir `pwd`" >>site.tmp
89 @echo 'set build_alias "$(build_alias)"' >>site.tmp
90 @echo 'set build_triplet $(build_triplet)' >>site.tmp
91 @echo 'set host_alias "$(host_alias)"' >>site.tmp
92 @echo 'set host_triplet $(host_triplet)' >>site.tmp
93 @echo 'set target_alias "$(target_alias)"' >>site.tmp
94 @echo 'set target_triplet $(target_triplet)' >>site.tmp
95 @echo 'set target_triplet $(target_triplet)' >>site.tmp
96 @echo 'set libiconv "$(LIBICONV)"' >>site.tmp
97 @echo '## All variables above are generated by configure. Do Not Edit ##' >>site.tmp
98 @test ! -f site.exp || \
99 sed '1,/^## All variables above are.*##/ d' site.exp >> site.tmp
101 @test ! -f site.exp || mv site.exp site.bak
102 @mv site.tmp site.exp
104 # This is automatically run after the generated check-DEJAGNU rule.
105 check-local: check-abi
107 baseline_file = ${baseline_dir}/baseline_symbols.txt
108 extract_symvers = $(glibcxx_srcdir)/scripts/extract_symvers
110 current_symbols.txt: ${extract_symvers} ../src/.libs/libstdc++.so
111 -@(${extract_symvers} ../src/.libs/libstdc++.so current_symbols.txt)
114 -@(output=${baseline_file}; \
115 if test ! -f $${output}; then \
116 echo "Baseline file doesn't exist."; \
117 echo "Try 'make new-abi-baseline' to create it."; \
122 -@$(mkinstalldirs) ${baseline_dir}
123 -@(output=${baseline_file}; \
124 if test -f $${output}; then \
125 output=$${output}.new; \
126 t=`echo $${output} | sed 's=.*config/abi/=='`; \
127 echo "Baseline file already exists, writing to $${t} instead."; \
129 ${extract_symvers} ../src/.libs/libstdc++.so $${output})
132 # Use 'new-abi-baseline' to create an initial symbol file. Then run
133 # 'check-abi' to test for changes against that file.
134 check-abi: abi_check baseline_symbols current_symbols.txt
135 -@./abi_check --check ./current_symbols.txt ${baseline_file} \
136 2>&1 | tee libstdc++-abi.sum
137 -@cp libstdc++-abi.sum libstdc++-abi.log
139 check-abi-verbose: abi_check baseline_symbols current_symbols.txt
140 -@./abi_check --check-verbose ./current_symbols.txt ${baseline_file} \
141 2>&1 | tee libstdc++-abi.sum
142 -@cp libstdc++-abi.sum libstdc++-abi.log
150 # These two special 'check-script' rules use the bash script
151 # 'check_survey' to do testing. This script is not as portable as the
152 # dejagnu test harness, and is thus off by default. It does produce
153 # interesting output however, including various performance analysis
154 # items like compile time, execution time, and binary size.
155 survey_script = ${glibcxx_builddir}/scripts/check_survey
156 check-script: ${survey_script}
157 -@(chmod + ${survey_script}; \
160 check-script-install: ${survey_script}
161 -@(chmod + ${survey_script}; \
165 # Runs the testsuite/performance tests.
166 # Some of these tests create large (~75MB) files, allocate huge
167 # ammounts of memory, or otherwise tie up machine resources. Thus,
168 # running this is off by default.
169 performance_script=${glibcxx_srcdir}/scripts/check_performance
170 check-performance: testsuite_files_performance ${performance_script}
171 -@(chmod + ${performance_script}; \
172 ${performance_script} ${glibcxx_srcdir} ${glibcxx_builddir})
175 # This rule generates all of the testsuite_files* lists at once.
177 ${glibcxx_srcdir}/scripts/create_testsuite_files \
178 ${glibcxx_srcdir}/testsuite `${PWD_COMMAND}`
181 .PHONY: baseline_symbols new-abi-baseline check-abi check-abi-verbose \
182 check-script check-script-install check-performance
184 # By adding these files here, automake will remove them for 'make clean'
185 CLEANFILES = *.txt *.tst *.exe core* filebuf_* tmp* ostream_* *.log *.sum \
186 testsuite_* site.exp abi_check baseline_symbols