Robustify the build system scripts.
30 files changed:
# Create a binary distribution. (make.sh should be run first to create
# the various binary files, and make-doc.sh should also be run to
# Create a binary distribution. (make.sh should be run first to create
# the various binary files, and make-doc.sh should also be run to
# Remove everything in directories which are only used for output.
# In most cases, we can remove the directories, too.
# Remove everything in directories which are only used for output.
# In most cases, we can remove the directories, too.
# a superset of clean.sh, cleaning up not only automatically
# generated files but other things (e.g. customization files)
# a superset of clean.sh, cleaning up not only automatically
# generated files but other things (e.g. customization files)
# Not a shell script, but something intended to be sourced from shell scripts
find_gnumake() {
# the GNU dialect of "make" -- easier to find or port it than to
# Not a shell script, but something intended to be sourced from shell scripts
find_gnumake() {
# the GNU dialect of "make" -- easier to find or port it than to
# Create a distribution containing the HTML versions of system
# documentation. (make-doc.sh needs to be run first, in order to
# Create a distribution containing the HTML versions of system
# documentation. (make-doc.sh needs to be run first, in order to
# Install SBCL files into the usual places.
# Install SBCL files into the usual places.
# The make-config.sh script uses information about the target machine
# to set things up for compilation. It's vaguely like a stripped-down
# The make-config.sh script uses information about the target machine
# to set things up for compilation. It's vaguely like a stripped-down
PATH=/usr/xpg4/bin:$PATH
fi
echo '"'`hostname`-`id -un`-`date +%Y-%m-%d-%H-%M-%S`'"' > output/build-id.tmp
PATH=/usr/xpg4/bin:$PATH
fi
echo '"'`hostname`-`id -un`-`date +%Y-%m-%d-%H-%M-%S`'"' > output/build-id.tmp
# This is a script to be run as part of make.sh. The only time you'd
# want to run it by itself is if you're trying to cross-compile the
# This is a script to be run as part of make.sh. The only time you'd
# want to run it by itself is if you're trying to cross-compile the
# file at that time; but we needed to run it earlier in order to
# get to where we can write a .core file.)
echo //loading and running GENESIS to create cold-sbcl.core
# file at that time; but we needed to run it earlier in order to
# get to where we can write a .core file.)
echo //loading and running GENESIS to create cold-sbcl.core
-$SBCL_XC_HOST <<-'EOF' || exit 1
(setf *print-level* 5 *print-length* 5)
(load "src/cold/shared.lisp")
(in-package "SB-COLD")
(setf *print-level* 5 *print-length* 5)
(load "src/cold/shared.lisp")
(in-package "SB-COLD")
# This is a script to be run as part of make.sh. The only time you'd
# want to run it by itself is if you're trying to cross-compile the
# This is a script to be run as part of make.sh. The only time you'd
# want to run it by itself is if you're trying to cross-compile the
echo //entering make-host-1.sh
LANG=C
echo //entering make-host-1.sh
LANG=C
+LC_ALL=C
+export LANG LC_ALL
# Compile and load the cross-compiler. (We load it here not because we're
# about to use it, but because it's written under the assumption that each
# Compile and load the cross-compiler. (We load it here not because we're
# about to use it, but because it's written under the assumption that each
# This is a script to be run as part of make.sh. The only time you'd
# want to run it by itself is if you're trying to cross-compile the
# This is a script to be run as part of make.sh. The only time you'd
# want to run it by itself is if you're trying to cross-compile the
echo //entering make-host-2.sh
LANG=C
echo //entering make-host-2.sh
LANG=C
+LC_ALL=C
+export LANG LC_ALL
# In some cases, a debugging build of the system will creates a core
# file output/after-xc.core in the next step. In cases where it
# In some cases, a debugging build of the system will creates a core
# file output/after-xc.core in the next step. In cases where it
# the fasl files into the new host Lisp, and that doesn't seem to be
# an enormously important disadvantage, either.)
echo //running cross-compiler to create target object files
# the fasl files into the new host Lisp, and that doesn't seem to be
# an enormously important disadvantage, either.)
echo //running cross-compiler to create target object files
-$SBCL_XC_HOST <<-'EOF' || exit 1
;;;
;;; Set up the cross-compiler.
;;;
;;; Set up the cross-compiler.
# This is a script to be run as part of make.sh. The only time you'd
# want to run it by itself is if you're trying to cross-compile the
# This is a script to be run as part of make.sh. The only time you'd
# want to run it by itself is if you're trying to cross-compile the
echo //entering make-target-1.sh
LANG=C
echo //entering make-target-1.sh
LANG=C
+LC_ALL=C
+export LANG LC_ALL
# Build the runtime system and symbol table (.nm) file.
#
# Build the runtime system and symbol table (.nm) file.
#
# could come either before or after running the cross compiler; that
# doesn't matter.)
echo //building runtime system and symbol table file
# could come either before or after running the cross compiler; that
# doesn't matter.)
echo //building runtime system and symbol table file
-cd ./src/runtime
-$GNUMAKE clean || exit 1
-$GNUMAKE depend || exit 1
-$GNUMAKE all || exit 1
-cd ../..
+
+# The clean is needed for Darwin's readonlyspace hack.
+$GNUMAKE -C src/runtime clean
+# $GNUMAKE -C src/runtime depend
+$GNUMAKE -C src/runtime all
# Use a little C program to grab stuff from the C header files and
# smash it into Lisp source code.
# Use a little C program to grab stuff from the C header files and
# smash it into Lisp source code.
-cd ./tools-for-build
-$GNUMAKE -I../src/runtime grovel-headers || exit 1
-cd ..
+$GNUMAKE -C tools-for-build -I../src/runtime grovel-headers
tools-for-build/grovel-headers > output/stuff-groveled-from-headers.lisp
tools-for-build/grovel-headers > output/stuff-groveled-from-headers.lisp
-# after-grovel-headers may not exist for all platforms (used for
-# Darwin hacks)
-cd ./src/runtime
-$GNUMAKE after-grovel-headers || true
-cd ..
+$GNUMAKE -C src/runtime after-grovel-headers
# This is a script to be run as part of make.sh. The only time you'd
# want to run it by itself is if you're trying to cross-compile the
# This is a script to be run as part of make.sh. The only time you'd
# want to run it by itself is if you're trying to cross-compile the
echo //entering make-target-2.sh
LANG=C
echo //entering make-target-2.sh
LANG=C
+LC_ALL=C
+export LANG LC_ALL
# Do warm init stuff, e.g. building and loading CLOS, and stuff which
# can't be done until CLOS is running.
# Do warm init stuff, e.g. building and loading CLOS, and stuff which
# can't be done until CLOS is running.
echo //doing warm init
./src/runtime/sbcl \
--core output/cold-sbcl.core \
echo //doing warm init
./src/runtime/sbcl \
--core output/cold-sbcl.core \
---sysinit /dev/null --userinit /dev/null <<-'EOF' || exit 1
+--sysinit /dev/null --userinit /dev/null <<-'EOF'
;; Now that we use the compiler for macros, interpreted
;; /SHOW doesn't work until later in init.
#+sb-show (print "/hello, world!")
;; Now that we use the compiler for macros, interpreted
;; /SHOW doesn't work until later in init.
#+sb-show (print "/hello, world!")
# This is a script to be run as part of make.sh. The only time you'd
# probably want to run it by itself is if you're cross-compiling the
# This is a script to be run as part of make.sh. The only time you'd
# probably want to run it by itself is if you're cross-compiling the
# files for more information.
LANG=C
# files for more information.
LANG=C
+LC_ALL=C
+export LANG LC_ALL
. ./find-gnumake.sh
find_gnumake
. ./find-gnumake.sh
find_gnumake
# "When we build software, it's a good idea to have a reliable method
# for getting an executable from it. We want any two reconstructions
# "When we build software, it's a good idea to have a reliable method
# for getting an executable from it. We want any two reconstructions
-export LANG
-export LC_ALL
build_started=`date`
echo "//starting build: $build_started"
build_started=`date`
echo "//starting build: $build_started"
# If you're cross-compiling, you should probably just walk through the
# make-config.sh script by hand doing the right thing on both the host
# and target machines.
# If you're cross-compiling, you should probably just walk through the
# make-config.sh script by hand doing the right thing on both the host
# and target machines.
-sh make-config.sh || exit 1
# Enforce the source policy for no bogus whitespace
# Enforce the source policy for no bogus whitespace
-tools-for-build/canonicalize-whitespace || exit 1
+tools-for-build/canonicalize-whitespace
# The make-host-*.sh scripts are run on the cross-compilation host,
# and the make-target-*.sh scripts are run on the target machine. In
# The make-host-*.sh scripts are run on the cross-compilation host,
# and the make-target-*.sh scripts are run on the target machine. In
# Or, if you can set up the files somewhere shared (with NFS, AFS, or
# whatever) between the host machine and the target machine, the basic
# procedure above should still work, but you can skip the "copy" steps.
# Or, if you can set up the files somewhere shared (with NFS, AFS, or
# whatever) between the host machine and the target machine, the basic
# procedure above should still work, but you can skip the "copy" steps.
-time sh make-host-1.sh || exit 1
-time sh make-target-1.sh || exit 1
-time sh make-host-2.sh || exit 1
-time sh make-target-2.sh || exit 1
-time sh make-target-contrib.sh || exit 1
+time sh make-host-1.sh
+time sh make-target-1.sh
+time sh make-host-2.sh
+time sh make-target-2.sh
+time sh make-target-contrib.sh
NCONTRIBS=`find contrib -name Makefile -print | wc -l`
NPASSED=`find contrib -name test-passed -print | wc -l`
NCONTRIBS=`find contrib -name Makefile -print | wc -l`
NPASSED=`find contrib -name test-passed -print | wc -l`
# a quick and dirty way of partially rebuilding the system after a
# change
# a quick and dirty way of partially rebuilding the system after a
# change
. ./find-gnumake.sh
find_gnumake
. ./find-gnumake.sh
find_gnumake
-sh make-target-1.sh || exit 1
# Instead of doing the full make-host-2.sh, we (1) use after-xc.core
# to rebuild only obviously-out-of-date Lisp files, then (2) run
# GENESIS.
# Instead of doing the full make-host-2.sh, we (1) use after-xc.core
# to rebuild only obviously-out-of-date Lisp files, then (2) run
# GENESIS.
-$LISP $CORE output/after-xc.core $INIT <<'EOF' || exit 1
+$LISP $CORE output/after-xc.core $INIT <<'EOF'
(load "src/cold/slam.lisp")
EOF
# (This ^ used to be
(load "src/cold/slam.lisp")
EOF
# (This ^ used to be
# rebuild-this-stem requests on the command line to supplement
# the rebuild-obviously-outdated-stems logic above.)
#
# rebuild-this-stem requests on the command line to supplement
# the rebuild-obviously-outdated-stems logic above.)
#
-sh make-genesis-2.sh || exit 1
-sh make-target-2.sh || exit 1
echo //ordinary termination of slam.sh
date
echo //ordinary termination of slam.sh
date
# Create a source distribution. (You should run clean.sh first.)
# Create a source distribution. (You should run clean.sh first.)
OS_LIBS = -ldl
GC_SRC = cheneygc.c
OS_LIBS = -ldl
GC_SRC = cheneygc.c
+
+# Nothing to do for after-grovel-headers.
+.PHONY: after-grovel-headers
+after-grovel-headers:
OS_LIBS = #-ldl
GC_SRC = cheneygc.c
OS_LIBS = #-ldl
GC_SRC = cheneygc.c
+
+# Nothing to do for after-grovel-headers.
+.PHONY: after-grovel-headers
+after-grovel-headers:
OS_LIBS = -ldl
GC_SRC = cheneygc.c
OS_LIBS = -ldl
GC_SRC = cheneygc.c
+
+# Nothing to do for after-grovel-headers.
+.PHONY: after-grovel-headers
+after-grovel-headers:
OS_LIBS = -ldl
GC_SRC = cheneygc.c
OS_LIBS = -ldl
GC_SRC = cheneygc.c
+
+# Nothing to do for after-grovel-headers.
+.PHONY: after-grovel-headers
+after-grovel-headers:
OS_LIBS = -ldl
GC_SRC = cheneygc.c
OS_LIBS = -ldl
GC_SRC = cheneygc.c
+
+# Nothing to do for after-grovel-headers.
+.PHONY: after-grovel-headers
+after-grovel-headers:
OS_LIBS = -ldl
GC_SRC = cheneygc.c
OS_LIBS = -ldl
GC_SRC = cheneygc.c
+
+# Nothing to do for after-grovel-headers.
+.PHONY: after-grovel-headers
+after-grovel-headers:
OS_LIBS = -ldl -lsocket -lnsl -lrt
GC_SRC = cheneygc.c
OS_LIBS = -ldl -lsocket -lnsl -lrt
GC_SRC = cheneygc.c
+
+# Nothing to do for after-grovel-headers.
+.PHONY: after-grovel-headers
+after-grovel-headers:
OS_LIBS = # -ldl
GC_SRC = gencgc.c
OS_LIBS = # -ldl
GC_SRC = gencgc.c
+
+# Nothing to do for after-grovel-headers.
+.PHONY: after-grovel-headers
+after-grovel-headers:
+# Nothing to do for after-grovel-headers.
+.PHONY: after-grovel-headers
+after-grovel-headers:
+# Nothing to do for after-grovel-headers.
+.PHONY: after-grovel-headers
+after-grovel-headers:
CFLAGS += -fno-omit-frame-pointer
GC_SRC = gencgc.c
CFLAGS += -fno-omit-frame-pointer
GC_SRC = gencgc.c
+
+# Nothing to do for after-grovel-headers.
+.PHONY: after-grovel-headers
+after-grovel-headers:
etags `find $PWD/src -name '*.lisp' -o -name '*.c' -o -name '*.h'`
etags `find $PWD/src -name '*.lisp' -o -name '*.c' -o -name '*.h'`
;;; checkins which aren't released. (And occasionally for internal
;;; versions, especially for internal versions off the main CVS
;;; branch, it gets hairier, e.g. "0.pre7.14.flaky4.13".)
;;; checkins which aren't released. (And occasionally for internal
;;; versions, especially for internal versions off the main CVS
;;; branch, it gets hairier, e.g. "0.pre7.14.flaky4.13".)
# How big is this project anyway? Crudely estimate non-comment source lines..
# How big is this project anyway? Crudely estimate non-comment source lines..