# Common GNUmakefile for polytypic programs ### Variables to set in the "calling" makefile: # MAIN = main Haskell module to run (normally imports START) # START = starting point for polytypic instantiation (no .phs extension) # phssources = all .phs files in the project # catsources = files to be prepended to START.Hs # hssources = all .hs files in the project # PolyPFLAGS = extra flags to PolyP # example: PolyPFLAGS = -p ArrTypes.hs -r start # Extension names: .phs -- input polyp modules # .Phs -- one big import-chased polyp file # .Hs -- output from polyp (may need som expl. types) # .hs -- final Haskell code produced ################################################################ runhugs = runhugs PolyPDIR = ${HOME} # PolyP = $(PolyPDIR)/bin/polyp PolyP = polyp # CHASE = perl $(PolyPDIR)/bin/chase CHASE = chase run: $(MAIN).hs $(START).hs $(hssources) hugs $(MAIN).hs check: $(MAIN).hs $(START).hs $(hssources) $(MAIN).out $(runhugs) $(MAIN) | diff - $(MAIN).out $(START).Phs: $(phssources) $(CHASE) $(CHASEFLAGS) $(START).phs > $@ $(START).Hs: $(START).Phs $(PolyP) $(PolyPFLAGS) $? > $@ $(START).hs: $(catsources) $(START).Hs cat $(catsources) $(START).Hs > $@ print: more $(docfiles) $(phssources) $(hssources) $(catsources) | enscript -2r clean: rm -f *.Phs *.Hs veryclean: clean rm -f $(START).hs