[project @ 2000-08-22 08:03:15 by chak]
[ghc-hetmet.git] / distrib / hc-build
1 #/bin/sh
2
3 # Manuel M. T. Chakravarty <chak@acm.org>, June 2000
4 #
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).
9
10 configopts="$*"
11
12 # check for GNU make
13 #
14 MAKENAMES="gmake make no-make"
15 for make in $MAKENAMES; do
16   MAKE=$make
17   $make --version 2>&1 | grep "GNU Make" >/dev/null && break
18 done
19 if [ $MAKE = no-make ]; then
20   echo "Fatal error: Cannot find the GNU make utility"
21   exit 1
22 fi
23
24 # build configuration
25 #
26 cat >mk/build.mk <<END
27 ProjectsToBuild = glafp-utils hslibs ghc
28 GhcLibHcOpts = -O
29 SRC_HAPPY_OPTS += -c
30 GhcLibWays=
31 END
32
33 # touch happy generated files; so that in non-bootstrapping mode for
34 # installation, no attempt is made to call happy
35 #
36 touch ghc/compiler/rename/ParseIface.hs
37 touch ghc/compiler/parser/Parser.hs
38
39 echo "*** Building hsc..."
40 ./configure --enable-hc-boot $configopts        || exit 1
41 $MAKE boot all                                  || exit 1
42
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