Add some manual dependencies, and -fforce-recomp for Constants and PrimOps
authorSimon Marlow <marlowsd@gmail.com>
Thu, 15 Oct 2009 11:51:20 +0000 (11:51 +0000)
committerSimon Marlow <marlowsd@gmail.com>
Thu, 15 Oct 2009 11:51:20 +0000 (11:51 +0000)
GHC's recompilation checker doesn't take into account #included files,
which is really a bug.  We work around it here by adding dependencies
and using -fforce-recomp in a couple of places.

compiler/ghc.mk

index 6f78192..86f91a9 100644 (file)
@@ -460,11 +460,16 @@ $(compiler_stage2_depfile) : $(includes_H_CONFIG) $(includes_H_PLATFORM) $(inclu
 $(compiler_stage3_depfile) : $(includes_H_CONFIG) $(includes_H_PLATFORM) $(includes_GHCCONSTANTS) $(includes_DERIVEDCONSTANTS) $(PRIMOP_BITS)
 
 # Every Constants.o object file depends on includes/GHCConstants.h:
 $(compiler_stage3_depfile) : $(includes_H_CONFIG) $(includes_H_PLATFORM) $(includes_GHCCONSTANTS) $(includes_DERIVEDCONSTANTS) $(PRIMOP_BITS)
 
 # Every Constants.o object file depends on includes/GHCConstants.h:
-$(eval $(call compiler-hs-dependency,Constants,$(includes_GHCCONSTANTS)))
+$(eval $(call compiler-hs-dependency,Constants,$(includes_GHCCONSTANTS) includes/HaskellConstants.hs))
 
 # Every PrimOp.o object file depends on $(PRIMOP_BITS):
 $(eval $(call compiler-hs-dependency,PrimOp,$(PRIMOP_BITS)))
 
 
 # Every PrimOp.o object file depends on $(PRIMOP_BITS):
 $(eval $(call compiler-hs-dependency,PrimOp,$(PRIMOP_BITS)))
 
+# GHC itself doesn't know about the above dependencies, so we have to
+# switch off the recompilation checker for those modules:
+compiler/prelude/PrimOps_HC_OPTS += -fforce-recomp
+compiler/main/Constants_HC_OPTS  += -fforce-recomp
+
 # Note [munge-stage1-package-config]
 # Strip the date/patchlevel from the version of stage1.  See Note
 # [fiddle-stage1-version] above.
 # Note [munge-stage1-package-config]
 # Strip the date/patchlevel from the version of stage1.  See Note
 # [fiddle-stage1-version] above.