Fixed rare threading problem
[official-gcc.git] / libstdc++-v3 / testsuite / Makefile.am
blobbbe1fe5f45b29b9ca72d8ac7e8dba074e6440eee
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 =
41 PWD_COMMAND = $${PWDCMD-pwd}
43 ## CXX is actually a "C" compiler. These are real C++ programs.
44 glibcxx_srcdir=@glibcxx_srcdir@
45 glibcxx_builddir=@glibcxx_builddir@
46 testsuite_flags_script=${glibcxx_builddir}/scripts/testsuite_flags
47 CXX=`${testsuite_flags_script} --build-cxx`
49 CXXLINK = \
50         LD_RUN_PATH=$${LD_RUN_PATH:+$$LD_RUN_PATH:}${glibcxx_builddir}/src/.libs\
51         $(LIBTOOL) --tag=CXX --mode=link $(CXX) \
52         $(AM_CXXFLAGS) $(CXXFLAGS) $(LDFLAGS) -o $@
54 GLIBCXX_INCLUDES = @GLIBCXX_INCLUDES@
55 LIBSUPCXX_INCLUDES = @LIBSUPCXX_INCLUDES@
56 TOPLEVEL_INCLUDES = @TOPLEVEL_INCLUDES@
57 INCLUDES = \
58         -nostdinc++ \
59         @GLIBCXX_INCLUDES@ @LIBSUPCXX_INCLUDES@ @TOPLEVEL_INCLUDES@ 
61 # Generated lists of files to run.  All of these names are valid make
62 # targets, if you wish to generate a list manually.
63 lists_of_files = \
64    testsuite_files \
65    testsuite_files_interactive \
66    testsuite_files_performance
68 ## Build support library.
69 noinst_LIBRARIES = libv3test.a
70 libv3test_a_SOURCES = testsuite_hooks.cc testsuite_allocator.cc
72 ## Build support utilities.
73 if GLIBCXX_TEST_ABI
74 noinst_PROGRAMS = abi_check
75 else
76 noinst_PROGRAMS = 
77 endif
78 abi_check_SOURCES = abi_check.cc
80 all-local: stamp_wchar testsuite_files
82 # Enable wchar_t tests if capable.
83 if GLIBCXX_TEST_WCHAR_T
84 stamp_wchar:
85         touch testsuite_wchar_t
86 else
87 stamp_wchar:
88 endif
90 # This is automatically run after the generated check-DEJAGNU rule.
91 check-local: check-abi
93 baseline_dir = @baseline_dir@
94 baseline_file = ${baseline_dir}/baseline_symbols.txt
95 extract_symvers = @glibcxx_srcdir@/scripts/extract_symvers
97 current_symbols.txt: ${extract_symvers} ../src/.libs/libstdc++.so
98           -@(${extract_symvers} ../src/.libs/libstdc++.so current_symbols.txt)
100 baseline_symbols:
101         -@(output=${baseline_file}; \
102           if test ! -f $${output}; then \
103             echo "Baseline file doesn't exist."; \
104             echo "Try 'make new-abi-baseline' to create it."; \
105             exit 1; \
106           fi; true)
108 new-abi-baseline: 
109         -@$(mkinstalldirs) ${baseline_dir}
110         -@(output=${baseline_file}; \
111           if test -f $${output}; then \
112             output=$${output}.new; \
113             t=`echo $${output} | sed 's=.*config/abi/=='`; \
114             echo "Baseline file already exists, writing to $${t} instead."; \
115           fi; \
116           ${extract_symvers} ../src/.libs/libstdc++.so $${output})
118 if GLIBCXX_TEST_ABI
119 # Use 'new-abi-baseline' to create an initial symbol file.  Then run
120 # 'check-abi' to test for changes against that file.
121 check-abi: abi_check baseline_symbols current_symbols.txt
122         -@(./abi_check --check ./current_symbols.txt ${baseline_file} \
123         2>&1 | tee libstdc++-v3-abi.sum)
125 check-abi-verbose: abi_check baseline_symbols current_symbols.txt 
126         -@(./abi_check --check-verbose ./current_symbols.txt ${baseline_file} \
127         2>&1 | tee libstdc++-v3-abi.sum)
129 else
130 check-abi:
131 check-abi-verbose:
132 endif
135 # These two special 'check-script' rules use the bash script
136 # 'check_survey' to do testing. This script is not as portable as the
137 # dejagnu test harness, and is thus off by default. It does produce
138 # interesting output however, including various performance analysis
139 # items like compile time, execution time, and binary size.
140 survey_script = ${glibcxx_builddir}/scripts/check_survey
141 check-script: ${survey_script}
142         -@(chmod + ${survey_script}; \
143           ${survey_script} 0)
145 check-script-install: ${survey_script}
146         -@(chmod + ${survey_script}; \
147           ${survey_script} 0)
150 # Runs the testsuite/performance tests.  
151 # Some of these tests create large (~75MB) files, allocate huge
152 # ammounts of memory, or otherwise tie up machine resources. Thus,
153 # running this is off by default.
154 performance_script=${glibcxx_srcdir}/scripts/check_performance
155 check-performance: testsuite_files_performance ${performance_script}
156         -@(chmod + ${performance_script}; \
157           ${performance_script} ${glibcxx_srcdir} ${glibcxx_builddir})
160 # This rule generates all of the testsuite_files* lists at once.
161 ${lists_of_files}:
162         ${glibcxx_srcdir}/scripts/create_testsuite_files \
163           ${glibcxx_srcdir}/testsuite `${PWD_COMMAND}`
166 .PHONY: baseline_symbols new-abi-baseline check-abi check-abi-verbose \
167 check-script check-script-install check-performance
169 # By adding these files here, automake will remove them for 'make clean'
170 CLEANFILES = *.txt *.tst *.exe core* filebuf_* tmp* ostream_* *.log *.sum \
171              testsuite_* site.exp abi_check baseline_symbols