# Build a PDOS/386 ELF executable using Watcom

CC=wcl386
COPTS=-q -s -3s -zl -fpi87 -c -I. -I..\src -D__32BIT__ -D__PDOS386__ -DNOLIBALLOC
# -ecc

pdptest.exe: pdosst32.obj pdptest.obj stdio.obj string.obj stdlib.obj \
       start.obj time.obj errno.obj assert.obj signal.obj locale.obj \
       ctype.obj setjmp.obj math.obj pos.obj support.obj pdossupc.obj bos.obj
  rm -f watcom.lib
  wlib -b -q watcom +pdosst32.obj
  wlib -b -q watcom +stdio.obj
  wlib -b -q watcom +string.obj
  wlib -b -q watcom +stdlib.obj
  wlib -b -q watcom +start.obj
  wlib -b -q watcom +time.obj
  wlib -b -q watcom +errno.obj
  wlib -b -q watcom +assert.obj
  wlib -b -q watcom +signal.obj
  wlib -b -q watcom +locale.obj
  wlib -b -q watcom +ctype.obj
  wlib -b -q watcom +setjmp.obj
  wlib -b -q watcom +math.obj
  wlib -b -q watcom +pos.obj
  wlib -b -q watcom +support.obj
  wlib -b -q watcom +pdossupc.obj
  wlib -b -q watcom +bos.obj
  wlink File pdosst32.obj,pdptest.obj Name pdptest.exe Form elf Library watcom.lib Option map,quiet,start=___pdosst32

bos.obj: ../src/bos.c
  $(CC) $(COPTS) ..\src\bos.c

pos.obj: ../src/pos.c
  $(CC) $(COPTS) ..\src\pos.c

support.obj: ../src/support.s
  aswin -o $@ ../src/support.s

.c.obj:
  $(CC) $(COPTS) $<

.s.obj:
  aswin -o $@ $<
