2003-07-04 Benjamin Kosnik <bkoz@redhat.com>
[official-gcc.git] / libstdc++-v3 / testsuite / Makefile.am
blob1261e3d1262f45f3a42f8b956d1ca3428600057f
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.
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.
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,
22 ## USA.
24 AUTOMAKE_OPTIONS =  cygnus dejagnu
26 mkinstalldirs = $(SHELL) $(toplevel_srcdir)/mkinstalldirs
28 DEJATOOL = libstdc++-v3
30 EXPECT = `if [ -f @glibcxx_builddir@/../../expect/expect ] ; then \
31             echo @glibcxx_builddir@/../../expect/expect ; \
32           else echo expect ; fi`
34 RUNTEST = `if [ -f @glibcxx_srcdir@/../dejagnu/runtest ] ; then \
35                echo @glibcxx_srcdir@/../dejagnu/runtest ; \
36             else echo runtest; fi`
38 AM_MAKEFLAGS = -j1
39 AM_RUNTESTFLAGS =
40 RUNTESTFLAGS =
42 ## CXX is actually a "C" compiler. These are real C++ programs.
43 glibcxx_srcdir=@glibcxx_srcdir@
44 glibcxx_builddir=@glibcxx_builddir@
45 testsuite_flags_script=${glibcxx_builddir}/scripts/testsuite_flags
46 CXX=`${testsuite_flags_script} --build-cxx`
48 CXXLINK = \
49         LD_RUN_PATH=$${LD_RUN_PATH:+$$LD_RUN_PATH:}${glibcxx_builddir}/src/.libs\
50         $(LIBTOOL) --tag=CXX --mode=link $(CXX) \
51         $(AM_CXXFLAGS) $(CXXFLAGS) $(LDFLAGS) -o $@
53 GLIBCXX_INCLUDES = @GLIBCXX_INCLUDES@
54 LIBSUPCXX_INCLUDES = @LIBSUPCXX_INCLUDES@
55 TOPLEVEL_INCLUDES = @TOPLEVEL_INCLUDES@
56 INCLUDES = \
57         -nostdinc++ \
58         @GLIBCXX_INCLUDES@ @LIBSUPCXX_INCLUDES@ @TOPLEVEL_INCLUDES@ 
60 ## Build support library.
61 noinst_LIBRARIES = libv3test.a
62 libv3test_a_SOURCES = testsuite_hooks.cc testsuite_allocator.cc
64 ## Build support utilities.
65 if GLIBCXX_TEST_ABI
66 noinst_PROGRAMS = abi_check
67 else
68 noinst_PROGRAMS = 
69 endif
70 abi_check_SOURCES = abi_check.cc
72 all-local: stamp_wchar
74 # Enable wchar_t tests if capable.
75 if GLIBCXX_TEST_WCHAR_T
76 stamp_wchar:
77         touch testsuite_wchar_t
78 else
79 stamp_wchar:
80 endif
82 # This is automatically run after the generated check-DEJAGNU rule.
83 check-local: check-abi
85 baseline_dir = @baseline_dir@
86 baseline_file = ${baseline_dir}/baseline_symbols.txt
87 extract_symvers = @glibcxx_srcdir@/scripts/extract_symvers
89 current_symbols.txt: ${extract_symvers} ../src/.libs/libstdc++.so
90           -@(${extract_symvers} ../src/.libs/libstdc++.so current_symbols.txt)
92 baseline_symbols:
93         -@(output=${baseline_file}; \
94           if test ! -f $${output}; then \
95             echo "Baseline file doesn't exist."; \
96             echo "Try 'make new-abi-baseline' to create it."; \
97             exit 1; \
98           fi; true)
100 new-abi-baseline: 
101         -@$(mkinstalldirs) ${baseline_dir}
102         -@(output=${baseline_file}; \
103           if test -f $${output}; then \
104             output=$${output}.new; \
105             t=`echo $${output} | sed 's=.*config/abi/=='`; \
106             echo "Baseline file already exists, writing to $${t} instead."; \
107           fi; \
108           ${extract_symvers} ../src/.libs/libstdc++.so $${output})
110 if GLIBCXX_TEST_ABI
111 # Use 'new-abi-baseline' to create an initial symbol file.  Then run
112 # 'check-abi' to test for changes against that file.
113 check-abi: abi_check baseline_symbols current_symbols.txt
114         -@(./abi_check --check ./current_symbols.txt ${baseline_file} \
115         2>&1 | tee libstdc++-v3-abi.sum)
117 check-abi-verbose: abi_check baseline_symbols current_symbols.txt 
118         -@(./abi_check --check-verbose ./current_symbols.txt ${baseline_file} \
119         2>&1 | tee libstdc++-v3-abi.sum)
121 else
122 check-abi:
123 check-abi-verbose:
124 endif
127 # These two special 'check-script' rules use the bash script
128 # 'check_survey' to do testing. This script is not as portable as the
129 # dejagnu test harness, and is thus off by default. It does produce
130 # interesting output however, including various performance analysis
131 # items like compile time, execution time, and binary size.
132 survey_script = ${glibcxx_builddir}/scripts/check_survey
133 check-script: ${survey_script}
134         -@(chmod + ${survey_script}; \
135           ${survey_script} 0)
137 check-script-install: ${survey_script}
138         -@(chmod + ${survey_script}; \
139           ${survey_script} 0)
142 # Runs the testsuite/performance tests.  
143 # Some of these tests create large (~75MB) files, allocate huge
144 # ammounts of memory, or otherwise tie up machine resources. Thus,
145 # running this is off by default.
146 performance_script=${glibcxx_srcdir}/scripts/check_performance
147 check-performance: ${performance_script}
148         -@(chmod + ${performance_script}; \
149           ${performance_script} ${glibcxx_srcdir} ${glibcxx_builddir})
151 .PHONY: baseline_symbols new-abi-baseline check-abi check-abi-verbose \
152 check-script check-script-install check-performance
154 # By adding these files here, automake will remove them for 'make clean'
155 CLEANFILES = *.txt *.tst *.exe core* filebuf_* tmp* ostream_* *.log *.sum \
156              testsuite_* site.exp abi_check baseline_symbols