Skip to content
Snippets Groups Projects
Commit 4bf04e73 authored by ram's avatar ram
Browse files

New super-whizzy compile-everything script. Takes all kinds of command-line

options.
parent c395ca60
No related branches found
No related tags found
No related merge requests found
#!/bin/csh -fx #!/bin/csh -f
# #
# compile-all -- script to compile everything # compile-all -- script to compile everything
# #
# $Header: /Volumes/share2/src/cmucl/cvs2git/cvsroot/src/tools/Attic/compile-all,v 1.4 1992/02/05 19:01:20 wlott Exp $ # $Header: /Volumes/share2/src/cmucl/cvs2git/cvsroot/src/tools/Attic/compile-all,v 1.5 1992/02/06 01:28:33 ram Exp $
if ($#argv) then set features = ()
set subdir = $argv[1] set misfeatures = ()
else set target = "@sys"
set subdir = alpha set subdir = alpha
endif set core = ""
set clean = 0
set update = 1
set bootstrap = "target:bootstrap"
set systems = ""
set nosystems = ""
while ($#argv > 0)
if ("$argv[1]" !~ -*) then
set features = ($features $argv[1])
else
switch ($argv[1])
# Select what system to compile, and how:
case "-target":
set target = $argv[2]
shift
breaksw
case "-release":
set subdir = $argv[2]
shift
breaksw
case "-lisp":
set lispdir = $argv[2]
shift
breaksw
case "-core":
set core = " -core $argv[2]"
shift
breaksw
case "-bootstrap":
set bootstrap = $argv[2]
shift
breaksw
case "-misfeature":
set misfeatures = ($misfeatures $argv[2])
shift
breaksw
# Source tree management:
case "-clean":
set clean = 1
breaksw
case "-noupdate":
set update = 0
breaksw
# Select what to compile:
case "-compile":
set systems = $argv[2]
shift
breaksw
case "-nocompile":
set nosystems = $argv[2]
shift
breaksw
default:
echo "Bogus switch: $argv[1]"
cat <<END_HELP
Try these:
-target [@sys]
The machine to compile for: pmax_mach, sun4c_41 ...
-release [alpha]
Which source tree to compile: alpha, exp/foo...
-lisp [/afs/cs/misc/cmucl/@sys/<release>]
The directory to run Lisp out of.
-core [<lisp>/lib/lisp.core]
The core file to run.
-bootstrap [target:bootstrap]
File to load into lisp before compiling.
-misfeature <feature>
Remove <feature> from the features when compiling. May be used more
than once.
-clean <no arg>
Delete all *.*f, *.assem, *.log and *.log.OLD in the destination.
-noupdate <no arg>
If specified, inhibits rcsupdate of the source tree.
-compile [All systems]
A comma-separated list of system names, e.g. "code,compiler". Order is
not significant. All systems are compiled by default.
-nocompile [No systems]
A comma-separated list of systems *not* to compile. Only meaningful
when -compile is not specified.
END_HELP
exit
endsw
endif
shift
end
set dest = /afs/cs/project/clisp/build/@sys/$subdir if (! $?lispdir) set lispdir = /afs/cs/misc/cmucl/@sys/$subdir
setenv CMUCLLIB "$lispdir/lib"
set lisp = "$lispdir/bin/lisp$core"
set dest = /afs/cs/project/clisp/build/$target/$subdir
set src = /afs/cs/project/clisp/src/$subdir set src = /afs/cs/project/clisp/src/$subdir
if ($?LISP) then echo "Source directory: $src"
set lisp = "$LISP" echo "Target directory: $dest"
if ($systems == "") then
if ($nosystems == "") then
echo "Will compile all systems ..."
else
echo "Will compile all systems except for: $nosystems ..."
endif
else else
set lisp = lisp echo "Will compile these systems: $systems ..."
endif endif
if (-e $src/FEATURES) then if (-e $src/FEATURES) then
set features = (`cat $src/FEATURES`) set tmp = (`cat $src/FEATURES`)
else echo "Features from FEATURES file:" $tmp
set features = () set features = ($features $tmp)
endif endif
$lisp -noinit << EOF if $update then
(setf *features* (list* $features *features*)) echo "Updating source directory $src ..."
(setf (search-list "target:") '("$dest/" "$src/")) (cd $src; rcsupdate -q)
(load "target:bootstrap" :if-does-not-exist nil) endif
(load "target:tools/setup")
(comf "target:tools/setup")
(comf "target:tools/rcs")
(quit)
EOF
$lisp -noinit << EOF if $clean then
(setf *features* (list* $features *features*)) echo "Cleaning up binaries and logs in $dest ..."
(setf (search-list "target:") '("$dest/" "$src/")) (cd $dest;\
(load "target:bootstrap" :if-does-not-exist nil) find . \( -name '*.*f' -o -name '*.assem' \) -print -exec rm {} \; ;\
(load "target:tools/setup") rm *.log *.log.OLD)
(setf *interactive* nil *gc-verbose* nil) else
(load "target:tools/worldcom") if ({(echo $dest/*.log>/dev/null)}) then
(quit) echo "Preserving log files in $dest as .OLD ..."
EOF foreach foo ( $dest/*.log )
set old = "${foo}.OLD"
if (-e $old) then
echo "" >>$old
date >>$old
echo "_________________________________________">>$old
cat $foo >>$old
rm $foo
else
mv $foo $old
endif
end
endif
endif
$lisp -noinit << EOF if ($?LISP) then
(setf *features* (list* $features *features*)) echo "LISP environment variable override: $LISP"
(setf (search-list "target:") '("$dest/" "$src/")) set lisp = "$LISP"
(setf (search-list "clx:") '("target:clx/")) else
(load "target:bootstrap" :if-does-not-exist nil) set lisp = lisp
(load "target:tools/setup") endif
(setf *interactive* nil *gc-verbose* nil)
(load "target:tools/clxcom")
(quit)
EOF
$lisp -noinit << EOF echo "Compiling setup and bootstrap ..."
(setf *features* (list* $features *features*)) $lisp -noinit -eval '(eval (read))' << EOF
(setf (search-list "target:") '("$dest/" "$src/")) (progn
(load "target:bootstrap" :if-does-not-exist nil) (setf *features*
(load "target:tools/setup") (set-difference (list* '($features) *features*) '($misfeatures)))
(setf *interactive* nil *gc-verbose* nil) (setf (search-list "target:") '("$dest/" "$src/"))
(load "target:tools/hemcom") (setq *compile-verbose* nil *compile-print* nil)
(quit) (load "target:tools/setup")
(comf "target:tools/setup")
(when (probe-file "${bootstrap}.lisp") (comf "$bootstrap"))
(quit))
EOF EOF
$lisp -noinit << EOF set sysinfo = ("code worldcom"\
(setf *features* (list* $features *features*)) "compiler comcom"\
(setf (search-list "target:") '("$dest/" "$src/")) "clx clxcom"\
(load "target:bootstrap" :if-does-not-exist nil) "hemlock hemcom"\
(load "target:tools/setup") "pcl pclcom"\
(setf *interactive* nil *gc-verbose* nil) "genesis worldbuild")
(load "target:tools/comcom")
(quit)
EOF
$lisp -noinit << EOF while ($#sysinfo > 0)
(setf *features* (list* $features *features*)) set system_vec = ($sysinfo[1]:x)
(setf (search-list "target:") '("$dest/" "$src/")) set this_system = $system_vec[1]
(load "target:bootstrap" :if-does-not-exist nil) set this_comfile = $system_vec[2]
(setf *gc-verbose* nil) shift sysinfo
(load "target:tools/pclcom") if ($systems =~ *${this_system}* || \
(quit) ($systems == "" && $nosystems !~ *${this_system}*)) then
echo "Compiling $this_system ..."
$lisp -noinit -eval '(eval (read))' << EOF
(progn
(setf *features*
(set-difference (list* '($features) *features*) '($misfeatures)))
(setf (search-list "target:") '("$dest/" "$src/"))
(setq *compile-verbose* nil *compile-print* nil)
(load "$bootstrap" :if-does-not-exist nil)
(load "target:tools/setup")
(setf *interactive* nil *gc-verbose* nil)
(load "target:tools/$this_comfile")
(quit))
EOF EOF
endif
end
echo "Done..." echo "Done..."
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment