1.0.18.8: Sort results of APROPOS-LIST and APROPOS.
[sbcl/eslaughter.git] / make-target-contrib.sh
blob934fb9a74d4693ecac8980f45bf8ca89fd2ec36a
1 #!/bin/sh
2 set -e
4 # This is a script to be run as part of make.sh. The only time you'd
5 # probably want to run it by itself is if you're cross-compiling the
6 # system or doing some kind of troubleshooting.
8 # This software is part of the SBCL system. See the README file for
9 # more information.
11 # This software is derived from the CMU CL system, which was
12 # written at Carnegie Mellon University and released into the
13 # public domain. The software is in the public domain and is
14 # provided with absolutely no warranty. See the COPYING and CREDITS
15 # files for more information.
17 echo //entering make-target-contrib.sh
19 LANG=C
20 LC_ALL=C
21 export LANG LC_ALL
23 . ./find-gnumake.sh
24 find_gnumake
26 . ./sbcl-pwd.sh
27 sbcl_pwd
29 SBCL_HOME="$SBCL_PWD/contrib"
30 export SBCL_HOME
31 if [ "$OSTYPE" = "cygwin" ] ; then
32 SBCL_PWD=`echo $SBCL_PWD | sed s/\ /\\\\\\\\\ /g`
35 SBCL="$SBCL_PWD/src/runtime/sbcl --noinform --core $SBCL_PWD/output/sbcl.core --disable-debugger --no-sysinit --no-userinit"
36 SBCL_BUILDING_CONTRIB=1
37 export SBCL SBCL_BUILDING_CONTRIB
39 # deleting things here lets us not worry about interaction with stale
40 # fasls. This is not good, but is better than :FORCE on each asdf
41 # operation, because that causes multiple builds of base systems such
42 # as SB-RT and SB-GROVEL, but FIXME: there's probably a better
43 # solution. -- CSR, 2003-05-30
45 find contrib/ \( -name '*.fasl' -o \
46 -name '*.FASL' -o \
47 -name 'foo.c' -o \
48 -name 'FOO.C' -o \
49 -name 'a.out' -o \
50 -name 'A.OUT' -o \
51 -name 'alien.so' -o \
52 -name 'ALIEN.SO' -o \
53 -name '*.o' -o \
54 -name '*.O' \) \
55 -print | xargs rm -f
57 find output -name 'building-contrib.*' -print | xargs rm -f
59 for i in contrib/*; do
60 test -d $i && test -f $i/Makefile || continue;
61 # export INSTALL_DIR=$SBCL_HOME/`basename $i `
62 test -f $i/test-passed && rm $i/test-passed
63 # hack to get exit codes right.
64 if $GNUMAKE -C $i test 2>&1 && touch $i/test-passed ; then
66 else
67 exit $?
68 fi | tee output/building-contrib.`basename $i`
69 done
71 # Sometimes people used to see the "No tests failed." output from the last
72 # DEFTEST in contrib self-tests and think that's all that is. So...
73 HEADER_HAS_BEEN_PRINTED=false
74 for dir in contrib/*
76 if [ -d "$dir" -a -f "$dir/Makefile" -a ! -f "$dir/test-passed" ]; then
77 if $HEADER_HAS_BEEN_PRINTED; then
78 echo > /dev/null
79 else
80 cat <<EOF
82 WARNING! Some of the contrib modules did not build successfully or pass
83 their self-tests. Failed contribs:"
84 EOF
85 HEADER_HAS_BEEN_PRINTED=true
87 echo " `basename $dir`"
89 done
91 if [ $HEADER_HAS_BEEN_PRINTED = true ]; then
92 exit 1