# This builds a PDOS-generic executable
# No need to build a library, this is self-contained

# The executable can be run under the BIOS built
# with makebios.w32, makebios.lnp or makebios.efi

# The executable is in PE format

CC=gccwin
AS=pdas --oformat coff
LD=pdld --oformat coff
COPTS=-fno-builtin -fno-common -S -O2 -U__WIN32__ \
    -DHAVE_DIR -D__PDOS386__ -D__PDOSGEN__ -D__NOBIVA__ \
    -I . -I../pdpclib -I../src

all: clean pcomm.exe

pcomm.exe: ../pdpclib/pgastart.o pcomm.o ../pdpclib/string.o
  rm -f pcomm.exe
  $(LD) -s -e ___crt0 -o pcomm.exe ../pdpclib/pgastart.o pcomm.o ../pdpclib/string.o

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

clean:
  rm -f pcomm.exe
