1 ## Makefile for the testsuite subdirectory of the GNU C++ Standard library.
3 ## Copyright (C) 2001, 2002, 2003, 2005 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 nostdinc
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 ${SHELL} ${testsuite_flags_script} --build-cxx)
34 GLIBCXX_INCLUDES = $(shell ${SHELL} ${testsuite_flags_script} \
36 AM_CXXFLAGS = $(shell ${SHELL} ${testsuite_flags_script} --cxxflags)
38 GLIBGCC_DIR=`$(CC) -print-libgcc-file-name | sed 's,/[^/]*$$,,'`
39 GLIBCXX_DIR=${glibcxx_builddir}/src/.libs
42 $(LIBTOOL) --tag=CXX --mode=link $(CXX) \
43 -R $(GLIBGCC_DIR) -R $(GLIBCXX_DIR) \
44 $(AM_CXXFLAGS) $(CXXFLAGS) $(LDFLAGS) -lv3test -L. -o $@
46 ## Build support library.
47 noinst_LIBRARIES = libv3test.a
48 libv3test_a_SOURCES = \
50 testsuite_allocator.cc \
51 testsuite_character.cc \
54 all-local: stamp_wchar stamp_thread
56 # Enable wchar_t tests if capable.
57 if GLIBCXX_TEST_WCHAR_T
59 touch testsuite_wchar_t
64 # Enable thread tests if capable.
65 if GLIBCXX_TEST_THREAD
67 touch testsuite_thread
72 # Generated lists of files to run. All of these names are valid make
73 # targets, if you wish to generate a list manually.
76 testsuite_files_interactive \
77 testsuite_files_performance
79 # This rule generates all of the testsuite_files* lists at once.
81 ${glibcxx_srcdir}/scripts/create_testsuite_files \
82 ${glibcxx_srcdir}/testsuite `${PWD_COMMAND}`
84 # We need more things in site.exp, but automake completely controls the
85 # creation of that file; there's no way to append to it without messing up
86 # the dependancy chains. So we overrule automake. This rule is exactly
87 # what it would have generated, plus our own additions.
89 @echo 'Making a new site.exp file...'
90 @echo '## these variables are automatically generated by make ##' >site.tmp
91 @echo '# Do not edit here. If you wish to override these values' >>site.tmp
92 @echo '# edit the last section' >>site.tmp
93 @echo 'set srcdir $(srcdir)' >>site.tmp
94 @echo "set objdir `pwd`" >>site.tmp
95 @echo 'set build_alias "$(build_alias)"' >>site.tmp
96 @echo 'set build_triplet $(build_triplet)' >>site.tmp
97 @echo 'set host_alias "$(host_alias)"' >>site.tmp
98 @echo 'set host_triplet $(host_triplet)' >>site.tmp
99 @echo 'set target_alias "$(target_alias)"' >>site.tmp
100 @echo 'set target_triplet $(target_triplet)' >>site.tmp
101 @echo 'set target_triplet $(target_triplet)' >>site.tmp
102 @echo 'set libiconv "$(LIBICONV)"' >>site.tmp
103 @echo 'set baseline_file "$(baseline_file)"' >> site.tmp
104 @echo '## All variables above are generated by configure. Do Not Edit ##' >>site.tmp
105 @test ! -f site.exp || \
106 sed '1,/^## All variables above are.*##/ d' site.exp >> site.tmp
108 @test ! -f site.exp || mv site.exp site.bak
109 @mv site.tmp site.exp
112 baseline_file = ${baseline_dir}/baseline_symbols.txt
113 extract_symvers = $(glibcxx_srcdir)/scripts/extract_symvers
116 -@(output=${baseline_file}; \
117 if test ! -f $${output}; then \
118 echo "Baseline file doesn't exist."; \
119 echo "Try 'make new-abi-baseline' to create it."; \
124 -@$(mkinstalldirs) ${baseline_dir}
125 -@(output=${baseline_file}; \
126 if test -f $${output}; then \
127 output=$${output}.new; \
128 t=`echo $${output} | sed 's=.*config/abi/=='`; \
129 echo "Baseline file already exists, writing to $${t} instead."; \
131 ${extract_symvers} ../src/.libs/libstdc++.so $${output})
134 # Use 'new-abi-baseline' to create an initial symbol file. Then run
135 # 'check-abi' to test for changes against that file.
136 check-abi: baseline_symbols site.exp
137 -@runtest --tool libstdc++ abi.exp
142 # Runs the testsuite, but in compile only mode.
143 # Can be used to test sources with non-GNU FE's at various warning
144 # levels and for checking compile time across releases.
146 compile_script=${glibcxx_srcdir}/scripts/check_compile
147 check-compile: testsuite_files ${compile_script}
148 -@(chmod + ${compile_script}; \
149 ${compile_script} ${glibcxx_srcdir} ${glibcxx_builddir})
152 # Runs the testsuite/performance tests.
153 # Some of these tests create large (~75MB) files, allocate huge
154 # ammounts of memory, or otherwise tie up machine resources. Thus,
155 # running this is off by default.
156 performance_script=${glibcxx_srcdir}/scripts/check_performance
157 check-performance: testsuite_files_performance ${performance_script}
158 -@(chmod + ${performance_script}; \
159 ${performance_script} ${glibcxx_srcdir} ${glibcxx_builddir})
162 .PHONY: baseline_symbols new-abi-baseline \
163 check-abi check-compile check-performance
165 # By adding these files here, automake will remove them for 'make clean'
166 CLEANFILES = *.txt *.tst *.exe core* filebuf_* tmp* ostream_* *.log *.sum \
167 testsuite_* site.exp abi_check baseline_symbols *TEST*