diff options
author | Ian Lynagh <ian@well-typed.com> | 2013-01-06 17:36:45 +0000 |
---|---|---|
committer | Ian Lynagh <ian@well-typed.com> | 2013-01-10 19:29:46 +0000 |
commit | 1353b4a1e774cafbfce41bf977ed7458b989e287 (patch) | |
tree | d0e6c1baa83ac42e35ab9fa1da8eba8c2ff90f24 /rules/hi-rule.mk | |
parent | 5cb088088be8573a01c991421ad882ce899067db (diff) | |
download | haskell-1353b4a1e774cafbfce41bf977ed7458b989e287.tar.gz |
Enable the .hi file sanity check when not on Windows
We don't want the overhead of spawning a shell on Windows, but on other
platforms it's a useful sanity check.
Diffstat (limited to 'rules/hi-rule.mk')
-rw-r--r-- | rules/hi-rule.mk | 37 |
1 files changed, 28 insertions, 9 deletions
diff --git a/rules/hi-rule.mk b/rules/hi-rule.mk index c1e75022e4..a059ce1378 100644 --- a/rules/hi-rule.mk +++ b/rules/hi-rule.mk @@ -32,11 +32,11 @@ # exit 1; \ # fi # -# This version adds a useful sanity check; but it is also expensive on -# Windows where spawning a shell takes a while (about 0.3s). We'd -# like to avoid the shell if necessary. This also hides the message -# "nothing to be done for 'all'", since make thinks it has actually done -# something. +# This version adds a useful sanity check, and is a good solution on +# platforms other than Windows. But on Windows it is expensive, as +# spawning a shell takes a while (about 0.3s). We'd like to avoid the +# shell if necessary. This also hides the message "nothing to be done +# for 'all'", since make thinks it has actually done something. # # %.hi : %.o # @@ -64,11 +64,30 @@ define hi-rule # $1 = source directory, $2 = object directory, $3 = way -$2/%.$$($3_hisuf) : $2/%.$$($3_osuf) $1/%.hs ; -$2/%.$$($3_hisuf) : $2/%.$$($3_osuf) $1/%.lhs ; +$(call hi-rule-helper,$2/%.$$($3_hisuf) : $2/%.$$($3_osuf) $1/%.hs) +$(call hi-rule-helper,$2/%.$$($3_hisuf) : $2/%.$$($3_osuf) $1/%.lhs) -$2/%.$$($3_way_)hi-boot : $2/%.$$($3_way_)o-boot $1/%.hs ; -$2/%.$$($3_way_)hi-boot : $2/%.$$($3_way_)o-boot $1/%.lhs ; +$(call hi-rule-helper,$2/%.$$($3_way_)hi-boot : $2/%.$$($3_way_)o-boot $1/%.hs) +$(call hi-rule-helper,$2/%.$$($3_way_)hi-boot : $2/%.$$($3_way_)o-boot $1/%.lhs) endef +ifeq "$(TargetOS_CPP)" "mingw32" + +define hi-rule-helper # $1 = rule header +$1 ; +endef + +else + +define hi-rule-helper # $1 = rule header +$1 + @if [ ! -f $$@ ] ; then \ + echo "Panic! $$< exists, but $$@ does not."; \ + exit 1; \ + fi + +endef + +endif + |