FIX build: add dependencies on ghc_boot_platform.h
[ghc-hetmet.git] / ghc / ghc.mk
index 7f9c630..d72305c 100644 (file)
@@ -1,3 +1,15 @@
+# -----------------------------------------------------------------------------
+#
+# (c) 2009 The University of Glasgow
+#
+# This file is part of the GHC build system.
+#
+# To understand how the build system works and how to modify it, see
+#      http://hackage.haskell.org/trac/ghc/wiki/Building/Architecture
+#      http://hackage.haskell.org/trac/ghc/wiki/Building/Modifying
+#
+# -----------------------------------------------------------------------------
+
 # ToDo
 ghc_USES_CABAL = NO
 # ghc_PACKAGE = ghc-bin
@@ -17,11 +29,8 @@ endif
 
 ifeq "$(GhcThreaded)" "YES"
 # Use threaded RTS with GHCi, so threads don't get blocked at the prompt.
-ghc_HC_OPTS += -threaded
-endif
-
-ifeq "$(BuildSharedLibs)" "YES"
-ghc_HC_OPTS += -dynamic
+ghc_stage2_HC_OPTS += -threaded
+ghc_stage3_HC_OPTS += -threaded
 endif
 
 # XXX ToDp
@@ -29,8 +38,8 @@ endif
 
 ghc_stage1_MODULES = Main
 
-ghc_stage2_MODULES = $(ghc_stage1_MODULES)
-ghc_stage3_MODULES = $(ghc_stage1_MODULES)
+ghc_stage2_MODULES = $(ghc_stage1_MODULES) GhciMonad GhciTags InteractiveUI
+ghc_stage3_MODULES = $(ghc_stage2_MODULES)
 
 ghc_stage1_PROG = ghc-stage1$(exeext)
 ghc_stage2_PROG = ghc-stage2$(exeext)
@@ -41,10 +50,18 @@ ghc_stage1_USE_BOOT_LIBS = YES
 ghc_stage1_HC_OPTS += -package $(compiler_PACKAGE)-$(compiler_stage1_VERSION)
 ghc_stage2_HC_OPTS += -package $(compiler_PACKAGE)-$(compiler_stage2_VERSION)
 ghc_stage3_HC_OPTS += -package $(compiler_PACKAGE)-$(compiler_stage3_VERSION)
-
-ghc_stage1_HC_OPTS += -XCPP -XPatternGuards
-ghc_stage2_HC_OPTS += -XCPP -XPatternGuards
-ghc_stage3_HC_OPTS += -XCPP -XPatternGuards
+ghc_stage2_HC_OPTS += -package haskeline
+ghc_stage3_HC_OPTS += -package haskeline
+
+ghc_language_extension_flags = -XCPP \
+                               -XPatternGuards \
+                               -XForeignFunctionInterface \
+                               -XUnboxedTuples \
+                               -XFlexibleInstances \
+                               -XMagicHash
+ghc_stage1_HC_OPTS += $(ghc_language_extension_flags)
+ghc_stage2_HC_OPTS += $(ghc_language_extension_flags)
+ghc_stage3_HC_OPTS += $(ghc_language_extension_flags)
 
 # In stage1 we might not benefit from cross-package dependencies and
 # recompilation checking.  We must force recompilation here, otherwise
@@ -87,6 +104,11 @@ ghc/stage1/build/tmp/$(ghc_stage1_PROG) : $(compiler_stage1_v_LIB)
 ghc/stage2/build/tmp/$(ghc_stage2_PROG) : $(compiler_stage2_v_LIB)
 ghc/stage3/build/tmp/$(ghc_stage3_PROG) : $(compiler_stage3_v_LIB)
 
+# Modules here import HsVersions.h, so we need ghc_boot_platform.h
+$(ghc_stage1_depfile) : compiler/stage1/$(PLATFORM_H)
+$(ghc_stage2_depfile) : compiler/stage2/$(PLATFORM_H)
+$(ghc_stage3_depfile) : compiler/stage3/$(PLATFORM_H)
+
 all_ghc_stage1 : $(GHC_STAGE1)
 all_ghc_stage2 : $(GHC_STAGE2)
 all_ghc_stage3 : $(GHC_STAGE3)