X-Git-Url: http://git.megacz.com/?a=blobdiff_plain;f=mk%2Fsuffix.mk;h=60308b31dee878606dd7814ec9dba2a844409c4d;hb=e940363a7b70bc3373ebebeff5fe5075b5b141ec;hp=b27778e607db858b7dbf9ee19695b5e35303484c;hpb=85b5efb6e1e1ece5df67a01e932f966f280d8e16;p=ghc-hetmet.git diff --git a/mk/suffix.mk b/mk/suffix.mk index b27778e..60308b3 100644 --- a/mk/suffix.mk +++ b/mk/suffix.mk @@ -30,14 +30,19 @@ endif #----------------------------------------------------------------------------- # 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) - $(HC) $(HC_OPTS) -c $< -o $@ -osuf $(subst .,,$(suffix $@)) + $(HC) $(HC_OPTS) -c $< -o $@ $(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 @@ -50,17 +55,17 @@ endif %.$(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) $(HC_OPTS) -c $< -o $@ -osuf $(subst .,,$(suffix $@)) + $(HC) $(HC_OPTS) -c $< -o $@ $(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 @@ -79,18 +84,20 @@ endif %.$(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 \ - echo Panic! $< exists, but $@ does not. \ + echo Panic! $< exists, but $@ does not.; \ exit 1; \ else exit 0 ; \ fi +endif # BootingViaC + #----------------------------------------------------------------------------- # Happy Suffix Rules # @@ -99,6 +106,18 @@ endif %.hs : %.ly $(HAPPY) $(HAPPY_OPTS) $< +%.hs : %.y + $(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 # @@ -113,10 +132,10 @@ endif .PRECIOUS: %.gc %.hs : %.gc - $(GREENCARD) $(GREENCARD_OPTS) $< -o $@ + $(GREENCARD) $(GC_OPTS) $< -o $@ %.lhs : %.gc - $(GREENCARD) $(GREENCARD_OPTS) $< -o $@ + $(GREENCARD) $(GC_OPTS) $< -o $@ %.gc : %.pgc $(CPP) $(GC_CPP_OPTS) $< | perl -pe 's#\\n#\n#g' > $@ @@ -195,10 +214,6 @@ endif #----------------------------------------------------------------------------- # SGML suffix rules # -%.sgml : %.vsgml - @$(RM) $@ - expand $< | $(SGMLVERB) > $@ - %.dvi : %.sgml @$(RM) $@ $(SGML2DVI) $(SGML2DVI_OPTS) $< @@ -209,16 +224,28 @@ endif %.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) $< +# touch the .html file so that it is seen to be built + @touch $@ -%.ps : %.sgml +%.html : %.tex @$(RM) $@ - $(SGML2PS) $(SGML2PS_OPTS) $< + $(HEVEA) $(HEVEA_OPTS) $(patsubst %.tex,%.hva,$<) $< + $(HEVEA) $(HEVEA_OPTS) $(patsubst %.tex,%.hva,$<) $< + $(HACHA) $(HACHA_OPTS) $(patsubst %.tex,%.html,$<) +# Run HeVeA twice to resolve labels %.rtf : %.sgml @$(RM) $@ $(SGML2RTF) $(SGML2RTF_OPTS) $< +%.pdf : %.sgml + @$(RM) $@ + $(SGML2PDF) $(SGML2PDF_OPTS) $< + #----------------------------------------------------------------------------- # Literate suffix rules @@ -246,3 +273,10 @@ endif %.$(way_)o : %.$(way_)rc @$(RM) $@ windres $< $@ + +#----------------------------------------------------------------------------- +# Preprocessor suffix rule + +% : %.pp + rm -f $@ + $(CPP) $(CPP_OPTS) -x c $< | $(SED) -e '/^#/d' > $@