1# This file is part of the FreeType project.
2#
3# It builds the library for Microsoft C for Windows, large model.
4# It also works for Visual C++ 1.x 16-bit compilers, but you should
5# instead use the Makefile customized for it, Makefile.VC.
6# Due to size constraints, it does not try to pack all modules into one.
7#
8# You will need NMAKE.
9#
10# Use this file while in the lib directory with the following statement:
11#
12#   nmake /f arch\win16\Makefile.MS
13#
14#
15# A debug version can be obtained with
16#
17#   nmake DEBUG=1 /f arch\win16\Makefile.MS
18
19ARCH = arch\win16
20FT_MAKEFILE = $(ARCH)\Makefile.MS
21
22CC = cl /nologo
23LIB = lib /noignorecase /nologo
24
25!ifndef DEBUG
26CFLAGS = /Ox /AL /Za /W2 /G2 -I$(ARCH) -I. -Iextend
27!else
28CFLAGS = /Zi /AL /Za /W2 /G2 -I$(ARCH) -I. -Iextend
29!endif
30
31# Use /Gw instead with Microsoft C version 6
32CFLAGS = $(CFLAGS) /GA
33
34
35TTFILE = .\ttfile.c
36TTMEMORY = .\ttmemory.c
37TTMUTEX = .\ttmutex.c
38
39PORT = $(TTFILE) $(TTMEMORY) $(TTMUTEX)
40
41# Do not insert spaces between the file names or at end of line, otherwise
42# the substitution for LIB command line will fail. Thank you.
43#
44SRC_X = extend\ftxgasp.c extend\ftxkern.c extend\ftxpost.c\
45extend\ftxcmap.c extend\ftxwidth.c extend\ftxerr18.c extend\ftxsbit.c\
46extend\ftxopen.c extend\ftxgsub.c extend\ftxgpos.c extend\ftxgdef.c
47OBJS_X = $(SRC_X:.c=.obj)
48
49SRC_M = ttapi.c ttcache.c ttcalc.c ttcmap.c ttdebug.c\
50ttgload.c ttinterp.c ttload.c ttobjs.c ttraster.c ttextend.c $(PORT)
51OBJS_M = $(SRC_M:.c=.obj) $(OBJS_X)
52
53SRC_S = $(ARCH)\freetype.c
54OBJ_S = $(SRC_S:.c=.obj)
55OBJS_S = $(OBJ_S) $(OBJS_X)
56
57
58# Since Microsoft's NMAKE does not handle $($(LIB_FILES)), and using
59# LIB_FILES="$(OBJS_S)" will excess the capacity of COMMAND.COM, we cheat
60# by constructing LIB's response file directly in the `all' target.
61#
62# Another solution, useful during debugging of part of the library,
63# would be to include each .obj in the library as soon as it is compiled.
64# See ..\msdos\Makefile.TC for an application.
65.c.obj:
66	$(CC) /c /Fo$@ @<<
67	    $(CFLAGS) $*.c
68<<
69
70
71!ifndef DEBUG
72# Skipped if DEBUG build
73#   (but it changes nothing, since we always build in multiple parts).
74all: $(OBJS_M)
75	-del libttf.lib
76	$(LIB) libttf.lib @<<response
77+ $(OBJS_M: = ^ );
78<<KEEP
79!endif
80
81
82debug: $(OBJS_M)
83	-del libttf.lib
84	$(LIB) libttf.lib @<<response
85+ $(OBJS_M: = ^ );
86<<KEEP
87
88
89$(OBJ_S): $(SRC_S) $(SRC_M)
90
91# Not used here because it excesses the capacity of COMMAND.COM...
92libttf.lib: $(LIB_FILES)
93	$(LIB) $@ +-$(?: =-+);
94
95clean:
96	-del *.obj
97	-del extend\*.obj
98	-del $(ARCH)\*.obj
99	-del response
100
101distclean: clean
102	-del libttf.lib
103
104!include "$(ARCH)\depend.win"
105
106# end of Makefile.MS
107