OLD | NEW |
| (Empty) |
1 # Makefile for libxslt, specific for Windows, GCC (mingw) and GNU make. | |
2 # | |
3 # Take a look at the beginning and modify the variables to suit your | |
4 # environment. Having done that, you can do a | |
5 # | |
6 # make [all] to build the libxslt and the accompanying utilities. | |
7 # make clean to remove all compiler output files and return to a | |
8 # clean state. | |
9 # make rebuild to rebuild everything from scratch. This basically does | |
10 # a 'make clean' and then a 'make all'. | |
11 # make install to install the library and its header files. | |
12 # | |
13 # November 2002, Igor Zlatkovic <igor@zlatkovic.com> | |
14 | |
15 AUTOCONF = .\config.mingw | |
16 include $(AUTOCONF) | |
17 | |
18 # There should never be a need to modify anything below this line. | |
19 # ---------------------------------------------------------------- | |
20 | |
21 BASEDIR = .. | |
22 XSLT_SRCDIR = $(BASEDIR)\libxslt | |
23 EXSLT_SRCDIR = $(BASEDIR)\libexslt | |
24 UTILS_SRCDIR = $(BASEDIR)\xsltproc | |
25 BINDIR = bin.mingw | |
26 | |
27 # Names of various input and output components. | |
28 XSLT_NAME = xslt | |
29 XSLT_BASENAME = lib$(XSLT_NAME) | |
30 XSLT_SO = $(XSLT_BASENAME).dll | |
31 XSLT_IMP = $(XSLT_BASENAME).lib | |
32 XSLT_A = $(XSLT_BASENAME).a | |
33 EXSLT_NAME = exslt | |
34 EXSLT_BASENAME = lib$(EXSLT_NAME) | |
35 EXSLT_SO = $(EXSLT_BASENAME).dll | |
36 EXSLT_IMP = $(EXSLT_BASENAME).lib | |
37 EXSLT_A = $(EXSLT_BASENAME).a | |
38 | |
39 # Places where intermediate files produced by the compiler go | |
40 XSLT_INTDIR = int.xslt.mingw | |
41 XSLT_INTDIR_A = int.xslta.mingw | |
42 EXSLT_INTDIR = int.exslt.mingw | |
43 EXSLT_INTDIR_A = int.exslta.mingw | |
44 UTILS_INTDIR = int.utils.mingw | |
45 | |
46 # The preprocessor and its options. | |
47 CPP = gcc.exe -E | |
48 CPPFLAGS += | |
49 | |
50 # The compiler and its options. | |
51 CC = gcc.exe | |
52 CFLAGS += -DWIN32 -D_WINDOWS -D_MBCS | |
53 CFLAGS += -I$(BASEDIR) -I$(XSLT_SRCDIR) -I$(INCPREFIX) | |
54 | |
55 # The linker and its options. | |
56 LD = gcc.exe | |
57 LDFLAGS += -Wl,-L,$(BINDIR) -Wl,-L,$(LIBPREFIX) | |
58 LIBS = -lwsock32 | |
59 | |
60 # The archiver and its options. | |
61 AR = ar.exe | |
62 ARFLAGS = -r | |
63 | |
64 # Optimisation and debug symbols. | |
65 ifeq ($(DEBUG),1) | |
66 CFLAGS += -D_DEBUG -g | |
67 LDFLAGS += | |
68 else | |
69 CFLAGS += -DNDEBUG -O2 | |
70 LDFLAGS += | |
71 endif | |
72 | |
73 # Libxslt object files. | |
74 XSLT_OBJS = $(XSLT_INTDIR)/attributes.o\ | |
75 $(XSLT_INTDIR)/attrvt.o\ | |
76 $(XSLT_INTDIR)/documents.o\ | |
77 $(XSLT_INTDIR)/extensions.o\ | |
78 $(XSLT_INTDIR)/extra.o\ | |
79 $(XSLT_INTDIR)/functions.o\ | |
80 $(XSLT_INTDIR)/imports.o\ | |
81 $(XSLT_INTDIR)/keys.o\ | |
82 $(XSLT_INTDIR)/namespaces.o\ | |
83 $(XSLT_INTDIR)/numbers.o\ | |
84 $(XSLT_INTDIR)/pattern.o\ | |
85 $(XSLT_INTDIR)/preproc.o\ | |
86 $(XSLT_INTDIR)/security.o\ | |
87 $(XSLT_INTDIR)/templates.o\ | |
88 $(XSLT_INTDIR)/transform.o\ | |
89 $(XSLT_INTDIR)/variables.o\ | |
90 $(XSLT_INTDIR)/xslt.o\ | |
91 $(XSLT_INTDIR)/xsltlocale.o\ | |
92 $(XSLT_INTDIR)/xsltutils.o | |
93 XSLT_SRCS = $(subst .o,.c,$(subst $(XSLT_INTDIR),$(XSLT_SRCDIR),$(XSLT_OBJS))) | |
94 | |
95 # Static libxslt object files. | |
96 XSLT_OBJS_A = $(XSLT_INTDIR_A)/attributes.o\ | |
97 $(XSLT_INTDIR_A)/attrvt.o\ | |
98 $(XSLT_INTDIR_A)/documents.o\ | |
99 $(XSLT_INTDIR_A)/extensions.o\ | |
100 $(XSLT_INTDIR_A)/extra.o\ | |
101 $(XSLT_INTDIR_A)/functions.o\ | |
102 $(XSLT_INTDIR_A)/imports.o\ | |
103 $(XSLT_INTDIR_A)/keys.o\ | |
104 $(XSLT_INTDIR_A)/namespaces.o\ | |
105 $(XSLT_INTDIR_A)/numbers.o\ | |
106 $(XSLT_INTDIR_A)/pattern.o\ | |
107 $(XSLT_INTDIR_A)/preproc.o\ | |
108 $(XSLT_INTDIR_A)/security.o\ | |
109 $(XSLT_INTDIR_A)/templates.o\ | |
110 $(XSLT_INTDIR_A)/transform.o\ | |
111 $(XSLT_INTDIR_A)/variables.o\ | |
112 $(XSLT_INTDIR_A)/xslt.o\ | |
113 $(XSLT_INTDIR_A)/xsltlocale.o\ | |
114 $(XSLT_INTDIR_A)/xsltutils.o | |
115 | |
116 # Libexslt object files. | |
117 EXSLT_OBJS = $(EXSLT_INTDIR)/common.o\ | |
118 $(EXSLT_INTDIR)/crypto.o\ | |
119 $(EXSLT_INTDIR)/date.o\ | |
120 $(EXSLT_INTDIR)/exslt.o\ | |
121 $(EXSLT_INTDIR)/functions.o\ | |
122 $(EXSLT_INTDIR)/math.o\ | |
123 $(EXSLT_INTDIR)/saxon.o\ | |
124 $(EXSLT_INTDIR)/sets.o\ | |
125 $(EXSLT_INTDIR)/strings.o\ | |
126 $(EXSLT_INTDIR)/dynamic.o | |
127 EXSLT_SRCS = $(subst .o,.c,$(subst $(EXSLT_INTDIR)/,$(EXSLT_SRCDIR)/,$(EXSLT_OBJ
S))) | |
128 | |
129 # Static libexslt object files. | |
130 EXSLT_OBJS_A = $(EXSLT_INTDIR_A)/common.o\ | |
131 $(EXSLT_INTDIR_A)/crypto.o\ | |
132 $(EXSLT_INTDIR_A)/date.o\ | |
133 $(EXSLT_INTDIR_A)/exslt.o\ | |
134 $(EXSLT_INTDIR_A)/functions.o\ | |
135 $(EXSLT_INTDIR_A)/math.o\ | |
136 $(EXSLT_INTDIR_A)/saxon.o\ | |
137 $(EXSLT_INTDIR_A)/sets.o\ | |
138 $(EXSLT_INTDIR_A)/strings.o\ | |
139 $(EXSLT_INTDIR_A)/dynamic.o | |
140 | |
141 | |
142 # Xsltproc and friends executables. | |
143 UTILS = $(BINDIR)/xsltproc.exe | |
144 | |
145 all : dep libxslt libxslta libexslt libexslta utils | |
146 | |
147 libxslt : $(BINDIR)\$(XSLT_SO) | |
148 | |
149 libxslta : $(BINDIR)\$(XSLT_A) | |
150 | |
151 libexslt : $(BINDIR)\$(EXSLT_SO) | |
152 | |
153 libexslta : $(BINDIR)\$(EXSLT_A) | |
154 | |
155 utils : $(UTILS) | |
156 | |
157 clean : | |
158 cmd.exe /C "if exist $(XSLT_INTDIR) rmdir /S /Q $(XSLT_INTDIR)" | |
159 cmd.exe /C "if exist $(XSLT_INTDIR_A) rmdir /S /Q $(XSLT_INTDIR_A)" | |
160 cmd.exe /C "if exist $(EXSLT_INTDIR) rmdir /S /Q $(EXSLT_INTDIR)" | |
161 cmd.exe /C "if exist $(EXSLT_INTDIR_A) rmdir /S /Q $(EXSLT_INTDIR_A)" | |
162 cmd.exe /C "if exist $(UTILS_INTDIR) rmdir /S /Q $(UTILS_INTDIR)" | |
163 cmd.exe /C "if exist $(BINDIR) rmdir /S /Q $(BINDIR)" | |
164 cmd.exe /C "if exist depends.mingw del depends.mingw" | |
165 | |
166 rebuild : clean all | |
167 | |
168 distclean : clean | |
169 cmd.exe /C "if exist config.* del config.*" | |
170 cmd.exe /C "if exist depends.* del depends.*" | |
171 cmd.exe /C "if exist Makefile del Makefile" | |
172 | |
173 install-libs : all | |
174 cmd.exe /C "if not exist $(INCPREFIX)\$(XSLT_BASENAME) mkdir $(INCPREFIX
)\$(XSLT_BASENAME)" | |
175 cmd.exe /C "if not exist $(INCPREFIX)\$(EXSLT_BASENAME) mkdir $(INCPREFI
X)\$(EXSLT_BASENAME)" | |
176 cmd.exe /C "if not exist $(BINPREFIX) mkdir $(BINPREFIX)" | |
177 cmd.exe /C "if not exist $(LIBPREFIX) mkdir $(LIBPREFIX)" | |
178 cmd.exe /C "copy $(XSLT_SRCDIR)\*.h $(INCPREFIX)\$(XSLT_BASENAME)" | |
179 cmd.exe /C "copy $(EXSLT_SRCDIR)\*.h $(INCPREFIX)\$(EXSLT_BASENAME)" | |
180 cmd.exe /C "copy $(BINDIR)\$(XSLT_SO) $(SOPREFIX)" | |
181 cmd.exe /C "copy $(BINDIR)\$(XSLT_A) $(LIBPREFIX)" | |
182 cmd.exe /C "copy $(BINDIR)\$(XSLT_IMP) $(LIBPREFIX)" | |
183 cmd.exe /C "copy $(BINDIR)\$(EXSLT_SO) $(SOPREFIX)" | |
184 cmd.exe /C "copy $(BINDIR)\$(EXSLT_A) $(LIBPREFIX)" | |
185 cmd.exe /C "copy $(BINDIR)\$(EXSLT_IMP) $(LIBPREFIX)" | |
186 | |
187 install : install-libs | |
188 cmd.exe /C "copy $(BINDIR)\*.exe $(BINPREFIX)" | |
189 | |
190 install-dist : install | |
191 | |
192 # This is a target for me, to make a binary distribution. Not for the public use
, | |
193 # keep your hands off :-) | |
194 BDVERSION = $(LIBXSLT_MAJOR_VERSION).$(LIBXSLT_MINOR_VERSION).$(LIBXSLT_MICRO_VE
RSION) | |
195 BDPREFIX = $(XSLT_BASENAME)-$(BDVERSION).win32 | |
196 bindist : all | |
197 $(MAKE) PREFIX=$(BDPREFIX) SOPREFIX=$(BDPREFIX)/bin install-dist | |
198 cscript //NoLogo configure.js genreadme $(XSLT_BASENAME) $(BDVERSION) $(
BDPREFIX)\readme.txt | |
199 | |
200 | |
201 # Creates the dependency files | |
202 dep : | |
203 $(CC) $(subst \,/,$(CFLAGS)) -MM $(subst \,/,$(XSLT_SRCS)) $(subst \,/,$
(EXSLT_SRCS)) > depends.mingw | |
204 | |
205 | |
206 # Makes the compiler output directory. | |
207 $(BINDIR) : | |
208 cmd.exe /C "if not exist $(BINDIR) mkdir $(BINDIR)" | |
209 | |
210 | |
211 # Makes the libxslt intermediate directory. | |
212 $(XSLT_INTDIR) : | |
213 cmd.exe /C "if not exist $(XSLT_INTDIR) mkdir $(XSLT_INTDIR)" | |
214 | |
215 # Makes the static libxslt intermediate directory. | |
216 $(XSLT_INTDIR_A) : | |
217 cmd.exe /C "if not exist $(XSLT_INTDIR_A) mkdir $(XSLT_INTDIR_A)" | |
218 | |
219 # An implicit rule for libxslt compilation. | |
220 $(XSLT_INTDIR)/%.o : $(XSLT_SRCDIR)/%.c | |
221 $(CC) $(CFLAGS) -c -o $@ $< | |
222 | |
223 # An implicit rule for static libxslt compilation. | |
224 $(XSLT_INTDIR_A)/%.o : $(XSLT_SRCDIR)/%.c | |
225 $(CC) $(CFLAGS) -DLIBXML_STATIC -DLIBXSLT_STATIC -o $@ -c $< | |
226 | |
227 # Compiles libxslt source. Uses the implicit rule for commands. | |
228 $(XSLT_OBJS) : $(XSLT_INTDIR) | |
229 | |
230 # Compiles static libxslt source. Uses the implicit rule for commands. | |
231 $(XSLT_OBJS_A) : $(XSLT_INTDIR_A) | |
232 | |
233 # Creates the libxslt shared object. | |
234 XSLTSO_LDFLAGS = $(LDFLAGS) -shared -Wl,--dll -Wl,--out-implib,$(BINDIR)/$(XSLT_
IMP) | |
235 XSLTSO_LDFLAGS += -Wl,--major-image-version,$(LIBXSLT_MAJOR_VERSION) | |
236 XSLTSO_LDFLAGS += -Wl,--minor-image-version,$(LIBXSLT_MINOR_VERSION) | |
237 $(BINDIR)\$(XSLT_SO) : $(BINDIR) $(XSLT_OBJS) | |
238 $(LD) $(XSLTSO_LDFLAGS) -o $(BINDIR)/$(XSLT_SO) $(XSLT_OBJS) $(LIBS) -ll
ibxml2 | |
239 | |
240 # Creates the libxslt archive. | |
241 $(BINDIR)\$(XSLT_A) : $(BINDIR) $(XSLT_OBJS_A) | |
242 $(AR) $(ARFLAGS) $(BINDIR)/$(XSLT_A) $(XSLT_OBJS_A) | |
243 | |
244 | |
245 # Creates the libexslt intermediate directory. | |
246 $(EXSLT_INTDIR) : | |
247 cmd.exe /C "if not exist $(EXSLT_INTDIR) mkdir $(EXSLT_INTDIR)" | |
248 | |
249 # Creates the static libexslt intermediate directory. | |
250 $(EXSLT_INTDIR_A) : | |
251 cmd.exe /C "if not exist $(EXSLT_INTDIR_A) mkdir $(EXSLT_INTDIR_A)" | |
252 | |
253 # An implicit rule for libexslt compilation. | |
254 $(EXSLT_INTDIR)/%.o : $(EXSLT_SRCDIR)/%.c | |
255 $(CC) $(CFLAGS) -I$(EXSLT_SRCDIR) -o $@ -c $< | |
256 | |
257 # An implicit rule for static libexslt compilation. | |
258 $(EXSLT_INTDIR_A)/%.o : $(EXSLT_SRCDIR)/%.c | |
259 $(CC) $(CFLAGS) -DLIBXML_STATIC -DLIBXSLT_STATIC -DLIBEXSLT_STATIC \ | |
260 -I$(EXSLT_SRCDIR) -o $@ -c $< | |
261 | |
262 # Compiles libxslt source. Uses the implicit rule for commands. | |
263 $(EXSLT_OBJS) : $(EXSLT_INTDIR) | |
264 | |
265 # Compiles libxslt source. Uses the implicit rule for commands. | |
266 $(EXSLT_OBJS_A) : $(EXSLT_INTDIR_A) | |
267 | |
268 # Creates the libexslt shared object. | |
269 EXSLTSO_LDFLAGS = $(LDFLAGS) -shared -Wl,--dll -Wl,--out-implib,$(BINDIR)/$(EXSL
T_IMP) | |
270 EXSLTSO_LDFLAGS += -Wl,--major-image-version,$(LIBEXSLT_MAJOR_VERSION) | |
271 EXSLTSO_LDFLAGS += -Wl,--minor-image-version,$(LIBEXSLT_MINOR_VERSION) | |
272 $(BINDIR)\$(EXSLT_SO) : $(BINDIR) $(EXSLT_OBJS) libxslt | |
273 $(LD) $(EXSLTSO_LDFLAGS) -o $(BINDIR)/$(EXSLT_SO) $(EXSLT_OBJS) $(LIBS)
-l$(XSLT_BASENAME) -llibxml2 | |
274 | |
275 # Creates the libexslt archive. | |
276 $(BINDIR)\$(EXSLT_A) : $(BINDIR) $(EXSLT_OBJS_A) libxslta | |
277 $(AR) $(ARFLAGS) $(BINDIR)\$(EXSLT_A) $(EXSLT_OBJS_A) | |
278 | |
279 | |
280 # Creates the utils intermediate directory. | |
281 $(UTILS_INTDIR) : | |
282 cmd.exe /C "if not exist $(UTILS_INTDIR) mkdir $(UTILS_INTDIR)" | |
283 | |
284 # An implicit rule for xsltproc and friends. | |
285 APPLIBS = $(LIBS) | |
286 APPLIBS += -llibxml2 -l$(XSLT_BASENAME) -l$(EXSLT_BASENAME) | |
287 APP_LDFLAGS = $(LDFLAGS) | |
288 APP_LDFLAGS += -Wl,--major-image-version,$(LIBXSLT_MAJOR_VERSION) | |
289 APP_LDFLAGS += -Wl,--minor-image-version,$(LIBXSLT_MINOR_VERSION) | |
290 ifeq ($(STATIC),1) | |
291 CFLAGS += -DLIBXML_STATIC -DLIBXSLT_STATIC -DLIBEXSLT_STATIC | |
292 APP_LDFLAGS += -Bstatic | |
293 $(BINDIR)/%.exe : $(UTILS_SRCDIR)/%.c | |
294 $(CC) $(CFLAGS) -o $(subst .c,.o,$(UTILS_INTDIR)/$(<F)) -c $< | |
295 $(LD) $(APP_LDFLAGS) -o $@ $(subst .c,.o,$(UTILS_INTDIR)/$(<F)) $(APPLIB
S) | |
296 else | |
297 $(BINDIR)/%.exe : $(UTILS_SRCDIR)/%.c | |
298 $(CC) $(CFLAGS) -o $(subst .c,.o,$(UTILS_INTDIR)/$(<F)) -c $< | |
299 $(LD) $(APP_LDFLAGS) -o $@ $(subst .c,.o,$(UTILS_INTDIR)/$(<F)) $(APPLIB
S) | |
300 endif | |
301 | |
302 # Builds xsltproc and friends. Uses the implicit rule for commands. | |
303 $(UTILS) : $(UTILS_INTDIR) $(BINDIR) libxslt libxslta libexslt libexslta | |
304 | |
305 | |
306 # Source dependencies, just how? | |
307 #-include depends.mingw | |
308 | |
OLD | NEW |