# Produce SCC MSDOS executable using SubC
# Build with pdmake -f makefile.scd
# Note that this is not expected to work, because there
# is more than 64k of code and we are using the small memory model

all: clean scc.exe

scc.exe: cg.o decl.o error.o expr.o gen.o main.o misc.o \
    opt.o prep.o scan.o stmt.o sym.o tree.o \
    strdup.o
  pdar386 vs temp.a
  ld86 -N --oformat msdos-mz -o scc.exe lib\crt1.o main.o temp.a lib\libscc1.a

.c.o:
  pdcc -E -D__SUBC__ -D__MSDOS__ -Dunsigned= -Dlong=int -Dshort=int -Dconst= -Ddouble=int -I . -I include -o $*.i $<
  sccdos -S $*.i
  rm $*.i
  as86 -o $@ $*.s
  rm $*.s
  pdar386 vcq temp.a $*.o

clean:
  rm -f *.o
  rm -f scc.exe
  rm -f temp.a
  copy lib\strdup.c
