# This file is part of the FreeType project.
#
# It builds the library and test programs for amiga using ADE Enviroment.
#
# You will need GNU make.
#
# Use this file while in the lib directory with the following statement:
#
#   make -f arch/amigaos/Makefile.gcc

ARCH = arch/amigaos
FT_MAKEFILE = $(ARCH)/Makefile.gcc

AR = ar
RM = rm

CC = gcc

CFLAGS = -Wall -pedantic -ansi -O2 -g -noixemul -I$(ARCH) -I. -Iextend

SRC_X = extend/ftxgasp.c extend/ftxkern.c  extend/ftxpost.c \
        extend/ftxcmap.c extend/ftxwidth.c extend/ftxsbit.c \
        extend/ftxgsub.c extend/ftxgpos.c  extend/ftxgdef.c \
        extend/ftxopen.c
OBJS_X = $(SRC_X:.c=.o)

SRC_M = ttapi.c ttcache.c ttcalc.c ttcmap.c ttdebug.c \
        ttextend.c ttfile.c ttgload.c ttinterp.c ttload.c \
        ttmemory.c ttmutex.c ttobjs.c ttraster.c
OBJS_M = $(SRC_M:.c=.o) $(OBJS_X)

SRC_S = $(ARCH)/freetype.c
OBJ_S = $(SRC_S:.c=.o)
OBJS_S = $(OBJ_S) $(OBJS_X)


%.o: %.c
	$(CC) $(CFLAGS) -c -o $@ $<

.PHONY: all debug clean distclean


all:
	$(MAKE) -f $(FT_MAKEFILE) LIB_FILES=OBJS_S libttf.a

debug:
	$(MAKE) -f $(FT_MAKEFILE) LIB_FILES=OBJS_M libttf.a


$(OBJ_S): $(SRC_S) $(SRC_M)


libttf.a: $($(LIB_FILES)) 
	$(AR) src $@ $^

clean:
	$(RM) $($(LIB_FILES))

distclean: clean
	$(RM) dep.end libttf.a

depend: $(SRC_S) $(SRC_M) $(SRC_X)
	$(CC) -E -M $^ > dep.end

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

# end of Makefile.gcc
