[project @ 2001-05-16 09:55:27 by rrt]
[ghc-hetmet.git] / distrib / hc-build
index 6fb9f86..3f1824a 100644 (file)
@@ -1,6 +1,7 @@
-#/bin/sh
+#!/bin/sh -e
 
 # Manuel M. T. Chakravarty <chak@acm.org>, June 2000
+# Updated for GHC 5.00, Simon Marlow, March 2001
 #
 # Script to build GHC from .hc files (must be run in the fptools/ root
 # directory into which the source and .hc files must already have been
 
 configopts="$*"
 
+# check for GNU make
+#
+MAKENAMES="gmake make no-make"
+for make in $MAKENAMES; do
+  MAKE=$make
+  $make --version 2>&1 | grep "GNU Make" >/dev/null && break
+done
+if [ $MAKE = no-make ]; then
+  echo "Fatal error: Cannot find the GNU make utility"
+  exit 1
+fi
+
 # build configuration
 #
 cat >mk/build.mk <<END
-ProjectsToBuild = glafp-utils hslibs ghc
-GhcLibHcOpts = -O
-SRC_HAPPY_OPTS += -c
-GhcLibWays=
+# nothing!
 END
 
 # touch happy generated files; so that in non-bootstrapping mode for
@@ -23,12 +33,21 @@ END
 #
 touch ghc/compiler/rename/ParseIface.hs
 touch ghc/compiler/parser/Parser.hs
+touch ghc/compiler/main/ParsePkgConf.hs
 
 echo "*** Building hsc..."
-./configure --enable-hc-boot $configopts        || exit 1
-make boot all                                   || exit 1
+./configure --enable-hc-boot $configopts
+$MAKE -C glafp-utils boot all
+$MAKE -C ghc boot
+$MAKE -C hslibs boot all
+$MAKE -C ghc all
+
+echo "*** Building libraries..."
+./configure
 
-echo "*** Building library..."
-echo "GhcWithHscBuiltViaC=NO" >>mk/build.mk
-make -C ghc/lib clean boot all                 || exit 1
-make -C hslibs  clean boot all
+$MAKE -C ghc/lib   clean boot
+$MAKE -C ghc/lib   all
+$MAKE -C hslibs    clean boot
+$MAKE -C hslibs    all
+$MAKE -C ghc/utils clean boot
+$MAKE -C ghc/utils all