GHC new build system megapatch
[ghc-hetmet.git] / rules / hi-rule.mk
1
2 # Here's an interesting rule!
3 # The .hi file depends on the .o file,
4 # so if the .hi file is dated earlier than the .o file (commonly the case,
5 # when interfaces are stable) this rule just makes sure that the .o file,
6 # is up to date.  Then it does nothing to generate the .hi file from the
7 # .o file, because the act of making sure the .o file is up to date also
8 # updates the .hi file (if necessary).
9
10 define hi-rule # $1 = way
11 %.$$($1_hisuf) : %.$$($1_osuf)
12         @if [ ! -f $$@ ] ; then \
13             echo Panic! $$< exists, but $$@ does not.; \
14             exit 1; \
15         else exit 0 ; \
16         fi
17
18 %.$$($1_way_)hi-boot : %.$$($1_way_)o-boot
19         @if [ ! -f $$@ ] ; then \
20             echo Panic! $$< exists, but $$@ does not.; \
21             exit 1; \
22         else exit 0 ; \
23         fi
24 endef
25