3 # Manuel M. T. Chakravarty <chak@acm.org>, June 2000
4 # Updated for GHC 5.00, Simon Marlow, March 2001
6 # Script to build GHC from .hc files (must be run in the fptools/ root
7 # directory into which the source and .hc files must already have been
8 # unpacked). All options are passed through to ./configure (especially
9 # useful with --prefix).
11 configopts="$*" # e.g., --enable-hc-boot-unregisterised
15 MAKENAMES="gmake make no-make"
16 for make in $MAKENAMES; do
18 $make --version 2>&1 | grep "GNU Make" >/dev/null && break
20 if [ $MAKE = no-make ]; then
21 echo "Fatal error: Cannot find the GNU make utility"
27 cat >mk/build.mk <<END
31 # touch happy generated files; so that in non-bootstrapping mode for
32 # installation, no attempt is made to call happy
34 touch ghc/compiler/rename/ParseIface.hs
35 touch ghc/compiler/parser/Parser.hs
36 touch ghc/compiler/main/ParsePkgConf.hs
38 echo "*** Building hsc..."
39 ./configure --enable-hc-boot $configopts
40 $MAKE -C glafp-utils boot all
42 $MAKE -C hslibs boot all
45 echo "*** Building libraries..."
46 GHC="$PWD/ghc/compiler/ghc-inplace" HappyCmd="$PWD/distrib/fake-happy" ./configure
48 # make ghc/utils while we still have libraries in ghc/lib
49 $MAKE -C ghc/utils clean boot
50 $MAKE -C ghc/utils all
52 # now, clean and build the libraries
53 $MAKE -C ghc/lib clean boot
55 $MAKE -C hslibs clean boot