# Produce a.out executables
# links with PDPCLIB created by makefile.pdw

LD=pdld386
LDFLAGS=
AS=pdas
AR=pdar386

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 \
    lib/strdup.o
  $(AR) vs temp.a
  $(LD) $(LDFLAGS) -N -s -e ___pdosst32 -o scc.exe ../../pdos/pdpclib/pdosst32.o main.o temp.a ../../pdos/pdpclib/pdos.a

.c.o:
  pdcc -E -D__SUBC__ -D__PDOS386__ -Dunsigned= -Dlong=int -Dshort=int -Dconst= -Ddouble=int -I . -I ../../pdos/pdpclib -o $*.i $<
  sccwin -S $*.i
  rm -f $*.i
  $(AS) -o $@ $*.s
  rm -f $*.s
  $(AR) vcq temp.a $*.o

clean:
  rm -f *.o
  rm -f scc.exe
  rm -f temp.a
