# This is the makefile used for building a.out files
# for PDOS using EMX 0.9d on Freedos/MSDOS
# For the 32-bit version of PDOS we define __PDOS386__
# but the 16-bit version is just MSDOS

CC=gcc
COPTS=-fno-common -c -s -O -I. -I..\src -D__PDOS386__

pdptest.exe: pdosst32.o pdptest.o stdio.o string.o stdlib.o \
       start.o time.o errno.o assert.o signal.o locale.o \
       ctype.o setjmp.o math.o pos.o support.o pdossupc.o \
       liballoc.o
  if exist pdos.a del pdos.a
  ar r pdos.a pdosst32.o stdio.o string.o stdlib.o
  ar r pdos.a start.o time.o errno.o assert.o signal.o
  ar r pdos.a locale.o ctype.o setjmp.o math.o
  ar r pdos.a pos.o support.o pdossupc.o liballoc.o
  ld -r -s -o pdptest pdosst32.o pdptest.o pdos.a
  if exist pdptest.exe del pdptest.exe
  ren pdptest pdptest.exe

pos.o: ..\src\pos.c
  $(CC) $(COPTS) ..\src\pos.c

support.o: ..\src\support.s
  $(CC) $(COPTS) ..\src\support.s

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

.s.o:
  $(CC) $(COPTS) $<

