X-Git-Url: http://git.megacz.com/?a=blobdiff_plain;f=compiler%2Fghc.mk;h=c237df7a5c30143ad0d017044fcd6515bc975ad5;hb=3a60f713e57c22c7357bec66bfcee6e8ddffee9a;hp=6f781925db02e34240fd46ac90385e69698f3b31;hpb=883d980815437736c486bf69b2f066ef918d2989;p=ghc-hetmet.git diff --git a/compiler/ghc.mk b/compiler/ghc.mk index 6f78192..c237df7 100644 --- a/compiler/ghc.mk +++ b/compiler/ghc.mk @@ -29,6 +29,14 @@ endef compiler_CONFIG_HS = compiler/main/Config.hs +# This is just to avoid generating a warning when generating deps +# involving RtsFlags.h +compiler_stage1_MKDEPENDC_OPTS = -DMAKING_GHC_BUILD_SYSTEM_DEPENDENCIES +compiler_stage2_MKDEPENDC_OPTS = -DMAKING_GHC_BUILD_SYSTEM_DEPENDENCIES +compiler_stage3_MKDEPENDC_OPTS = -DMAKING_GHC_BUILD_SYSTEM_DEPENDENCIES + +compiler_stage1_C_FILES_NODEPS = compiler/parser/cutils.c + ifneq "$(BINDIST)" "YES" compiler/stage1/package-data.mk : $(compiler_CONFIG_HS) compiler/stage2/package-data.mk : $(compiler_CONFIG_HS) @@ -257,6 +265,7 @@ $(PRIMOPS_TXT) compiler/parser/Parser.y: %: %.pp compiler/stage1/$(PLATFORM_H) $(eval $(call clean-target,compiler,primop, $(PRIMOPS_TXT) compiler/parser/Parser.y $(PRIMOP_BITS))) +ifneq "$(BootingFromHc)" "YES" compiler/primop-data-decl.hs-incl: $(PRIMOPS_TXT) $(GENPRIMOP_INPLACE) "$(GENPRIMOP_INPLACE)" --data-decl < $< > $@ compiler/primop-tag.hs-incl: $(PRIMOPS_TXT) $(GENPRIMOP_INPLACE) @@ -282,6 +291,7 @@ compiler/primop-primop-info.hs-incl: $(PRIMOPS_TXT) $(GENPRIMOP_INPLACE) # can still generate them if we want them back compiler/primop-usage.hs-incl: $(PRIMOPS_TXT) "$(GENPRIMOP_INPLACE)" --usage < $< > $@ +endif # ----------------------------------------------------------------------------- # Configuration @@ -411,8 +421,13 @@ compiler_PACKAGE = ghc # Note: we also have to tweak the version number of the package itself # when it gets registered; see Note [munge-stage1-package-config] # below. -ifneq "$(ProjectPatchLevel)" "0" +# The ProjectPatchLevel > 20000000 iff it's a date. If it's e.g. 6.12.1 +# then we don't want to remove it +ifeq "$(shell [ $(ProjectPatchLevel) -gt 20000000 ] && echo YES)" "YES" +compiler_stage1_VERSION_MUNGED = YES +endif +ifeq "$(compiler_stage1_VERSION_MUNGED)" "YES" define compiler_PACKAGE_MAGIC compiler_stage1_VERSION = $(subst .$(ProjectPatchLevel),,$(ProjectVersion)) endef @@ -451,24 +466,29 @@ ifeq "$(stage)" "3" $(eval $(call build-package,compiler,stage3,2)) endif -$(compiler_stage1_depfile) : compiler/stage1/$(PLATFORM_H) -$(compiler_stage2_depfile) : compiler/stage2/$(PLATFORM_H) -$(compiler_stage3_depfile) : compiler/stage3/$(PLATFORM_H) +$(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) : $(includes_H_CONFIG) $(includes_H_PLATFORM) $(includes_GHCCONSTANTS) $(includes_DERIVEDCONSTANTS) $(PRIMOP_BITS) -$(compiler_stage2_depfile) : $(includes_H_CONFIG) $(includes_H_PLATFORM) $(includes_GHCCONSTANTS) $(includes_DERIVEDCONSTANTS) $(PRIMOP_BITS) -$(compiler_stage3_depfile) : $(includes_H_CONFIG) $(includes_H_PLATFORM) $(includes_GHCCONSTANTS) $(includes_DERIVEDCONSTANTS) $(PRIMOP_BITS) +$(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))) +$(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/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. -ifneq "$(ProjectPatchLevel)" "0" +ifeq "$(compiler_stage1_VERSION_MUNGED)" "YES" compiler/stage1/inplace-pkg-config-munged: compiler/stage1/inplace-pkg-config sed -e 's/^\(version: .*\)\.$(ProjectPatchLevel)$$/\1/' \ -e 's/^\(id: .*\)\.$(ProjectPatchLevel)$$/\1/' \