From 3388ec10d647189e7d1172bfae27d1c447d42d1c Mon Sep 17 00:00:00 2001 From: Ian Lynagh Date: Sun, 27 Sep 2009 20:26:03 +0000 Subject: [PATCH] Add a $(MAKE_RESTARTS) check to ghc.mk This should catch make going into an infinite loop. --- ghc.mk | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/ghc.mk b/ghc.mk index 719949b..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: -- 1.7.10.4