Commit 1353b4a1 authored by ian@well-typed.com's avatar ian@well-typed.com

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.
parent 5cb08808
......@@ -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
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment