# This file is part of the FreeType project.
#
# It builds the library and test programs for emx-gcc under OS/2.
#
# You will need GNU make.
#
# Use this file while in the lib directory with the following statement:
#
#   make -f arch/os2/Makefile.emx

CC = gcc

CFLAGS = -Wall -O2 -g -ansi -pedantic -Iarch/os2 -I. -Iextend
#CFLAGS = -Wall -ansi -pedantic -O2 -s -Iarch/os2 -I. -Iextend

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

TTMEMORY_SRC = .\ttmemory.c
TTMEMORY     = ttmemory.o

TTMUTEX_SRC = .\ttmutex.c
TTMUTEX     = ttmutex.o

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=.o)


all: libttf.a

$(TTFILE): $(TTFILE_SRC)
	$(CC) -c $(CFLAGS) $^ -o $@

$(TTMEMORY): $(TTMEMORY_SRC)
	$(CC) -c $(CFLAGS) $^ -o $@

$(TTMUTEX): $(TTMUTEX_SRC)
	$(CC) -c $(CFLAGS) $^ -o $@

libttf.a: $(OBJ) $(PORT_OBJS)
	-del $@
	ar src $@ $^

clean:
	-del *.o
	-del extend\ftxkern.o
	-del extend\ftxgasp.o

distclean: clean
	-del dep.end
	-del libttf.a

depend:
	$(CC) -E -M $(SRC) > dep.end

ifeq (dep.end,$(wildcard dep.end))
  include dep.end
endif

# end of Makefile.emx
