1# This file is part of the FreeType project.
2#
3# It builds the library and test programs for emx-gcc under OS/2.
4#
5# You will need GNU make.
6#
7# Use this file while in the lib directory with the following statement:
8#
9#   make -f arch/os2/Makefile.emx
10
11ARCH = arch/os2
12FT_MAKEFILE = $(ARCH)/Makefile.emx
13
14CC = gcc
15
16#CFLAGS = -W -Wall -O0 -g -ansi -pedantic -I$(ARCH) -I. -Iextend
17
18CFLAGS = -Wall -O3 -fno-inline -fomit-frame-pointer \
19         -g -ansi -pedantic -I$(ARCH) -I. -Iextend
20
21#CFLAGS = -Wall -ansi -pedantic -O2 -s -I$(ARCH) -I. -Iextend
22
23TTFILE = $(ARCH)/os2file.c
24TTMEMORY = ./ttmemory.c
25TTMUTEX = ./ttmutex.c
26
27PORT = $(TTFILE) $(TTMEMORY) $(TTMUTEX)
28
29SRC_X = extend/ftxgasp.c extend/ftxkern.c  extend/ftxpost.c \
30        extend/ftxcmap.c extend/ftxwidth.c extend/ftxsbit.c \
31        extend/ftxgsub.c extend/ftxgpos.c  extend/ftxopen.c \
32        extend/ftxgdef.c
33OBJS_X = $(SRC_X:.c=.o)
34
35SRC_M = ttapi.c     ttcache.c   ttcalc.c   ttcmap.c  ttdebug.c \
36        ttgload.c   ttinterp.c  ttload.c   ttobjs.c \
37        ttraster.c  ttextend.c  $(PORT)
38OBJS_M = $(SRC_M:.c=.o) $(OBJS_X)
39
40SRC_S = $(ARCH)/freetype.c
41OBJ_S = $(SRC_S:.c=.o)
42OBJS_S = $(OBJ_S) $(OBJS_X)
43
44SRCD_S  = $(ARCH)/freetypd.c
45OBJD_S  = $(SRCD_S:.c=.o)
46OBJDS_S = $(OBJD_S) $(OBJS_X)
47
48%.o: %.c
49	$(CC) $(CFLAGS) -c -o $@ $<
50
51.PHONY: all debug clean distclean depend
52
53
54all:
55	$(MAKE) -f $(FT_MAKEFILE) LIB_FILES=OBJS_S libttf.a
56
57debug:
58	$(MAKE) -f $(FT_MAKEFILE) LIB_FILES=OBJS_M libttf.a
59
60debugger:
61	$(MAKE) -f $(FT_MAKEFILE) LIB_FILES=OBJDS_S libttfd.a
62
63$(OBJ_S): $(SRC_S) $(SRC_M)
64$(OBJD_S): $(SRCD_S) $(SRC_M)
65
66libttf.a: $($(LIB_FILES))
67	-del $@
68	ar src $@ $^
69
70libttfd.a: $(OBJDS)
71
72libttfd.a: $(OBJDS)
73	-del $@
74	ar src $@ $^
75
76clean:
77	-del $(subst /,\,$(OBJS_S))
78	-del $(subst /,\,$(OBJS_M))
79
80distclean: clean
81	-del dep.end
82	-del libttf.a
83
84depend: $(SRC_S) $(SRC_M) $(SRC_X)
85	$(CC) -E -M $^ > dep.end
86
87ifeq (dep.end,$(wildcard dep.end))
88  include dep.end
89endif
90
91# end of Makefile.emx
92