summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJohn Ericson <John.Ericson@Obsidian.Systems>2021-10-26 02:36:22 +0000
committerMarge Bot <ben+marge-bot@smart-cactus.org>2021-11-12 21:20:52 -0500
commita57cc7548fc66a712f6f6cffdbda0a9c3c498829 (patch)
treebc1f36ca28d1bde88c57f53b93b704feecae3f0a
parent7b44c816b089de0e4f1a1a4d40a371524c79ab12 (diff)
downloadhaskell-a57cc7548fc66a712f6f6cffdbda0a9c3c498829.tar.gz
Make: Do not generate ghc.* headers in stage0
GHC should get everything it needs from the RTS, which for stage0 is the "old" RTS that comes from the bootstrap compiler.
-rw-r--r--compiler/ghc.mk2
-rw-r--r--ghc.mk5
-rw-r--r--rts/include/ghc.mk26
3 files changed, 12 insertions, 21 deletions
diff --git a/compiler/ghc.mk b/compiler/ghc.mk
index 230e6f4077..07ee636b2b 100644
--- a/compiler/ghc.mk
+++ b/compiler/ghc.mk
@@ -334,7 +334,7 @@ endif
ifneq "$(BINDIST)" "YES"
-$(compiler_stage1_depfile_haskell) : $(includes_0_H_CONFIG) $(includes_0_H_PLATFORM)
+$(compiler_stage1_depfile_haskell) : # Headers come from bootstrap RTS
$(compiler_stage2_depfile_haskell) : $(includes_1_H_CONFIG) $(includes_1_H_PLATFORM)
$(compiler_stage3_depfile_haskell) : $(includes_2_H_CONFIG) $(includes_2_H_PLATFORM)
diff --git a/ghc.mk b/ghc.mk
index bd0b4bbfdc..3e561a61dd 100644
--- a/ghc.mk
+++ b/ghc.mk
@@ -1326,9 +1326,8 @@ CLEAN_FILES += mk/config.mk.old
CLEAN_FILES += mk/project.mk.old
CLEAN_FILES += compiler/ghc.cabal.old
-$(foreach d,dist dist-install, \
- $(foreach h,$(includes_$d_H_FILES_GENERATED), \
- $(eval CLEAN_FILES += $h)))
+$(foreach h,$(includes_dist-install_H_FILES_GENERATED), \
+ $(eval CLEAN_FILES += $h))
CLEAN_FILES += $(includes_SETTINGS)
CLEAN_FILES += utils/ghc-pkg/Version.hs
CLEAN_FILES += compiler/GHC/Builtin/primops.txt
diff --git a/rts/include/ghc.mk b/rts/include/ghc.mk
index f76f549984..11e72c3daa 100644
--- a/rts/include/ghc.mk
+++ b/rts/include/ghc.mk
@@ -13,15 +13,12 @@
#
# Header files built from the configure script's findings
#
-includes_0_H_CONFIG = rts/dist/build/include/ghcautoconf.h
includes_1_H_CONFIG = rts/dist-install/build/include/ghcautoconf.h
includes_2_H_CONFIG = $(includes_1_H_CONFIG)
-includes_0_H_PLATFORM = rts/dist/build/include/ghcplatform.h
includes_1_H_PLATFORM = rts/dist-install/build/include/ghcplatform.h
includes_2_H_PLATFORM = $(includes_1_H_PLATFORM)
-includes_0_H_VERSION = rts/dist/build/include/ghcversion.h
includes_1_H_VERSION = rts/dist-install/build/include/ghcversion.h
includes_2_H_VERSION = $(includes_1_H_VERSION)
@@ -51,16 +48,13 @@ includes_H_FILES_GENERATED = \
# without the generated files separtely and not just as part of this due to
# lingering issues like the derived constants generation snooping the RTS
# headers.
-define includesFilesWithGenerated
-# $1 = distdir
-includes_$1_H_FILES = \
- $$(includes_H_FILES) \
- $$(includes_$1_H_FILES_GENERATED)
-includes_$1_H_FILES_GENERATED = \
- $$(patsubst %,rts/$1/build/include/%,$$(includes_H_FILES_GENERATED))
-endef
-$(eval $(call includesFilesWithGenerated,dist))
-$(eval $(call includesFilesWithGenerated,dist-install))
+includes_dist_H_FILES = \
+ $(includes_H_FILES)
+includes_dist-install_H_FILES = \
+ $(includes_H_FILES) \
+ $(includes_dist-install_H_FILES_GENERATED)
+includes_dist-install_H_FILES_GENERATED = \
+ $(patsubst %,rts/dist-install/build/include/%,$(includes_H_FILES_GENERATED))
#
# Options
@@ -307,11 +301,9 @@ includes_dist-install_H_FILES_GENERATED += $(includes_DERIVEDCONSTANTS)
# ---------------------------------------------------------------------------
# Install all header files
-$(eval $(call clean-target,includes,,\
- $(foreach distdir,dist dist-install,$(includes_$(distdir)_H_FILES_GENERATED))))
+$(eval $(call clean-target,includes,,$(includes_dist-install_H_FILES_GENERATED)))
-$(eval $(call all-target,includes,\
- $(foreach distdir,dist dist-install,$(includes_$(distdir)_H_FILES_GENERATED))))
+$(eval $(call all-target,includes,$(includes_dist-install_H_FILES_GENERATED)))
install: install_includes