Fix Trac #3219: type of a record update
[ghc-hetmet.git] / rules / hi-rule.mk
1 # -----------------------------------------------------------------------------
2 #
3 # (c) 2009 The University of Glasgow
4 #
5 # This file is part of the GHC build system.
6 #
7 # To understand how the build system works and how to modify it, see
8 #      http://hackage.haskell.org/trac/ghc/wiki/Building/Architecture
9 #      http://hackage.haskell.org/trac/ghc/wiki/Building/Modifying
10 #
11 # -----------------------------------------------------------------------------
12
13
14 # Here's an interesting rule!
15 # The .hi file depends on the .o file,
16 # so if the .hi file is dated earlier than the .o file (commonly the case,
17 # when interfaces are stable) this rule just makes sure that the .o file,
18 # is up to date.  Then it does nothing to generate the .hi file from the
19 # .o file, because the act of making sure the .o file is up to date also
20 # updates the .hi file (if necessary).
21
22 define hi-rule # $1 = way
23 %.$$($1_hisuf) : %.$$($1_osuf)
24         @if [ ! -f $$@ ] ; then \
25             echo Panic! $$< exists, but $$@ does not.; \
26             exit 1; \
27         else exit 0 ; \
28         fi
29
30 %.$$($1_way_)hi-boot : %.$$($1_way_)o-boot
31         @if [ ! -f $$@ ] ; then \
32             echo Panic! $$< exists, but $$@ does not.; \
33             exit 1; \
34         else exit 0 ; \
35         fi
36 endef
37