summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJohn Ericson <John.Ericson@Obsidian.Systems>2021-10-29 20:34:21 -0400
committerMarge Bot <ben+marge-bot@smart-cactus.org>2021-11-02 01:37:43 -0400
commitda1a8e2986731b767f5c977cb873034e771d9371 (patch)
treebc8c3743ee3e52a1e4bbcff6d69d129a05e757ce
parent2f69d102d775f8a95f1c0b0f62d4fd630c4d1737 (diff)
downloadhaskell-da1a8e2986731b767f5c977cb873034e771d9371.tar.gz
Treat generated RTS headers in a more consistent manner
We can depend on all of them at once the same way.
-rw-r--r--compiler/ghc.mk2
-rw-r--r--rts/ghc.mk5
-rw-r--r--rts/include/ghc.mk20
-rw-r--r--rules/cmm-suffix-rules.mk12
-rw-r--r--rules/manual-package-config.mk2
5 files changed, 31 insertions, 10 deletions
diff --git a/compiler/ghc.mk b/compiler/ghc.mk
index b5138c7de4..230e6f4077 100644
--- a/compiler/ghc.mk
+++ b/compiler/ghc.mk
@@ -338,8 +338,6 @@ $(compiler_stage1_depfile_haskell) : $(includes_0_H_CONFIG) $(includes_0_H_PLATF
$(compiler_stage2_depfile_haskell) : $(includes_1_H_CONFIG) $(includes_1_H_PLATFORM)
$(compiler_stage3_depfile_haskell) : $(includes_2_H_CONFIG) $(includes_2_H_PLATFORM)
-COMPILER_INCLUDES_DEPS += $(includes_DERIVEDCONSTANTS)
-
$(compiler_stage1_depfile_haskell) : $(COMPILER_INCLUDES_DEPS) $(PRIMOP_BITS_STAGE1)
$(compiler_stage2_depfile_haskell) : $(COMPILER_INCLUDES_DEPS) $(PRIMOP_BITS_STAGE2)
$(compiler_stage3_depfile_haskell) : $(COMPILER_INCLUDES_DEPS) $(PRIMOP_BITS_STAGE3)
diff --git a/rts/ghc.mk b/rts/ghc.mk
index 4bb17cb8ae..ba1e17ec2e 100644
--- a/rts/ghc.mk
+++ b/rts/ghc.mk
@@ -593,6 +593,8 @@ endif
$(eval $(call dependencies,rts,dist-install,1))
+$(rts_dist-install_depfile_c_asm) : $(includes_dist-install_H_FILES)
+
$(rts_dist-install_depfile_c_asm) : $(includes_1_H_CONFIG)
$(rts_dist-install_depfile_c_asm) : $(includes_1_H_PLATFORM)
$(rts_dist-install_depfile_c_asm) : $(includes_1_H_VERSION)
@@ -641,7 +643,8 @@ endif
$(eval $(call manual-package-config,rts,dist-install,1))
-rts/dist-install/package.conf.inplace : $(includes_1_H_CONFIG) $(includes_1_H_PLATFORM) $(includes_1_H_VERSION)
+rts/dist-install/package.conf.inplace : $(includes_dist-install_H_FILES)
+rts/dist-install/package.conf.install : $(includes_dist-install_H_FILES)
# -----------------------------------------------------------------------------
# installing
diff --git a/rts/include/ghc.mk b/rts/include/ghc.mk
index 4482446aea..9e863f6305 100644
--- a/rts/include/ghc.mk
+++ b/rts/include/ghc.mk
@@ -42,6 +42,24 @@ includes_H_FILES := $(wildcard $(patsubst %,rts/include/%/*.h,$(includes_H_SUBDI
# This isn't necessary, but it makes the paths look a little prettier
includes_H_FILES := $(subst /./,/,$(includes_H_FILES))
+includes_H_FILES_GENERATED = \
+ ghcautoconf.h \
+ ghcplatform.h \
+ ghcversion.h
+
+# Unlike above, include generated files. We still need the previous list
+# 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) \
+ $$(patsubst %,rts/$1/build/include/%,$$(includes_H_FILES_GENERATED))
+endef
+$(eval $(call includesFilesWithGenerated,dist))
+$(eval $(call includesFilesWithGenerated,dist-install))
+
#
# Options
#
@@ -285,6 +303,8 @@ $(includes_DERIVEDCONSTANTS): $(deriveConstants_INPLACE) $(includes_1_H_CONFIG)
$< --gen-header -o $@ --tmpdir $(dir $@) $(DERIVE_CONSTANTS_FLAGS_FOR_HEADER)
endif
+includes_dist-install_H_FILES += $(includes_DERIVEDCONSTANTS)
+
# ---------------------------------------------------------------------------
# Install all header files
diff --git a/rules/cmm-suffix-rules.mk b/rules/cmm-suffix-rules.mk
index ecf7bcba4b..bb7acce06f 100644
--- a/rules/cmm-suffix-rules.mk
+++ b/rules/cmm-suffix-rules.mk
@@ -20,16 +20,16 @@ define cmm-suffix-rules
ifneq "$$(CLEANING)" "YES"
-$1/$2/build/%.$$($3_osuf) : $1/%.cmm $$(rts_H_FILES) $$(includes_H_FILES) $$(includes_DERIVEDCONSTANTS) $$(LAX_DEPS_FOLLOW) $$$$($1_$2_HC_DEP) | $$$$(dir $$$$@)/.
+$1/$2/build/%.$$($3_osuf) : $1/%.cmm $$(rts_H_FILES) $$(includes_$2_H_FILES) $$(LAX_DEPS_FOLLOW) $$$$($1_$2_HC_DEP) | $$$$(dir $$$$@)/.
$$(call cmd,$1_$2_HC) $$($1_$2_$3_MOST_HC_OPTS) -c $$< -o $$@
-$1/$2/build/%.$$($3_osuf) : $1/$2/build/%.cmm $$(rts_H_FILES) $$(includes_H_FILES) $$(includes_DERIVEDCONSTANTS) $$(LAX_DEPS_FOLLOW) $$$$($1_$2_HC_DEP) | $$$$(dir $$$$@)/.
+$1/$2/build/%.$$($3_osuf) : $1/$2/build/%.cmm $$(rts_H_FILES) $$(includes_$2_H_FILES) $$(LAX_DEPS_FOLLOW) $$$$($1_$2_HC_DEP) | $$$$(dir $$$$@)/.
$$(call cmd,$1_$2_HC) $$($1_$2_$3_MOST_HC_OPTS) -c $$< -o $$@
-$1/$2/build/%.$$($3_hcsuf) : $1/%.cmm $$(rts_H_FILES) $$(includes_H_FILES) $$(includes_DERIVEDCONSTANTS) $$(LAX_DEPS_FOLLOW) $$$$($1_$2_HC_DEP) | $$$$(dir $$$$@)/.
+$1/$2/build/%.$$($3_hcsuf) : $1/%.cmm $$(rts_H_FILES) $$(includes_$2_H_FILES) $$(LAX_DEPS_FOLLOW) $$$$($1_$2_HC_DEP) | $$$$(dir $$$$@)/.
$$(call cmd,$1_$2_HC) $$($1_$2_$3_MOST_HC_OPTS) -C $$< -o $$@
-$1/$2/build/%.$$($3_hcsuf) : $1/$2/build/%.cmm $$(rts_H_FILES) $$(includes_H_FILES) $$(includes_DERIVEDCONSTANTS) $$(LAX_DEPS_FOLLOW) $$$$($1_$2_HC_DEP) | $$$$(dir $$$$@)/.
+$1/$2/build/%.$$($3_hcsuf) : $1/$2/build/%.cmm $$(rts_H_FILES) $$(includes_$2_H_FILES) $$(LAX_DEPS_FOLLOW) $$$$($1_$2_HC_DEP) | $$$$(dir $$$$@)/.
$$(call cmd,$1_$2_HC) $$($1_$2_$3_MOST_HC_OPTS) -C $$< -o $$@
# XXX
@@ -40,10 +40,10 @@ $1/$2/build/%.$$($3_hcsuf) : $1/$2/build/%.cmm $$(rts_H_FILES) $$(includes_H_FIL
# so for now they're commented out. They aren't needed, as we can always
# go directly to .o files.
#
-# $1/$2/build/%.$$($3_ssuf) : $1/%.cmm $$(rts_H_FILES) $$(includes_H_FILES) $$(LAX_DEPS_FOLLOW) $$$$($1_$2_HC_DEP) | $$$$(dir $$$$@)/.
+# $1/$2/build/%.$$($3_ssuf) : $1/%.cmm $$(rts_H_FILES) $$(includes_$2_H_FILES) $$(LAX_DEPS_FOLLOW) $$$$($1_$2_HC_DEP) | $$$$(dir $$$$@)/.
# $$(call cmd,$1_$2_HC) $$($1_$2_$3_MOST_HC_OPTS) -S $$< -o $$@
#
-# $1/$2/build/%.$$($3_ssuf) : $1/$2/build/%.cmm $$(rts_H_FILES) $$(includes_H_FILES) $$(LAX_DEPS_FOLLOW) $$$$($1_$2_HC_DEP) | $$$$(dir $$$$@)/.
+# $1/$2/build/%.$$($3_ssuf) : $1/$2/build/%.cmm $$(rts_H_FILES) $$(includes_$2_H_FILES) $$(LAX_DEPS_FOLLOW) $$$$($1_$2_HC_DEP) | $$$$(dir $$$$@)/.
# $$(call cmd,$1_$2_HC) $$($1_$2_$3_MOST_HC_OPTS) -S $$< -o $$@
endif
diff --git a/rules/manual-package-config.mk b/rules/manual-package-config.mk
index 0c43f6247d..3905c437ac 100644
--- a/rules/manual-package-config.mk
+++ b/rules/manual-package-config.mk
@@ -34,7 +34,7 @@ $1/$2/package.conf.inplace : $1/package.conf.in $$$$(ghc-pkg_INPLACE) | $$$$(dir
# This is actually a real file, but we need to recreate it on every
# "make install", so we declare it as phony
.PHONY: $1/$2/package.conf.install
-$1/$2/package.conf.install: | $$$$(dir $$$$@)/.
+$1/$2/package.conf.install : $1/package.conf.in | $$$$(dir $$$$@)/.
$$(HS_CPP) -P \
-DINSTALLING \
-DLIB_DIR='"$$(if $$(filter YES,$$(RelocatableBuild)),$$$$topdir,$$(ghclibdir))"' \