1# This file is part of the FreeType project.
2#
3# It builds the library and test programs for BC++ for Win32.
4#
5# Tested with Borland C++ v.4.02, 5.0, and Borland C++ builder 4.
6# You will need Borland MAKE.
7#
8#
9# Use this file while in the 'test' directory with the following statement:
10#
11#   make -farch\win32\Makefile.BC
12#
13#
14# A DLL version of the library can be built and then used with
15#
16#   make -DDLL -farch/win16/Makefile.BC dll
17#
18# (do not forget to define DLL, otherwise the link phase will fail).
19#
20#
21# A debug version can be obtained with
22#
23#   make -DDEBUG -farch\win32\Makefile.BC
24
25ARCH = arch\win32
26FT_MAKEFILE = $(ARCH)\Makefile.BC
27FT_DLL = ft13_32.dll
28
29CC = bcc32
30
31LIBDIR = ..\lib
32INCDIRS = -I$(LIBDIR);$(LIBDIR)\$(ARCH);.;$(LIBDIR)\extend
33SPURIOUS_WARNINGS = -w-nak -w-par -w-use -w-aus -w-stu -w-stv -w-cln -w-sig -w-pia
34CFLAGS =  -i48 $(INCDIRS) $(SPURIOUS_WARNINGS)
35
36!ifndef DEBUG
37CFLAGS = $(CFLAGS) -O2 -A
38LDFLAGS = -WC
39!else
40CFLAGS = $(CFLAGS) -v
41LDFLAGS = -v -WC
42!endif
43
44!ifdef DLL
45CFLAGS = $(CFLAGS) -DFREETYPE_DLL
46!endif
47
48# Windows graphic driver
49GDRIVER = $(ARCH)\gw_win32.c
50
51DISPLAY = display.c
52
53G1SRC = gmain.c blitter.c $(GDRIVER)
54GSRC = $(DISPLAY) $(G1SRC)
55
56GOBJ = $(GSRC:.c=.obj)
57G1OBJ = $(G1SRC:.c=.obj)
58
59
60SRC = arabic.c \
61      common.c \
62      ftdump.c \
63      fterror.c \
64      ftlint.c \
65      ftmetric.c \
66      ftsbit.c \
67      ftstring.c \
68      ftstrpnm.c \
69      ftstrtto.c \
70      fttimer.c \
71      ftview.c \
72      ftzoom.c
73
74OBJ = $(SRC:.c=.obj)
75
76
77.c.obj:
78	$(CC) -c -o$* @&&|
79	    $(CFLAGS) $<
80|
81
82EXEFILES = ftdump.exe \
83           fterror.exe \
84           ftlint.exe \
85           ftmetric.exe \
86           ftsbit.exe \
87           ftstring.exe \
88           ftstrpnm.exe \
89           ftstrtto.exe \
90           fttimer.exe \
91           ftview.exe \
92           ftzoom.exe
93
94!ifndef DEBUG
95# Skipped if DEBUG build
96all: freetype $(EXEFILES)
97
98dll: the_dll $(EXEFILES)
99
100!else
101# Skipped if non-DEBUG build
102default_target: debug
103dll: the_debug_dll $(EXEFILES)
104
105!endif
106
107debug: freetype_debug $(EXEFILES)
108
109freetype:
110	cd $(LIBDIR)
111	make -f$(FT_MAKEFILE) all
112	cd ..\test
113
114freetype_debug:
115	cd $(LIBDIR)
116	make -f$(FT_MAKEFILE) -DDEBUG debug
117	cd ..\test
118
119the_dll:
120	cd $(LIBDIR)
121	make -f$(FT_MAKEFILE) -DDLL dll
122	cd ..\test
123    -copy $(LIBDIR)\$(FT_DLL)
124
125the_debug_dll:
126	cd $(LIBDIR)
127	make -f$(FT_MAKEFILE) -DDEBUG -DDLL dll
128	cd ..\test
129    -copy $(LIBDIR)\$(FT_DLL)
130
131
132# C compilers are unable to include <windows.h> in ANSI mode,
133# because of the // comments...
134# So we have a special rule for this file, to build it outside ANSI.
135$(GDRIVER:.c=.obj):
136	$(CC) -c -o$* @&&|
137	    $(CFLAGS) -A- $*.c
138|
139
140
141# Borland versions of make are unable to use the $** variable inside
142# implicit rules (like .obj.exe:). The job have to be done by hand. :-(
143ftzoom.exe: $(G1OBJ) ftzoom.obj common.obj $(LIBDIR)\libttf.lib
144	$(CC) $(LDFLAGS) ftzoom.obj $(G1OBJ) common.obj $(LIBDIR)\libttf.lib
145
146ftview.exe: $(GOBJ) ftview.obj common.obj $(LIBDIR)\libttf.lib
147	$(CC) $(LDFLAGS) ftview.obj $(GOBJ) common.obj $(LIBDIR)\libttf.lib
148
149ftstring.exe: $(GOBJ) ftstring.obj common.obj $(LIBDIR)\libttf.lib
150	$(CC) $(LDFLAGS) ftstring.obj $(GOBJ) common.obj $(LIBDIR)\libttf.lib
151
152ftstrtto.exe: $(GOBJ) ftstrtto.obj common.obj arabic.obj $(LIBDIR)\libttf.lib
153	$(CC) $(LDFLAGS) ftstrtto.obj $(GOBJ) common.obj arabic.obj \
154	                  $(LIBDIR)\libttf.lib
155
156fttimer.exe: $(G1OBJ) fttimer.obj common.obj $(LIBDIR)\libttf.lib
157	$(CC) $(LDFLAGS) fttimer.obj $(G1OBJ) common.obj $(LIBDIR)\libttf.lib
158
159ftlint.exe: ftlint.obj common.obj $(LIBDIR)\libttf.lib
160	$(CC) $(LDFLAGS) ftlint.obj common.obj $(LIBDIR)\libttf.lib
161
162ftdump.exe: ftdump.obj common.obj $(LIBDIR)\libttf.lib
163	$(CC) $(LDFLAGS) ftdump.obj common.obj $(LIBDIR)\libttf.lib
164
165ftstrpnm.exe: ftstrpnm.obj common.obj $(LIBDIR)\libttf.lib
166	$(CC) $(LDFLAGS) ftstrpnm.obj common.obj $(LIBDIR)\libttf.lib
167
168ftsbit.exe: ftsbit.obj common.obj $(LIBDIR)\libttf.lib
169	$(CC) $(LDFLAGS) ftsbit.obj common.obj $(LIBDIR)\libttf.lib
170
171ftmetric.exe: ftmetric.obj common.obj $(LIBDIR)\libttf.lib
172	$(CC) $(LDFLAGS) ftmetric.obj common.obj $(LIBDIR)\libttf.lib
173
174fterror.exe: fterror.obj common.obj $(LIBDIR)\libttf.lib
175	$(CC) $(LDFLAGS) fterror.obj common.obj $(LIBDIR)\libttf.lib
176
177
178clean: do_clean
179	cd $(LIBDIR)
180	make -f$(FT_MAKEFILE) clean
181	cd ..\test
182
183distclean: do_clean
184	cd $(LIBDIR)
185	make -f$(FT_MAKEFILE) distclean
186	cd ..\test
187	-del *.exe
188	-del *.dll
189
190do_clean:
191	-del *.obj
192	-del $(ARCH)\*.obj
193	-del *.tds
194
195!include "$(ARCH)\depend.win"
196
197# end of Makefile
198