[project @ 2003-07-24 15:12:35 by simonmar]
[ghc-hetmet.git] / distrib / hc-build
index 2f0e038..dd9134a 100644 (file)
@@ -26,33 +26,25 @@ 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/parser/Parser.hs
-touch ghc/compiler/main/ParsePkgConf.hs
-touch hslibs/hssource/HsParser.hs
-
-# We don't have genprimopcode yet so don't try to use it
-touch ghc/compiler/prelude/primops.txt
-touch libraries/base/GHC/PrimopWrappers.hs
+case configopts in
+*--enable-hc-boot-unregisterised*)
+    cat >mk/build.mk <<END
+    GhcWithInterpreter=NO
+    GhcWithNativeCodeGen=NO
+    END
+    ;;
+*)
+    cat >mk/build.mk <<END
+    # empty
+    END
+esac
 
 echo "*** Building compiler..."
 ./configure --enable-hc-boot $configopts
 
-# A couple of Makefiles test BootingFromHc before including
-# boilerplate.mk, so we have to pass it explicitly:
-MAKEFLAGS="BootingFromHc=YES"
-export MAKEFLAGS
-
 $MAKE -C glafp-utils boot all
 $MAKE -C ghc boot
 $MAKE -C libraries boot all
-$MAKE -C hslibs boot all
 $MAKE -C ghc all
 
 MAKEFLAGS=
@@ -91,11 +83,13 @@ $MAKE -C ghc/rts      boot && $MAKE -C ghc/rts      all
 
 # Now build a new set of libraries
 $MAKE -C libraries boot all
-$MAKE -C hslibs  boot all
 
-# Finally build all of ghc/utils
+# Build all of ghc/utils
 $MAKE -C ghc/utils clean && $MAKE -C ghc/utils boot all
 
+# Now we can build hslibs (hsc2hs is required, so must be after ghc/utils)
+$MAKE -C hslibs  boot all
+
 # Avoid relinking the compiler during 'make install':
 (cd ghc/compiler; touch parser/hschooks.o ghc-*)