xref: /aosp_15_r20/external/libxml2/win32/Makefile.mingw (revision 7c5688314b92172186c154356a6374bf7684c3ca)
1*7c568831SAndroid Build Coastguard Worker# Makefile for libxml2, specific for Windows, GCC (mingw) and GNU make.
2*7c568831SAndroid Build Coastguard Worker#
3*7c568831SAndroid Build Coastguard Worker# Take a look at the beginning and modify the variables to suit your
4*7c568831SAndroid Build Coastguard Worker# environment. Having done that, you can do a
5*7c568831SAndroid Build Coastguard Worker#
6*7c568831SAndroid Build Coastguard Worker# nmake [all]     to build the libxml and the accompanying utilities.
7*7c568831SAndroid Build Coastguard Worker# nmake clean     to remove all compiler output files and return to a
8*7c568831SAndroid Build Coastguard Worker#                 clean state.
9*7c568831SAndroid Build Coastguard Worker# nmake rebuild   to rebuild everything from scratch. This basically does
10*7c568831SAndroid Build Coastguard Worker#                 a 'nmake clean' and then a 'nmake all'.
11*7c568831SAndroid Build Coastguard Worker# nmake install   to install the library and its header files.
12*7c568831SAndroid Build Coastguard Worker#
13*7c568831SAndroid Build Coastguard Worker# November 2002, Igor Zlatkovic <[email protected]>
14*7c568831SAndroid Build Coastguard Worker
15*7c568831SAndroid Build Coastguard Worker# There should never be a need to modify anything below this line.
16*7c568831SAndroid Build Coastguard Worker# ----------------------------------------------------------------
17*7c568831SAndroid Build Coastguard Worker
18*7c568831SAndroid Build Coastguard WorkerAUTOCONF = .\config.mingw
19*7c568831SAndroid Build Coastguard Workerinclude $(AUTOCONF)
20*7c568831SAndroid Build Coastguard Worker
21*7c568831SAndroid Build Coastguard Worker# Names of various input and output components.
22*7c568831SAndroid Build Coastguard WorkerXML_NAME = xml2
23*7c568831SAndroid Build Coastguard WorkerXML_BASENAME = lib$(XML_NAME)
24*7c568831SAndroid Build Coastguard WorkerXML_SO = $(XML_BASENAME).dll
25*7c568831SAndroid Build Coastguard WorkerXML_IMP = $(XML_BASENAME).lib
26*7c568831SAndroid Build Coastguard WorkerXML_A = $(XML_BASENAME).a
27*7c568831SAndroid Build Coastguard Worker
28*7c568831SAndroid Build Coastguard Worker# Place where we let the compiler put its output.
29*7c568831SAndroid Build Coastguard WorkerBINDIR = bin.mingw
30*7c568831SAndroid Build Coastguard WorkerXML_INTDIR = int.mingw
31*7c568831SAndroid Build Coastguard WorkerXML_INTDIR_A = int.a.mingw
32*7c568831SAndroid Build Coastguard WorkerUTILS_INTDIR = int.utils.mingw
33*7c568831SAndroid Build Coastguard Worker
34*7c568831SAndroid Build Coastguard Worker# The preprocessor and its options.
35*7c568831SAndroid Build Coastguard WorkerCPP = gcc.exe -E
36*7c568831SAndroid Build Coastguard WorkerCPPFLAGS += -I$(XML_SRCDIR)/include -DNOLIBTOOL
37*7c568831SAndroid Build Coastguard Worker
38*7c568831SAndroid Build Coastguard Worker# The compiler and its options.
39*7c568831SAndroid Build Coastguard WorkerCC = gcc.exe
40*7c568831SAndroid Build Coastguard WorkerCFLAGS += -D_WINDOWS -D_MBCS -DNOLIBTOOL
41*7c568831SAndroid Build Coastguard WorkerCFLAGS += -I$(XML_SRCDIR) -I$(XML_SRCDIR)/include -I$(INCPREFIX) $(INCLUDE)
42*7c568831SAndroid Build Coastguard Workerifeq ($(WITH_THREADS),ctls)
43*7c568831SAndroid Build Coastguard WorkerCFLAGS += "-DXML_THREAD_LOCAL=__declspec(thread)"
44*7c568831SAndroid Build Coastguard Workerendif
45*7c568831SAndroid Build Coastguard Worker
46*7c568831SAndroid Build Coastguard Worker# The linker and its options.
47*7c568831SAndroid Build Coastguard WorkerLD = gcc.exe
48*7c568831SAndroid Build Coastguard WorkerLDFLAGS += -Wl,--major-image-version,$(LIBXML_MAJOR_VERSION)
49*7c568831SAndroid Build Coastguard WorkerLDFLAGS += -Wl,--minor-image-version,$(LIBXML_MINOR_VERSION)
50*7c568831SAndroid Build Coastguard WorkerLDFLAGS += -Wl,-L,$(BINDIR) -Wl,-L,$(LIBPREFIX)
51*7c568831SAndroid Build Coastguard WorkerLIBS =
52*7c568831SAndroid Build Coastguard Workerifeq ($(WITH_HTTP),1)
53*7c568831SAndroid Build Coastguard WorkerLIBS += -lwsock32 -lws2_32
54*7c568831SAndroid Build Coastguard Workerendif
55*7c568831SAndroid Build Coastguard Workerifeq ($(WITH_ICONV),1)
56*7c568831SAndroid Build Coastguard WorkerLIBS += -liconv
57*7c568831SAndroid Build Coastguard Workerendif
58*7c568831SAndroid Build Coastguard Workerifeq ($(WITH_ZLIB),1)
59*7c568831SAndroid Build Coastguard Worker# Could be named differently
60*7c568831SAndroid Build Coastguard Worker# LIBS += -lzdll
61*7c568831SAndroid Build Coastguard WorkerLIBS += -lz
62*7c568831SAndroid Build Coastguard Workerendif
63*7c568831SAndroid Build Coastguard Workerifeq ($(WITH_LZMA),1)
64*7c568831SAndroid Build Coastguard WorkerLIBS += -llzma
65*7c568831SAndroid Build Coastguard Workerendif
66*7c568831SAndroid Build Coastguard Workerifeq ($(WITH_THREADS),posix)
67*7c568831SAndroid Build Coastguard WorkerLIBS += -lpthreadGC
68*7c568831SAndroid Build Coastguard Workerendif
69*7c568831SAndroid Build Coastguard Workerifeq ($(WITH_MODULES),1)
70*7c568831SAndroid Build Coastguard WorkerLIBS += -lkernel32
71*7c568831SAndroid Build Coastguard Workerendif
72*7c568831SAndroid Build Coastguard Worker
73*7c568831SAndroid Build Coastguard WorkerLIBS += $(LIB)
74*7c568831SAndroid Build Coastguard Worker
75*7c568831SAndroid Build Coastguard Worker# The archiver and its options.
76*7c568831SAndroid Build Coastguard WorkerAR = ar.exe
77*7c568831SAndroid Build Coastguard WorkerARFLAGS = -r
78*7c568831SAndroid Build Coastguard Worker
79*7c568831SAndroid Build Coastguard Worker# Optimisation and debug symbols.
80*7c568831SAndroid Build Coastguard Workerifeq ($(DEBUG),1)
81*7c568831SAndroid Build Coastguard WorkerCFLAGS += -D_DEBUG -g
82*7c568831SAndroid Build Coastguard WorkerLDFLAGS +=
83*7c568831SAndroid Build Coastguard Workerelse
84*7c568831SAndroid Build Coastguard WorkerCFLAGS += -DNDEBUG -O2
85*7c568831SAndroid Build Coastguard WorkerLDFLAGS +=
86*7c568831SAndroid Build Coastguard Workerendif
87*7c568831SAndroid Build Coastguard Worker
88*7c568831SAndroid Build Coastguard Worker
89*7c568831SAndroid Build Coastguard Worker# Libxml object files.
90*7c568831SAndroid Build Coastguard WorkerXML_OBJS = $(XML_INTDIR)/buf.o\
91*7c568831SAndroid Build Coastguard Worker	$(XML_INTDIR)/c14n.o\
92*7c568831SAndroid Build Coastguard Worker	$(XML_INTDIR)/catalog.o\
93*7c568831SAndroid Build Coastguard Worker	$(XML_INTDIR)/chvalid.o\
94*7c568831SAndroid Build Coastguard Worker	$(XML_INTDIR)/debugXML.o\
95*7c568831SAndroid Build Coastguard Worker	$(XML_INTDIR)/dict.o\
96*7c568831SAndroid Build Coastguard Worker	$(XML_INTDIR)/encoding.o\
97*7c568831SAndroid Build Coastguard Worker	$(XML_INTDIR)/entities.o\
98*7c568831SAndroid Build Coastguard Worker	$(XML_INTDIR)/error.o\
99*7c568831SAndroid Build Coastguard Worker	$(XML_INTDIR)/globals.o\
100*7c568831SAndroid Build Coastguard Worker	$(XML_INTDIR)/hash.o\
101*7c568831SAndroid Build Coastguard Worker	$(XML_INTDIR)/HTMLparser.o\
102*7c568831SAndroid Build Coastguard Worker	$(XML_INTDIR)/HTMLtree.o\
103*7c568831SAndroid Build Coastguard Worker	$(XML_INTDIR)/legacy.o\
104*7c568831SAndroid Build Coastguard Worker	$(XML_INTDIR)/list.o\
105*7c568831SAndroid Build Coastguard Worker	$(XML_INTDIR)/nanohttp.o\
106*7c568831SAndroid Build Coastguard Worker	$(XML_INTDIR)/parser.o\
107*7c568831SAndroid Build Coastguard Worker	$(XML_INTDIR)/parserInternals.o\
108*7c568831SAndroid Build Coastguard Worker	$(XML_INTDIR)/pattern.o\
109*7c568831SAndroid Build Coastguard Worker	$(XML_INTDIR)/relaxng.o\
110*7c568831SAndroid Build Coastguard Worker	$(XML_INTDIR)/SAX.o\
111*7c568831SAndroid Build Coastguard Worker	$(XML_INTDIR)/SAX2.o\
112*7c568831SAndroid Build Coastguard Worker	$(XML_INTDIR)/schematron.o\
113*7c568831SAndroid Build Coastguard Worker	$(XML_INTDIR)/threads.o\
114*7c568831SAndroid Build Coastguard Worker	$(XML_INTDIR)/tree.o\
115*7c568831SAndroid Build Coastguard Worker	$(XML_INTDIR)/uri.o\
116*7c568831SAndroid Build Coastguard Worker	$(XML_INTDIR)/valid.o\
117*7c568831SAndroid Build Coastguard Worker	$(XML_INTDIR)/xinclude.o\
118*7c568831SAndroid Build Coastguard Worker	$(XML_INTDIR)/xlink.o\
119*7c568831SAndroid Build Coastguard Worker	$(XML_INTDIR)/xmlIO.o\
120*7c568831SAndroid Build Coastguard Worker	$(XML_INTDIR)/xmlmemory.o\
121*7c568831SAndroid Build Coastguard Worker	$(XML_INTDIR)/xmlreader.o\
122*7c568831SAndroid Build Coastguard Worker	$(XML_INTDIR)/xmlregexp.o\
123*7c568831SAndroid Build Coastguard Worker	$(XML_INTDIR)/xmlmodule.o\
124*7c568831SAndroid Build Coastguard Worker	$(XML_INTDIR)/xmlsave.o\
125*7c568831SAndroid Build Coastguard Worker	$(XML_INTDIR)/xmlschemas.o\
126*7c568831SAndroid Build Coastguard Worker	$(XML_INTDIR)/xmlschemastypes.o\
127*7c568831SAndroid Build Coastguard Worker	$(XML_INTDIR)/xmlunicode.o\
128*7c568831SAndroid Build Coastguard Worker	$(XML_INTDIR)/xmlwriter.o\
129*7c568831SAndroid Build Coastguard Worker	$(XML_INTDIR)/xpath.o\
130*7c568831SAndroid Build Coastguard Worker	$(XML_INTDIR)/xpointer.o\
131*7c568831SAndroid Build Coastguard Worker	$(XML_INTDIR)/xmlstring.o
132*7c568831SAndroid Build Coastguard Worker
133*7c568831SAndroid Build Coastguard WorkerXML_SRCS = $(subst .o,.c,$(subst $(XML_INTDIR)/,$(XML_SRCDIR)/,$(XML_OBJS)))
134*7c568831SAndroid Build Coastguard Worker
135*7c568831SAndroid Build Coastguard Worker# Static libxml object files.
136*7c568831SAndroid Build Coastguard WorkerXML_OBJS_A = $(XML_INTDIR_A)/buf.o\
137*7c568831SAndroid Build Coastguard Worker	$(XML_INTDIR_A)/c14n.o\
138*7c568831SAndroid Build Coastguard Worker	$(XML_INTDIR_A)/catalog.o\
139*7c568831SAndroid Build Coastguard Worker	$(XML_INTDIR_A)/chvalid.o\
140*7c568831SAndroid Build Coastguard Worker	$(XML_INTDIR_A)/debugXML.o\
141*7c568831SAndroid Build Coastguard Worker	$(XML_INTDIR_A)/dict.o\
142*7c568831SAndroid Build Coastguard Worker	$(XML_INTDIR_A)/encoding.o\
143*7c568831SAndroid Build Coastguard Worker	$(XML_INTDIR_A)/entities.o\
144*7c568831SAndroid Build Coastguard Worker	$(XML_INTDIR_A)/error.o\
145*7c568831SAndroid Build Coastguard Worker	$(XML_INTDIR_A)/globals.o\
146*7c568831SAndroid Build Coastguard Worker	$(XML_INTDIR_A)/hash.o\
147*7c568831SAndroid Build Coastguard Worker	$(XML_INTDIR_A)/HTMLparser.o\
148*7c568831SAndroid Build Coastguard Worker	$(XML_INTDIR_A)/HTMLtree.o\
149*7c568831SAndroid Build Coastguard Worker	$(XML_INTDIR_A)/legacy.o\
150*7c568831SAndroid Build Coastguard Worker	$(XML_INTDIR_A)/list.o\
151*7c568831SAndroid Build Coastguard Worker	$(XML_INTDIR_A)/nanohttp.o\
152*7c568831SAndroid Build Coastguard Worker	$(XML_INTDIR_A)/parser.o\
153*7c568831SAndroid Build Coastguard Worker	$(XML_INTDIR_A)/parserInternals.o\
154*7c568831SAndroid Build Coastguard Worker	$(XML_INTDIR_A)/pattern.o\
155*7c568831SAndroid Build Coastguard Worker	$(XML_INTDIR_A)/relaxng.o\
156*7c568831SAndroid Build Coastguard Worker	$(XML_INTDIR_A)/SAX.o\
157*7c568831SAndroid Build Coastguard Worker	$(XML_INTDIR_A)/SAX2.o\
158*7c568831SAndroid Build Coastguard Worker	$(XML_INTDIR_A)/schematron.o\
159*7c568831SAndroid Build Coastguard Worker	$(XML_INTDIR_A)/threads.o\
160*7c568831SAndroid Build Coastguard Worker	$(XML_INTDIR_A)/tree.o\
161*7c568831SAndroid Build Coastguard Worker	$(XML_INTDIR_A)/uri.o\
162*7c568831SAndroid Build Coastguard Worker	$(XML_INTDIR_A)/valid.o\
163*7c568831SAndroid Build Coastguard Worker	$(XML_INTDIR_A)/xinclude.o\
164*7c568831SAndroid Build Coastguard Worker	$(XML_INTDIR_A)/xlink.o\
165*7c568831SAndroid Build Coastguard Worker	$(XML_INTDIR_A)/xmlIO.o\
166*7c568831SAndroid Build Coastguard Worker	$(XML_INTDIR_A)/xmlmemory.o\
167*7c568831SAndroid Build Coastguard Worker	$(XML_INTDIR_A)/xmlreader.o\
168*7c568831SAndroid Build Coastguard Worker	$(XML_INTDIR_A)/xmlregexp.o\
169*7c568831SAndroid Build Coastguard Worker	$(XML_INTDIR_A)/xmlmodule.o\
170*7c568831SAndroid Build Coastguard Worker	$(XML_INTDIR_A)/xmlsave.o\
171*7c568831SAndroid Build Coastguard Worker	$(XML_INTDIR_A)/xmlschemas.o\
172*7c568831SAndroid Build Coastguard Worker	$(XML_INTDIR_A)/xmlschemastypes.o\
173*7c568831SAndroid Build Coastguard Worker	$(XML_INTDIR_A)/xmlunicode.o\
174*7c568831SAndroid Build Coastguard Worker	$(XML_INTDIR_A)/xmlwriter.o\
175*7c568831SAndroid Build Coastguard Worker	$(XML_INTDIR_A)/xpath.o\
176*7c568831SAndroid Build Coastguard Worker	$(XML_INTDIR_A)/xpointer.o\
177*7c568831SAndroid Build Coastguard Worker	$(XML_INTDIR_A)/xmlstring.o
178*7c568831SAndroid Build Coastguard Worker
179*7c568831SAndroid Build Coastguard WorkerXML_SRCS_A = $(subst .o,.c,$(subst $(XML_INTDIR_A)/,$(XML_SRCDIR)/,$(XML_OBJS_A)))
180*7c568831SAndroid Build Coastguard Worker
181*7c568831SAndroid Build Coastguard Worker# Xmllint and friends executables.
182*7c568831SAndroid Build Coastguard WorkerUTILS = $(BINDIR)/xmllint.exe\
183*7c568831SAndroid Build Coastguard Worker	$(BINDIR)/xmlcatalog.exe\
184*7c568831SAndroid Build Coastguard Worker	$(BINDIR)/testModule.exe\
185*7c568831SAndroid Build Coastguard Worker	$(BINDIR)/runtest.exe\
186*7c568831SAndroid Build Coastguard Worker	$(BINDIR)/runsuite.exe\
187*7c568831SAndroid Build Coastguard Worker	$(BINDIR)/testapi.exe\
188*7c568831SAndroid Build Coastguard Worker	$(BINDIR)/testlimits.exe
189*7c568831SAndroid Build Coastguard Worker
190*7c568831SAndroid Build Coastguard Workerall : dep libxml libxmla utils
191*7c568831SAndroid Build Coastguard Worker
192*7c568831SAndroid Build Coastguard Workerlibxml : $(BINDIR)/$(XML_SO)
193*7c568831SAndroid Build Coastguard Worker
194*7c568831SAndroid Build Coastguard Workerlibxmla : $(BINDIR)/$(XML_A)
195*7c568831SAndroid Build Coastguard Worker
196*7c568831SAndroid Build Coastguard Workerutils : $(UTILS)
197*7c568831SAndroid Build Coastguard Worker
198*7c568831SAndroid Build Coastguard Workerclean :
199*7c568831SAndroid Build Coastguard Worker	cmd.exe /C "if exist $(XML_INTDIR) rmdir /S /Q $(XML_INTDIR)"
200*7c568831SAndroid Build Coastguard Worker	cmd.exe /C "if exist $(XML_INTDIR_A) rmdir /S /Q $(XML_INTDIR_A)"
201*7c568831SAndroid Build Coastguard Worker	cmd.exe /C "if exist $(UTILS_INTDIR) rmdir /S /Q $(UTILS_INTDIR)"
202*7c568831SAndroid Build Coastguard Worker	cmd.exe /C "if exist $(BINDIR) rmdir /S /Q $(BINDIR)"
203*7c568831SAndroid Build Coastguard Worker	cmd.exe /C "if exist depends.mingw del depends.mingw"
204*7c568831SAndroid Build Coastguard Worker
205*7c568831SAndroid Build Coastguard Workerdistclean : clean
206*7c568831SAndroid Build Coastguard Worker	cmd.exe /C "if exist config.* del config.*"
207*7c568831SAndroid Build Coastguard Worker	cmd.exe /C "if exist Makefile del Makefile"
208*7c568831SAndroid Build Coastguard Worker
209*7c568831SAndroid Build Coastguard Workerrebuild : clean all
210*7c568831SAndroid Build Coastguard Worker
211*7c568831SAndroid Build Coastguard Workerinstall-libs : all
212*7c568831SAndroid Build Coastguard Worker	cmd.exe /C "if not exist $(INCPREFIX)\libxml2 mkdir $(INCPREFIX)\libxml2"
213*7c568831SAndroid Build Coastguard Worker	cmd.exe /C "if not exist $(INCPREFIX)\libxml2\libxml mkdir $(INCPREFIX)\libxml2\libxml"
214*7c568831SAndroid Build Coastguard Worker	cmd.exe /C "if not exist $(BINPREFIX) mkdir $(BINPREFIX)"
215*7c568831SAndroid Build Coastguard Worker	cmd.exe /C "if not exist $(LIBPREFIX) mkdir $(LIBPREFIX)"
216*7c568831SAndroid Build Coastguard Worker	cmd.exe /C "copy $(XML_SRCDIR)\include\libxml\*.h $(INCPREFIX)\libxml2\libxml"
217*7c568831SAndroid Build Coastguard Worker	cmd.exe /C "copy $(BINDIR)\$(XML_SO) $(SOPREFIX)"
218*7c568831SAndroid Build Coastguard Worker	cmd.exe /C "copy $(BINDIR)\$(XML_A) $(LIBPREFIX)"
219*7c568831SAndroid Build Coastguard Worker	cmd.exe /C "copy $(BINDIR)\$(XML_IMP) $(LIBPREFIX)"
220*7c568831SAndroid Build Coastguard Worker	cmd.exe /C "copy $(BINDIR)\xml*.exe $(BINPREFIX)"
221*7c568831SAndroid Build Coastguard Worker
222*7c568831SAndroid Build Coastguard Workerinstall : install-libs
223*7c568831SAndroid Build Coastguard Worker	cmd.exe /C "copy $(BINDIR)\*.exe $(BINPREFIX)"
224*7c568831SAndroid Build Coastguard Worker
225*7c568831SAndroid Build Coastguard Workerinstall-dist : install-libs
226*7c568831SAndroid Build Coastguard Worker	cmd.exe /C "copy $(BINDIR)\xml*.exe $(BINPREFIX)"
227*7c568831SAndroid Build Coastguard Worker
228*7c568831SAndroid Build Coastguard Worker# This is a target for me, to make a binary distribution. Not for the public use,
229*7c568831SAndroid Build Coastguard Worker# keep your hands off :-)
230*7c568831SAndroid Build Coastguard WorkerBDVERSION = $(LIBXML_MAJOR_VERSION).$(LIBXML_MINOR_VERSION).$(LIBXML_MICRO_VERSION)
231*7c568831SAndroid Build Coastguard WorkerBDPREFIX = $(XML_BASENAME)-$(BDVERSION).win32
232*7c568831SAndroid Build Coastguard Workerbindist : all
233*7c568831SAndroid Build Coastguard Worker	$(MAKE) PREFIX=$(BDPREFIX) SOPREFIX=$(BDPREFIX)/bin install-dist
234*7c568831SAndroid Build Coastguard Worker	cscript //NoLogo configure.js genreadme $(XML_BASENAME) $(BDVERSION) $(BDPREFIX)\readme.txt
235*7c568831SAndroid Build Coastguard Worker
236*7c568831SAndroid Build Coastguard Worker
237*7c568831SAndroid Build Coastguard Worker# Creates the dependency file
238*7c568831SAndroid Build Coastguard Workerdep :
239*7c568831SAndroid Build Coastguard Worker	$(CC) $(CFLAGS) -M $(XML_SRCS) > depends.mingw
240*7c568831SAndroid Build Coastguard Worker
241*7c568831SAndroid Build Coastguard Worker
242*7c568831SAndroid Build Coastguard Worker# Makes the output directory.
243*7c568831SAndroid Build Coastguard Worker$(BINDIR) :
244*7c568831SAndroid Build Coastguard Worker	cmd.exe /C if not exist $(BINDIR) mkdir $(BINDIR)
245*7c568831SAndroid Build Coastguard Worker
246*7c568831SAndroid Build Coastguard Worker
247*7c568831SAndroid Build Coastguard Worker# Makes the libxml intermediate directory.
248*7c568831SAndroid Build Coastguard Worker$(XML_INTDIR) :
249*7c568831SAndroid Build Coastguard Worker	cmd.exe /C if not exist $(XML_INTDIR) mkdir $(XML_INTDIR)
250*7c568831SAndroid Build Coastguard Worker
251*7c568831SAndroid Build Coastguard Worker# Makes the static libxml intermediate directory.
252*7c568831SAndroid Build Coastguard Worker$(XML_INTDIR_A) :
253*7c568831SAndroid Build Coastguard Worker	cmd.exe /C if not exist $(XML_INTDIR_A) mkdir $(XML_INTDIR_A)
254*7c568831SAndroid Build Coastguard Worker
255*7c568831SAndroid Build Coastguard Worker# An implicit rule for libxml compilation.
256*7c568831SAndroid Build Coastguard Worker$(XML_INTDIR)/%.o : $(XML_SRCDIR)/%.c
257*7c568831SAndroid Build Coastguard Worker	$(CC) $(CFLAGS) -o $@ -c $<
258*7c568831SAndroid Build Coastguard Worker
259*7c568831SAndroid Build Coastguard Worker# An implicit rule for static libxml compilation.
260*7c568831SAndroid Build Coastguard Worker$(XML_INTDIR_A)/%.o : $(XML_SRCDIR)/%.c
261*7c568831SAndroid Build Coastguard Worker	$(CC) $(CFLAGS) -DLIBXML_STATIC -o $@ -c $<
262*7c568831SAndroid Build Coastguard Worker
263*7c568831SAndroid Build Coastguard Worker
264*7c568831SAndroid Build Coastguard Worker# Compiles libxml source. Uses the implicit rule for commands.
265*7c568831SAndroid Build Coastguard Worker$(XML_OBJS) : $(XML_INTDIR)
266*7c568831SAndroid Build Coastguard Worker
267*7c568831SAndroid Build Coastguard Worker# Compiles static libxml source. Uses the implicit rule for commands.
268*7c568831SAndroid Build Coastguard Worker$(XML_OBJS_A) : $(XML_INTDIR_A)
269*7c568831SAndroid Build Coastguard Worker
270*7c568831SAndroid Build Coastguard Worker# Creates the libxml shared object.
271*7c568831SAndroid Build Coastguard WorkerXMLSO_LDFLAGS = $(LDFLAGS) -shared -Wl,--dll -Wl,--out-implib,$(BINDIR)/$(XML_IMP)
272*7c568831SAndroid Build Coastguard Worker$(BINDIR)/$(XML_SO) : $(BINDIR) $(XML_OBJS)
273*7c568831SAndroid Build Coastguard Worker	$(LD) $(XMLSO_LDFLAGS) -o $(BINDIR)/$(XML_SO) $(XML_OBJS) $(LIBS)
274*7c568831SAndroid Build Coastguard Worker
275*7c568831SAndroid Build Coastguard Worker# Creates the libxml archive.
276*7c568831SAndroid Build Coastguard Worker$(BINDIR)/$(XML_A) : $(BINDIR) $(XML_OBJS_A)
277*7c568831SAndroid Build Coastguard Worker	$(AR) $(ARFLAGS) $(BINDIR)\$(XML_A) $(XML_OBJS_A)
278*7c568831SAndroid Build Coastguard Worker
279*7c568831SAndroid Build Coastguard Worker
280*7c568831SAndroid Build Coastguard Worker# Makes the utils intermediate directory.
281*7c568831SAndroid Build Coastguard Worker$(UTILS_INTDIR) :
282*7c568831SAndroid Build Coastguard Worker	cmd.exe /C if not exist $(UTILS_INTDIR) mkdir $(UTILS_INTDIR)
283*7c568831SAndroid Build Coastguard Worker
284*7c568831SAndroid Build Coastguard Worker# An implicit rule for xmllint and friends.
285*7c568831SAndroid Build Coastguard Workerifeq ($(STATIC),1)
286*7c568831SAndroid Build Coastguard Worker$(BINDIR)/%.exe : $(UTILS_SRCDIR)/%.c
287*7c568831SAndroid Build Coastguard Worker	$(CC) -DLIBXML_STATIC $(CFLAGS) -o $(subst .c,.o,$(UTILS_INTDIR)/$(<F)) -c $<
288*7c568831SAndroid Build Coastguard Worker	$(LD) $(LDFLAGS) -o $@ $(subst .c,.o,$(UTILS_INTDIR)/$(<F)) -l$(XML_BASENAME) $(LIBS)
289*7c568831SAndroid Build Coastguard Workerelse
290*7c568831SAndroid Build Coastguard Worker$(BINDIR)/%.exe : $(UTILS_SRCDIR)/%.c
291*7c568831SAndroid Build Coastguard Worker	$(CC) $(CFLAGS) -o $(subst .c,.o,$(UTILS_INTDIR)/$(<F)) -c $<
292*7c568831SAndroid Build Coastguard Worker	$(LD) $(LDFLAGS) -o $@ $(subst .c,.o,$(UTILS_INTDIR)/$(<F)) -l$(XML_BASENAME) $(LIBS)
293*7c568831SAndroid Build Coastguard Workerendif
294*7c568831SAndroid Build Coastguard Worker
295*7c568831SAndroid Build Coastguard Worker# Builds xmllint and friends. Uses the implicit rule for commands.
296*7c568831SAndroid Build Coastguard Worker$(UTILS) : $(UTILS_INTDIR) $(BINDIR) libxml libxmla
297*7c568831SAndroid Build Coastguard Worker
298*7c568831SAndroid Build Coastguard Worker# Source dependencies
299*7c568831SAndroid Build Coastguard Worker#-include depends.mingw
300*7c568831SAndroid Build Coastguard Worker
301