# Produce Windows executables
# links with PDPCLIB created by makefile.p32

LD=pdld
LDFLAGS=
AS=pdas
AR=ar

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
  $(AR) s temp.a
  $(LD) $(LDFLAGS) -s -o scc.exe ../../pdos/pdpclib/p32start.obj main.o temp.a ../../pdos/pdpclib/pdpwin32.lib ../../pdos/src/kernel32.lib
  del strdup.c

.c.o:
  xcc -E -D__SUBC__ -D__WIN32__ -D__STATIC__ -Dunsigned= -Dlong=int -Dshort=int -Dconst= -Ddouble=int -I ../../pdos/pdpclib -I . $<
  sccwin -S $*.i
  rm -f $*.i
  $(AS) -o $@ --oformat coff $*.s
  rm -f $*.s
  $(AR) r temp.a $*.o

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