# Makefile to compile with gccwin using ANSI screen I/O

# You need to have built PDPCLIB with makefile.p32 first

CC=gccwin
COPTS=-S -O2 -D__WIN32__ -D__STATIC__ -D__NOBIVA__ -DWIN32 -DNO_QUICK -I../../pdos/pdpclib -I../../pdos/src

all: clean msged.exe

msged.exe: ansi.obj     \
     areas.obj    \
     bmg.obj      \
     config.obj   \
     control.obj  \
     date.obj     \
     dialogs.obj  \
     dirute.obj   \
     dlgbox.obj   \
     fido.obj     \
     getopts.obj  \
     help.obj     \
     helpcmp.obj  \
     helpinfo.obj \
     init.obj     \
     keycode.obj  \
     list.obj     \
     maintmsg.obj \
     makemsgn.obj \
     memextra.obj \
     menu.obj     \
     misc.obj     \
     mnu.obj      \
     msged.obj    \
     mxbt.obj     \
     normalc.obj  \
     nshow.obj    \
     quote.obj    \
     readmail.obj \
     screen.obj   \
     strextra.obj \
     system.obj   \
     template.obj \
     textfile.obj \
     userlist.obj \
     vsev.obj     \
     vsevops.obj  \
     win.obj      \
     wrap.obj     \
     unixio.obj
  xar s temp.lib
  pdld -s -o msged.exe ../../pdos/pdpclib/p32start.obj msged.obj temp.lib ../../pdos/pdpclib/pdpwin32.lib ../../pdos/src/kernel32.lib

.c.obj:
  $(CC) $(COPTS) -o $*.s $<
  pdas --oformat coff -o $@ $*.s
  rm -f $*.s
  xar r temp.lib $@

clean:
  rm -f temp.lib
