projects
/
ghc-hetmet.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
[project @ 2002-02-13 10:40:24 by simonmar]
[ghc-hetmet.git]
/
mk
/
suffix.mk
diff --git
a/mk/suffix.mk
b/mk/suffix.mk
index
e3f1b4a
..
fecfd3a
100644
(file)
--- a/
mk/suffix.mk
+++ b/
mk/suffix.mk
@@
-30,14
+30,19
@@
endif
#-----------------------------------------------------------------------------
# Haskell Suffix Rules
#-----------------------------------------------------------------------------
# Haskell Suffix Rules
+# Turn off all the Haskell suffix rules if we're booting from .hc
+# files. The file bootstrap.mk contains alternative suffix rules in
+# this case.
+ifneq "$(BootingFromHc)" "YES"
+
%.$(way_)o : %.hs
$(HC_PRE_OPTS)
%.$(way_)o : %.hs
$(HC_PRE_OPTS)
- $(HC) $(HC_OPTS) -c $< -o $@ -osuf $(subst .,,$(suffix $@))
+ $(HC) $(HC_OPTS) -c $< -o $@
$(HC_POST_OPTS)
%.$(way_)o : %.lhs
$(HC_PRE_OPTS)
$(HC_POST_OPTS)
%.$(way_)o : %.lhs
$(HC_PRE_OPTS)
- $(HC) $(HC_OPTS) -c $< -o $@ -osuf $(subst .,,$(suffix $@))
+ $(HC) $(HC_OPTS) -c $< -o $@
$(HC_POST_OPTS)
%.$(way_)hc : %.lhs
$(HC_POST_OPTS)
%.$(way_)hc : %.lhs
@@
-50,17
+55,17
@@
endif
%.$(way_)o : %.$(way_)hc
$(HC_PRE_OPTS)
%.$(way_)o : %.$(way_)hc
$(HC_PRE_OPTS)
- $(HC) $(HC_OPTS) -c $< -o $@ -osuf $(subst .,,$(suffix $@))
+ $(HC) $(HC_OPTS) -c $< -o $@
$(HC_POST_OPTS)
%.$(way_)o : %.hc
$(HC_PRE_OPTS)
$(HC_POST_OPTS)
%.$(way_)o : %.hc
$(HC_PRE_OPTS)
- $(HC) $(HC_OPTS) -c $< -o $@ -osuf $(subst .,,$(suffix $@))
+ $(HC) $(HC_OPTS) -c $< -o $@
$(HC_POST_OPTS)
%.$(way_)s : %.$(way_)hc
$(HC_PRE_OPTS)
$(HC_POST_OPTS)
%.$(way_)s : %.$(way_)hc
$(HC_PRE_OPTS)
- $(HC) $(HC_OPTS) -S $< -o $@ -osuf $(subst .,,$(suffix $@))
+ $(HC) $(HC_OPTS) -S $< -o $@
$(HC_POST_OPTS)
%.$(way_)hc : %.lhc
$(HC_POST_OPTS)
%.$(way_)hc : %.lhc
@@
-79,18
+84,20
@@
endif
%.$(way_)hi : %.$(way_)o
@if [ ! -f $@ ] ; then \
%.$(way_)hi : %.$(way_)o
@if [ ! -f $@ ] ; then \
- echo Panic! $< exists, but $@ does not. \
+ echo Panic! $< exists, but $@ does not.; \
exit 1; \
else exit 0 ; \
fi
%.$(way_)hi : %.$(way_)hc
@if [ ! -f $@ ] ; then \
exit 1; \
else exit 0 ; \
fi
%.$(way_)hi : %.$(way_)hc
@if [ ! -f $@ ] ; then \
- echo Panic! $< exists, but $@ does not. \
+ echo Panic! $< exists, but $@ does not.; \
exit 1; \
else exit 0 ; \
fi
exit 1; \
else exit 0 ; \
fi
+endif # BootingViaC
+
#-----------------------------------------------------------------------------
# Happy Suffix Rules
#
#-----------------------------------------------------------------------------
# Happy Suffix Rules
#
@@
-103,6
+110,15
@@
endif
$(HAPPY) $(HAPPY_OPTS) $<
#-----------------------------------------------------------------------------
$(HAPPY) $(HAPPY_OPTS) $<
#-----------------------------------------------------------------------------
+# hsc2hs Suffix Rules
+#
+ifneq "$(BootingFromHc)" "YES"
+%_hsc.c %_hsc.h %.hs : %.hsc
+ $(HSC2HS) $(HSC2HS_OPTS) $<
+ @touch $(patsubst %.hsc,%_hsc.c,$<)
+endif
+
+#-----------------------------------------------------------------------------
# Lx Suffix Rules
#
# Lx Suffix Rules
#
@@
-127,6
+143,8
@@
endif
#-----------------------------------------------------------------------------
# C-related suffix rules
#-----------------------------------------------------------------------------
# C-related suffix rules
+ifeq "$(UseGhcForCc)" ""
+
%.$(way_)o : %.$(way_)s
@$(RM) $@
$(AS) $(AS_OPTS) -o $@ $< || ( $(RM) $@ && exit 1 )
%.$(way_)o : %.$(way_)s
@$(RM) $@
$(AS) $(AS_OPTS) -o $@ $< || ( $(RM) $@ && exit 1 )
@@
-139,21
+157,44
@@
endif
@$(RM) $@
$(CC) $(CC_OPTS) -c $< -o $@
@$(RM) $@
$(CC) $(CC_OPTS) -c $< -o $@
-#%.$(way_)s : %.c
-# @$(RM) $@
-# $(CC) $(CC_OPTS) -S $< -o $@
+%.$(way_)s : %.c
+ @$(RM) $@
+ $(CC) $(CC_OPTS) -S $< -o $@
-%.c : %.flex
+else
+
+%.$(way_)o : %.$(way_)s
@$(RM) $@
@$(RM) $@
- $(FLEX) -t $(FLEX_OPTS) $< > $@ || ( $(RM) $@ && exit 1 )
-%.c : %.lex
+ $(HC) $(GHC_CC_OPTS) -c $< -o $@
+
+%.$(way_)o : %.c
@$(RM) $@
@$(RM) $@
- $(FLEX) -t $(FLEX_OPTS) $< > $@ || ( $(RM) $@ && exit 1 )
+ $(HC) $(GHC_CC_OPTS) -c $< -o $@
+
+%.$(way_)o : %.S
+ @$(RM) $@
+ $(HC) $(GHC_CC_OPTS) -c $< -o $@
+
+%.$(way_)s : %.c
+ @$(RM) $@
+ $(HC) $(GHC_CC_OPTS) -c $< -o $@
+
+endif
# stubs are automatically generated and compiled by GHC
%_stub.$(way_)o: %.o
@:
# stubs are automatically generated and compiled by GHC
%_stub.$(way_)o: %.o
@:
+# -----------------------------------------------------------------------------
+# Flex/lex
+
+%.c : %.flex
+ @$(RM) $@
+ $(FLEX) -t $(FLEX_OPTS) $< > $@ || ( $(RM) $@ && exit 1 )
+%.c : %.lex
+ @$(RM) $@
+ $(FLEX) -t $(FLEX_OPTS) $< > $@ || ( $(RM) $@ && exit 1 )
+
#-----------------------------------------------------------------------------
# Yacc stuff
#-----------------------------------------------------------------------------
# Yacc stuff
@@
-208,7
+249,12
@@
endif
%.html : %.sgml
@$(RM) $@
%.html : %.sgml
@$(RM) $@
+# $(PERL) $(COLLATEINDEX) -N -o index.sgml
+# $(JADE) -t sgml -V html-index -d $(SGMLSTYLESHEET) -c $(DOCBOOK_CATALOG) $<
+# $(PERL) $(COLLATEINDEX) -N -o index.sgml
$(SGML2HTML) $(SGML2HTML_OPTS) $<
$(SGML2HTML) $(SGML2HTML_OPTS) $<
+# touch the .html file so that it is seen to be built
+ @touch $@
%.html : %.tex
@$(RM) $@
%.html : %.tex
@$(RM) $@
@@
-221,6
+267,10
@@
endif
@$(RM) $@
$(SGML2RTF) $(SGML2RTF_OPTS) $<
@$(RM) $@
$(SGML2RTF) $(SGML2RTF_OPTS) $<
+%.pdf : %.sgml
+ @$(RM) $@
+ $(SGML2PDF) $(SGML2PDF_OPTS) $<
+
#-----------------------------------------------------------------------------
# Literate suffix rules
#-----------------------------------------------------------------------------
# Literate suffix rules
@@
-248,3
+298,10
@@
endif
%.$(way_)o : %.$(way_)rc
@$(RM) $@
windres $< $@
%.$(way_)o : %.$(way_)rc
@$(RM) $@
windres $< $@
+
+#-----------------------------------------------------------------------------
+# Preprocessor suffix rule
+
+% : %.pp
+ rm -f $@
+ $(CPP) $(CPP_OPTS) -x c $< | $(SED) -e '/^#/d' > $@