# Produces a.out executable.
# Links against library produced by makefile.pdw

CC=sccwin
CFLAGS=
LD=pdld386
LDFLAGS=
AS=pdas
COPTS=-S $(CFLAGS) -I. -I../pdpclib -I../bios -S -D__PDOS386__ -D__NOBIVA__ -DNEED_AOUT

all: clean bios.exe

bios.exe: bios.o ../bios/exeload.o
    $(LD) $(LDFLAGS) -N -s -e ___pdosst32 -o bios.exe ../pdpclib/pdosst32.o bios.o ../bios/exeload.o ../pdpclib/pdos.a

.c.o:
    pdcc -E -D__SUBC__ -Dunsigned= -Dsigned= -Dlong=int -Dshort=int -Dconst= -Ddouble=int $(COPTS) -o $*.i $<
    $(CC) -S $*.i
    rm -f $*.i
    $(AS) -o $@ $*.s
    rm -f $*.s

clean:
    rm -f *.o bios.exe
