summaryrefslogtreecommitdiff
path: root/Build/source/libs/libttf/arch/win32/Makefile.CL
blob: 5b1cb14a2e7092efcfeb5cd646e076aaa2b6aaee (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
# This file is part of the FreeType project.
#
# It builds the library for Microsoft Visual C++ for 32-bit Windows.
#
# You will need NMAKE.
#
# Use this file while in the lib directory with the following statement:
#
#   nmake /f arch\win32\Makefile.CL
#
#
# A DLL version of the library can be built with
#
#   nmake DLL=1 /f arch\win32\Makefile.CL dll
#
# Debug versions can be obtained with
#
#   nmake DEBUG=1 /f arch\win32\Makefile.CL

ARCH = arch\win32
FT_MAKEFILE = $(ARCH)\Makefile.CL
FT_DLL = ft14_32.dll

CC = cl /nologo
LIB = lib /nologo
LINK = link /nologo

CFLAGS = /Za /W2 -I$(ARCH) -I. -Iextend

!ifndef DEBUG
CFLAGS = $(CFLAGS) /Ox
DLLFLAGS = /RELEASE
!else
CFLAGS = $(CFLAGS) /Zi /Ge
DLLFLAGS = /DEBUG
!endif

!ifdef DLL
CFLAGS = $(CFLAGS) /GD \
    /DEXPORT_DEF=__declspec(dllexport) /DEXPORT_FUNC=__declspec(dllexport)
!else
CFLAGS = $(CFLAGS) /GA
!endif


TTFILE = .\ttfile.c
TTMEMORY = .\ttmemory.c
TTMUTEX = .\ttmutex.c

PORT = $(TTFILE) $(TTMEMORY) $(TTMUTEX)

# Do not insert spaces between the file names or at end of line, otherwise
# the substitution for LIB command line will fail. Thank you.
#
SRC_X = extend\ftxgasp.c extend\ftxkern.c extend\ftxpost.c\
extend\ftxcmap.c extend\ftxwidth.c extend\ftxerr18.c extend\ftxsbit.c\
extend\ftxopen.c extend\ftxgsub.c extend\ftxgpos.c extend\ftxgdef.c
OBJS_X = $(SRC_X:.c=.obj)

SRC_M = ttapi.c ttcache.c ttcalc.c ttcmap.c ttdebug.c\
ttgload.c ttinterp.c ttload.c ttobjs.c ttraster.c ttextend.c $(PORT)
OBJS_M = $(SRC_M:.c=.obj) $(OBJS_X)

SRC_S = $(ARCH)\freetype.c
OBJ_S = $(SRC_S:.c=.obj)
OBJS_S = $(OBJ_S) $(OBJS_X)


# Since Microsoft's NMAKE does not handle $($(LIB_FILES)), and using
# LIB_FILES="$(OBJS_S)" will excess the capacity of COMMAND.COM, we cheat
# by constructing LIB's response file directly in the `all' target.
#
# Another solution, useful during debugging of part of the library,
# would be to include each .obj in the library as soon as it is compiled.
# See ..\msdos\Makefile.TC for an application.
.c.obj:
	@$(CC) /c /Fo$@ @<<
	    $(CFLAGS) $*.c
<<


!ifndef DEBUG
# Skipped if DEBUG build
all: $(OBJS_S)
	-del libttf.lib
	$(LIB) /OUT:libttf.lib @<<response
 $(OBJS_S)
<<KEEP

dll $(FT_DLL): $(OBJS_S)
!ifdef DLL
	$(LINK) @<<response
	  $(DLLFLAGS)
	  /DLL
	  /OUT:$(FT_DLL)
	  /IMPLIB:libttf.lib
	  /DEF:$(ARCH)\ttf.def
	  $**
<<KEEP
!else
	$(MAKE) DLL=1 /f $(FT_MAKEFILE) dll    # Re-invoke with flag set.
!endif

!endif


debug: $(OBJS_M)
	-del libttf.lib
	$(LIB) /OUT:libttf.lib @<<response
 $(OBJS_M)
<<KEEP

!ifdef DEBUG
dll $(FT_DLL): $(OBJS_M)
!ifdef DLL
	$(LINK) @<<response
	  $(DLLFLAGS)
	  /DLL
	  /OUT:$(FT_DLL)
	  /IMPLIB:libttf.lib
	  /DEF:$(ARCH)\ttf.def
	  $**
<<KEEP
!else
	$(MAKE) DLL=1 DEBUG=1 /f $(FT_MAKEFILE) dll    # Re-invoke with flag set.
!endif
!endif

install: $(FT_DLL)
!ifdef INSTALL_DIR
	copy $(FT_DLL) $(INSTALL_DIR)
!else
	copy $(FT_DLL) C:\WINDOWS
!endif


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

# Not used here because it excesses the capacity of COMMAND.COM...
libttf.lib: $(LIB_FILES)
	$(LIB) /OUT:$@ $**


clean:
	-del *.obj
	-del extend\*.obj
	-del $(ARCH)\*.obj
	-del libttf.bak
	-del response
	-del *.exp
	-del *.pch
	-del *.ilk

distclean: clean
	-del libttf.lib
	-del *.dll
	-del *.pdb
	-del C:\WINDOWS\$(FT_DLL)
!ifdef INSTALL_DIR
	-del $(INSTALL_DIR)\$(FT_DLL)
!endif

!include "$(ARCH)\depend.win"

# end of Makefile.CL