+
+compiler_stage2_TAGS_HC_OPTS = -package ghc
+$(eval $(call tags-package,compiler,stage2))
+
+$(compiler_stage1_depfile_haskell) : compiler/stage1/$(PLATFORM_H)
+$(compiler_stage2_depfile_haskell) : compiler/stage2/$(PLATFORM_H)
+$(compiler_stage3_depfile_haskell) : compiler/stage3/$(PLATFORM_H)
+
+$(compiler_stage1_depfile_haskell) : $(includes_H_CONFIG) $(includes_H_PLATFORM) $(includes_GHCCONSTANTS) $(includes_DERIVEDCONSTANTS) $(PRIMOP_BITS)
+$(compiler_stage2_depfile_haskell) : $(includes_H_CONFIG) $(includes_H_PLATFORM) $(includes_GHCCONSTANTS) $(includes_DERIVEDCONSTANTS) $(PRIMOP_BITS)
+$(compiler_stage3_depfile_haskell) : $(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) includes/HaskellConstants.hs))
+
+# 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/PrimOp_HC_OPTS += -fforce-recomp
+compiler/main/Constants_HC_OPTS += -fforce-recomp
+
+# Workaround for #4003 in GHC 6.12.2. It didn't happen in 6.12.1, and
+# will be fixed in 6.12.3. Unfortunately we don't have a way to do
+# this for just stage1 in the build system.
+ifeq "$(GhcVersion)" "6.12.2"
+compiler/hsSyn/HsLit_HC_OPTS += -fomit-interface-pragmas