diff options
author | John Ericson <git@JohnEricson.me> | 2019-05-08 02:52:35 -0400 |
---|---|---|
committer | Marge Bot <ben+marge-bot@smart-cactus.org> | 2019-10-04 21:44:29 -0400 |
commit | 05419e55cab272ed39790695f448b311f22669f7 (patch) | |
tree | b3f652d4eb27c0ad6108edd6bca5fc73e165981a /ghc.mk | |
parent | ec93d2a90a2d4f189feafd21575b9e9ba5ba9a5d (diff) | |
download | haskell-05419e55cab272ed39790695f448b311f22669f7.tar.gz |
Per stage headers, ghc_boot_platform.h -> stage 0 ghcplatform.h
The generated headers are now generated per stage, which means we can
skip hacks like `ghc_boot_platform.h` and just have that be the stage 0
header as proper. In general, stages are to be embraced: freely generate
everything in each stage but then just build what you depend on, and
everything is symmetrical and efficient. Trying to avoid stages because
bootstrapping is a mind bender just creates tons of bespoke
mini-mind-benders that add up to something far crazier.
Hadrian was pretty close to this "stage-major" approach already, and so
was fairly easy to fix. Make needed more work, however: it did know
about stages so at least there was a scaffold, but few packages except
for the compiler cared, and the compiler used its own counting system.
That said, make and Hadrian now work more similarly, which is good for
the transition to Hadrian. The merits of embracing stage aside, the
change may be worthy for easing that transition alone.
Diffstat (limited to 'ghc.mk')
-rw-r--r-- | ghc.mk | 12 |
1 files changed, 7 insertions, 5 deletions
@@ -1023,6 +1023,9 @@ $(eval $(call bindist-list,.,\ $(BINDIST_EXTRAS) \ includes/Makefile \ $(includes_H_FILES) \ + $(includes_1_H_CONFIG) \ + $(includes_1_H_PLATFORM) \ + $(includes_1_H_VERSION) \ $(includes_DERIVEDCONSTANTS) \ $(includes_GHCCONSTANTS) \ $(libffi_HEADERS) \ @@ -1064,7 +1067,7 @@ BIN_DIST_MK = $(BIN_DIST_PREP_DIR)/bindist.mk # # See Note [No stage2 packages when CrossCompiling or Stage1Only]. -unix-binary-dist-prep: +unix-binary-dist-prep: $(includes_1_H_CONFIG) $(includes_1_H_PLATFORM) $(includes_1_H_VERSION) $(call removeTrees,bindistprep/) "$(MKDIRHIER)" $(BIN_DIST_PREP_DIR) set -e; for i in packages LICENSE compiler ghc rts libraries utils docs libffi includes driver mk rules Makefile aclocal.m4 config.sub config.guess install-sh llvm-targets llvm-passes ghc.mk inplace distrib/configure.ac distrib/README distrib/INSTALL; do ln -s ../../$$i $(BIN_DIST_PREP_DIR)/; done @@ -1303,9 +1306,9 @@ CLEAN_FILES += compiler/ghc.cabal.old # as they may still be in old GHC trees: CLEAN_FILES += includes/GHCConstants.h CLEAN_FILES += includes/DerivedConstants.h -CLEAN_FILES += includes/ghcautoconf.h -CLEAN_FILES += includes/ghcplatform.h -CLEAN_FILES += includes/ghcversion.h +$(foreach n,0 1 2, \ + $(foreach h,$(includes_$n_H_CONFIG) $(includes_$n_H_PLATFORM) $(includes_$n_H_VERSION), \ + $(eval CLEAN_FILES += $h))) CLEAN_FILES += $(includes_SETTINGS) CLEAN_FILES += utils/ghc-pkg/Version.hs CLEAN_FILES += compiler/prelude/primops.txt @@ -1441,7 +1444,6 @@ maintainer-clean : distclean .PHONY: bootstrapping-files # See https://gitlab.haskell.org/ghc/ghc/wikis/building/porting -bootstrapping-files: $(includes_H_CONFIG) bootstrapping-files: $(includes_DERIVEDCONSTANTS) bootstrapping-files: $(includes_GHCCONSTANTS) bootstrapping-files: $(libffi_HEADERS) |