3 # Manuel M. T. Chakravarty <chak@acm.org>, June 2000
5 # Script to build GHC from .hc files (must be run in the fptools/ root
6 # directory into which the source and .hc files must already have been
7 # unpacked). All options are passed through to ./configure (especially
8 # useful with --prefix).
14 MAKENAMES="gmake make no-make"
15 for make in $MAKENAMES; do
17 $make --version 2>&1 | grep "GNU Make" >/dev/null && break
19 if [ $MAKE = no-make ]; then
20 echo "Fatal error: Cannot find the GNU make utility"
26 cat >mk/build.mk <<END
27 ProjectsToBuild = glafp-utils hslibs ghc
33 # touch happy generated files; so that in non-bootstrapping mode for
34 # installation, no attempt is made to call happy
36 touch ghc/compiler/rename/ParseIface.hs
37 touch ghc/compiler/parser/Parser.hs
39 echo "*** Building hsc..."
40 ./configure --enable-hc-boot $configopts || exit 1
41 $MAKE boot all || exit 1
43 echo "*** Building library..."
44 echo "GhcWithHscBuiltViaC=NO" >>mk/build.mk
45 $MAKE -C ghc/lib clean boot all || exit 1
46 $MAKE -C hslibs clean boot all