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

CC=gccwin
CFLAGS=-O2
LD=ldwin
LDFLAGS=
AS=aswin
AR=arwin
COPTS=-S $(CFLAGS) -fno-common -funsigned-char -ansi -I. -I../../pdos/pdpclib -D__WIN32__

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
  $(LD) $(LDFLAGS) -s -o scc.exe ../../pdos/pdpclib/w32start.o main.o temp.a ../../pdos/pdpclib/msvcrt.a

.c.o:
  $(CC) $(COPTS) -o $*.s $<
  $(AS) -o $@ $*.s
  rm -f $*.s
  arwin r temp.a $*.o

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