# Released to the public domain.
#
# Anyone and anything may copy, edit, publish,
# use, compile, sell and distribute this work
# and all its parts in any form for any purpose,
# commercial and non-commercial, without any restrictions,
# without complying with any conditions
# and by any means.

# Produces OS/2 1.x executable.
# Links against library produced by makefile.oss

# We need to mark the module as fullscreen ("Form os2 full")
# so that the terminal can be put into raw mode


CC=wcl
# Choose t (tiny), s (small), m (medium), c (compact), l (large), h (huge)
MODELC=h
# If you want to use a 32-bit size_t in huge memory model, uncomment this
SZ4=-D__SZ4__
COPTS=$(SZ4) -zdf -D__16BIT__ -I. -oneatx \
      -I..\pdos\pdpclib \
      -r -ecc -zp1 -q -w -c -I. -m$(MODELC) -zl -D__OS2__ -fpi87 -s -zu \
      -DC90

AR=wlib

TARGET=uemacs.exe
TEMP_ARCHIVE=temp.lib
OBJS=		ansi.obj basic.obj bind.obj buffer.obj display.obj file.obj \
		fileio.obj line.obj lock.obj main.obj random.obj region.obj \
		search.obj spawn.obj termio.obj window.obj word.obj

all: clean $(TARGET)

$(TARGET): $(OBJS)
  wlink File ..\pdos\pdpclib\os1strt.obj,main Name $(TARGET) Form os2 full Library $(TEMP_ARCHIVE),..\pdos\pdpclib\watcom.lib,..\pdos\pdpclib\os2.lib Option quiet,stack=8192,start=___intstart,map,verbose,dosseg,stub=..\pdos\pdpclib\needpdos.exe
  rm -f $(TEMP_ARCHIVE)

.c.obj:
  $(CC) $(COPTS) $<
  $(AR) -b -q $(TEMP_ARCHIVE) +$@

clean:
  rm -f *.obj
  rm -f $(TARGET)
  rm -f $(TEMP_ARCHIVE)
