# This file is part of the FreeType project.
#
# It builds the library and test programs for IBM VisualAge C++ under OS/2.
#
# You will need nmake.
#
# Use this file while in the lib directory with the following statement:
#
#   nmake -f arch\os2\Makefile.icc
#
# Optimisations are turned off, as it seems icc.exe produces buggy code
# in the file ttraster.c (as a consequence, some test programs crash when
# using font-smoothing (gray levels) mode)
#

CC = icc
CFLAGS = -O- -Ti+ -Sa -W3 -Wpro- -Wcnd- -Q+ -Iarch\os2 -I. -Iextend

#
# NOTE : optimisations are discarded, as it seems the Visual Age
#        is buggy when producing ttraster.obj. The resulting code
#        crashes in some circumstances (performing vertical dropout
#        control when rendering smoothed outlines) !!
#

TTFILE_SRC = arch\os2\ttfile.c
TTFILE     = ttfile.obj

TTMEMORY_SRC = .\ttmemory.c
TTMEMORY     = ttmemory.obj

TTMUTEX_SRC = .\ttmutex.c
TTMUTEX     = ttmutex.obj

PORT_SRC  = $(TTFILE_SRC) $(TTMEMORY_SRC) $(TTMUTEX_SRC)
PORT_OBJS = $(TTFILE) $(TTMEMORY) $(TTMUTEX)


SRC = ttapi.c     ttcache.c   ttcalc.c    ttcmap.c    tterror.c   \
      ttgload.c   ttinterp.c  ttlists.c   ttload.c    ttobjs.c    \
      ttobjs.c    ttraster.c  ttextend.c  \
      \
      extend/ftxgasp.c extend/ftxkern.c

OBJ = $(SRC:.c=.obj)


all: libttf.lib

$(TTFILE): $(TTFILE_SRC)
	$(CC) -C $(CFLAGS) $? /Fo=$@

$(TTMEMORY): $(TTMEMORY_SRC)
	$(CC) -C $(CFLAGS) $? /Fo=$@

$(TTMUTEX): $(TTMUTEX_SRC)
	$(CC) -C $(CFLAGS) $? /Fo=$@

libttf.lib: $(OBJ) extend\ftxgasp.obj extend\ftxkern.obj $(PORT_OBJS)
  !ilib /nologo /noignorecase /nobackup $@ +$?,,


extend\ftxgasp.obj: extend\ftxgasp.c
  icc $(CFLAGS) -C $?
  -@move ftxgasp.obj extend

extend\ftxkern.obj: extend\ftxkern.c
  icc $(CFLAGS) -C $?
  -@move ftxkern.obj extend

clean:
  -del *.obj
  -del extend\*.obj

distclean: clean
  -del libttf.lib

# end of Makefile.icc
