summaryrefslogtreecommitdiff
path: root/distrib/hc-build
blob: c96d4ab8a8362f7734d1d3097de540f8ced4f961 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
#!/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
# unpacked).  All options are passed through to ./configure (especially
# useful with --prefix).

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
# nothing!
END

# touch happy generated files; so that in non-bootstrapping mode for
# installation, no attempt is made to call happy
#
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
$MAKE -C glafp-utils boot all
$MAKE -C ghc/utils/unlit boot all
$MAKE -C ghc boot
$MAKE -C hslibs boot all
$MAKE -C ghc all

echo "*** Building libraries..."
./configure

# clean in ghc/lib, but avoid removing hsc2hs-generated .hs files
$MAKE -C ghc/lib   clean HSC_SRCS=""
$MAKE -C ghc/lib   boot all

$MAKE -C hslibs    clean boot all
$MAKE -C ghc/utils clean boot all