X-Git-Url: http://git.megacz.com/?a=blobdiff_plain;f=ghc.mk;h=ab3351dd1df90e7f94ffc88926325e9f9966a441;hb=3388ec10d647189e7d1172bfae27d1c447d42d1c;hp=7541a87d409b3ec04f6a14a8737d169b8477f528;hpb=6e998535044b9565b46d1d0d5453427c4051a7b4;p=ghc-hetmet.git diff --git a/ghc.mk b/ghc.mk index 7541a87..ab3351d 100644 --- a/ghc.mk +++ b/ghc.mk @@ -85,6 +85,14 @@ default : all +# Catch make if it runs away into an infinite loop +ifeq "$(MAKE_RESTARTS)" "" +else ifeq "$(MAKE_RESTARTS)" "1" +else ifeq "$(MAKE_RESTARTS)" "2" +else +$(error Make has restarted itself $(MAKE_RESTARTS) times; is there a makefile bug?) +endif + # Just bring makefiles up to date: .PHONY: just-makefiles just-makefiles: @@ -865,26 +873,26 @@ endif # mk/project.mk gets an absolute path, so we manually include it in # the bindist with a relative path -BIN_DIST_MK = $(BIN_DIST_NAME)/bindist.mk +BIN_DIST_MK = $(BIN_DIST_DIR)/bindist.mk -binary-dist: - "$(RM)" $(RM_OPTS) -r $(BIN_DIST_NAME) - mkdir $(BIN_DIST_NAME) - set -e; for i in LICENSE compiler ghc rts libraries utils docs libffi includes driver mk rules Makefile aclocal.m4 config.sub config.guess install-sh extra-gcc-opts.in ghc.mk inplace; do ln -s ../$$i $(BIN_DIST_NAME)/; done +unix-binary-dist-prep: + "$(RM)" $(RM_OPTS) -r bindistprep/* + mkdir $(BIN_DIST_DIR) + set -e; for i in LICENSE compiler ghc rts libraries utils docs libffi includes driver mk rules Makefile aclocal.m4 config.sub config.guess install-sh extra-gcc-opts.in ghc.mk inplace; do ln -s ../../$$i $(BIN_DIST_DIR)/; done echo "HADDOCK_DOCS = $(HADDOCK_DOCS)" >> $(BIN_DIST_MK) echo "LATEX_DOCS = $(LATEX_DOCS)" >> $(BIN_DIST_MK) echo "BUILD_DOCBOOK_HTML = $(BUILD_DOCBOOK_HTML)" >> $(BIN_DIST_MK) echo "BUILD_DOCBOOK_PS = $(BUILD_DOCBOOK_PS)" >> $(BIN_DIST_MK) echo "BUILD_DOCBOOK_PDF = $(BUILD_DOCBOOK_PDF)" >> $(BIN_DIST_MK) - ln -s ../distrib/configure-bin.ac $(BIN_DIST_NAME)/configure.ac - cd $(BIN_DIST_NAME) && autoreconf + ln -s ../../distrib/configure-bin.ac $(BIN_DIST_DIR)/configure.ac + cd $(BIN_DIST_DIR) && autoreconf "$(RM)" $(RM_OPTS) $(BIN_DIST_TAR) # h means "follow symlinks", e.g. if aclocal.m4 is a symlink to a source # tree then we want to include the real file, not a symlink to it - "$(TAR)" hcf - -T $(BIN_DIST_LIST) | bzip2 -c > $(BIN_DIST_TAR_BZ2) + cd bindistprep && "$(TAR)" hcf - -T $(BIN_DIST_LIST) | bzip2 -c > $(BIN_DIST_TAR_BZ2) -windows-binary-dist: - "$(RM)" $(RM_OPTS) -r $(BIN_DIST_NAME) +windows-binary-dist-prep: + "$(RM)" $(RM_OPTS) -r bindistprep/* $(MAKE) prefix=$(BIN_DIST_DIR) install "$(TAR)" cf - $(BIN_DIST_NAME) | bzip2 -c > $(BIN_DIST_TAR_BZ2)