# we need the stupid copies and del because old FPK-Pascal don't handle
# ppc386 ..\crt correct

compiler = ppc386 -Sg -OGa

all : system.ppu prt0.o crt.ppu go32.ppu strings.ppu dos.ppu printer.ppu \
        mouse.ppu getopts.ppu graph.ppu

printer.ppu : ..\printer.pp system.ppu
        copy ..\printer.pp
        $(compiler) printer
        del printer.pp

getopts.ppu : ..\..\getopts.pp system.ppu
        copy ..\..\getopts.pp
        $(compiler) getopts
        del getopts.pp

graph.ppu : ..\graph.pp go32.ppu system.ppu
        copy ..\graph.pp
        copy ..\*.ppi
        $(compiler) graph
        copy ..\graph.pp
        del *.ppi
        del graph.pp

strings.ppu : ..\..\strings.pp system.ppu
        copy ..\..\strings.pp
        $(compiler) strings
        del strings.pp

dos.ppu : ..\dos.pp go32.ppu system.ppu strings.ppu
        copy ..\dos.pp
        $(compiler) dos
        del dos.pp

system.ppu : system.pp ..\systemh.inc ..\system.inc ..\real2str.inc \
        ..\mathh.inc ..\math.inc ..\set.inc ..\innr.inc heap.inc
        copy ..\systemh.inc
        copy ..\system.inc
        copy ..\real2str.inc
        copy ..\mathh.inc
        copy ..\math.inc
        copy ..\set.inc
        copy ..\innr.inc
        $(compiler) -Us system
        del systemh.inc
        del system.inc
        del real2str.inc
        del mathh.inc
        del math.inc
        del set.inc
        del innr.inc


prt0.o : prt0.s
        as -o prt0.o prt0.s

crt.ppu : ..\crt.pp ..\modes.inc go32.ppu system.ppu
        copy ..\crt.pp .
        copy ..\modes.inc .
        $(compiler) crt
        del crt.pp
        del modes.inc

go32.ppu : ..\go32.pp system.ppu
        copy ..\go32.pp .
        $(compiler) go32
        del go32.pp

mouse.ppu : mouse.pp system.ppu
        $(compiler) mouse
