summaryrefslogtreecommitdiff
path: root/rules/hi-rule.mk
diff options
context:
space:
mode:
authorIan Lynagh <igloo@earth.li>2009-04-26 11:42:15 +0000
committerIan Lynagh <igloo@earth.li>2009-04-26 11:42:15 +0000
commit34cc75e1a62638f2833815746ebce0a9114dc26b (patch)
treeef21e8fd7af1356beea9cce7d6efb8a65374e24c /rules/hi-rule.mk
parent74e1368d4688ee16f6decdf2cd3ebe27506b26ba (diff)
downloadhaskell-34cc75e1a62638f2833815746ebce0a9114dc26b.tar.gz
GHC new build system megapatch
Diffstat (limited to 'rules/hi-rule.mk')
-rw-r--r--rules/hi-rule.mk25
1 files changed, 25 insertions, 0 deletions
diff --git a/rules/hi-rule.mk b/rules/hi-rule.mk
new file mode 100644
index 0000000000..07b65ed8e1
--- /dev/null
+++ b/rules/hi-rule.mk
@@ -0,0 +1,25 @@
+
+# Here's an interesting rule!
+# The .hi file depends on the .o file,
+# so if the .hi file is dated earlier than the .o file (commonly the case,
+# when interfaces are stable) this rule just makes sure that the .o file,
+# is up to date. Then it does nothing to generate the .hi file from the
+# .o file, because the act of making sure the .o file is up to date also
+# updates the .hi file (if necessary).
+
+define hi-rule # $1 = way
+%.$$($1_hisuf) : %.$$($1_osuf)
+ @if [ ! -f $$@ ] ; then \
+ echo Panic! $$< exists, but $$@ does not.; \
+ exit 1; \
+ else exit 0 ; \
+ fi
+
+%.$$($1_way_)hi-boot : %.$$($1_way_)o-boot
+ @if [ ! -f $$@ ] ; then \
+ echo Panic! $$< exists, but $$@ does not.; \
+ exit 1; \
+ else exit 0 ; \
+ fi
+endef
+