for review: removing stage 2 object files

Zoltan Somogyi zs at cs.mu.OZ.AU
Wed Apr 1 17:22:30 AEST 1998


tools/bootcheck:
	Remove the stage 2 object files as soon as the stage 2 executable
	has been successfully created, unless the new -k/--keep-obj option
	is given. (We still keep them if stage 2 fails, since they may
	be useful in analyzing why.)

	This will help us make the most of our limited disk resources,
	so we can waste them more productively :-)

Zoltan.

Index: bootcheck
===================================================================
RCS file: /home/mercury1/repository/mercury/tools/bootcheck,v
retrieving revision 1.50
diff -u -u -r1.50 bootcheck
--- bootcheck	1998/03/20 02:58:33	1.50
+++ bootcheck	1998/03/31 07:55:36
@@ -12,6 +12,8 @@
 		Display this usage message.
 	-j <num-jobs>, --jobs <num-jobs>
 		Run using <num-jobs> different parallel processes.
+	-k, --keep-objs
+		Keep the stage 2 object files even if stage 2 is successful.
 	-m <mmake-args>, --mmake-args <mmake-args>
 		Pass <mmake-args> as options to \`mmake'.
 	-o <filename>, --output-file <filename>
@@ -47,6 +49,7 @@
 "
 
 jfactor=""
+keep_objs=false
 mmake_opts="-k"
 outfile=""
 runtests=true
@@ -72,6 +75,9 @@
 	--jobs*)
 		jfactor="--jobs` expr $1 : '--jobs\(.*\)' `" ;;
 
+	-k|--keep-objs)
+		keep_objs=true ;;
+
 	-m|--mmake)
 		mmake_opts="$mmake_opts $2"; shift ;;
 
@@ -459,6 +465,17 @@
 	else
 		echo "building of stage 2 not successful"
 		exit 1
+	fi
+
+	if $keep_objs
+	then
+		true
+	else
+		/bin/rm -f $root/stage2/library/[a-l]*.o < /dev/null
+		/bin/rm -f $root/stage2/library/[m-z]*.o < /dev/null
+		/bin/rm -f $root/stage2/compiler/[a-l]*.o < /dev/null
+		/bin/rm -f $root/stage2/compiler/[i-s]*.o < /dev/null
+		/bin/rm -f $root/stage2/compiler/[t-z]*.o < /dev/null
 	fi
 
 	MERCURY_COMPILER=$root/stage2/compiler/mercury_compile



More information about the developers mailing list