]>
Commit | Line | Data |
---|---|---|
ef416fc2 | 1 | # |
f7deaa1a | 2 | # "$Id: Makefile 6304 2007-02-22 22:06:23Z mike $" |
ef416fc2 | 3 | # |
4 | # API library Makefile for the Common UNIX Printing System (CUPS). | |
5 | # | |
6 | # Copyright 1997-2006 by Easy Software Products, all rights reserved. | |
7 | # | |
8 | # These coded instructions, statements, and computer programs are the | |
9 | # property of Easy Software Products and are protected by Federal | |
10 | # copyright law. Distribution and use rights are outlined in the file | |
11 | # "LICENSE.txt" which should have been included with this file. If this | |
12 | # file is missing or damaged please contact Easy Software Products | |
13 | # at: | |
14 | # | |
15 | # Attn: CUPS Licensing Information | |
16 | # Easy Software Products | |
17 | # 44141 Airport View Drive, Suite 204 | |
18 | # Hollywood, Maryland 20636 USA | |
19 | # | |
20 | # Voice: (301) 373-9600 | |
21 | # EMail: cups-info@cups.org | |
22 | # WWW: http://www.cups.org | |
23 | # | |
24 | # This file is subject to the Apple OS-Developed Software exception. | |
25 | # | |
26 | ||
27 | include ../Makedefs | |
28 | ||
29 | # | |
30 | # Object files... | |
31 | # | |
32 | ||
33 | LIBOBJS = \ | |
757d2cad | 34 | adminutil.o \ |
ef416fc2 | 35 | array.o \ |
36 | attr.o \ | |
37 | auth.o \ | |
38 | backchannel.o \ | |
a4d04587 | 39 | backend.o \ |
fa73b229 | 40 | custom.o \ |
ef416fc2 | 41 | dest.o \ |
42 | dir.o \ | |
43 | emit.o \ | |
44 | encode.o \ | |
45 | file.o \ | |
89d46774 | 46 | getifaddrs.o \ |
ef416fc2 | 47 | getputfile.o \ |
48 | globals.o \ | |
49 | http.o \ | |
50 | http-addr.o \ | |
51 | http-addrlist.o \ | |
52 | http-support.o \ | |
53 | ipp.o \ | |
54 | ipp-support.o \ | |
55 | langprintf.o \ | |
56 | language.o \ | |
fa73b229 | 57 | localize.o \ |
ef416fc2 | 58 | mark.o \ |
59 | md5.o \ | |
60 | md5passwd.o \ | |
fa73b229 | 61 | notify.o \ |
ef416fc2 | 62 | options.o \ |
63 | page.o \ | |
64 | ppd.o \ | |
ecdc0628 | 65 | request.o \ |
f7deaa1a | 66 | sidechannel.o \ |
ef416fc2 | 67 | snprintf.o \ |
68 | string.o \ | |
69 | tempfile.o \ | |
70 | transcode.o \ | |
71 | usersys.o \ | |
72 | util.o | |
e1d6a774 | 73 | LIB32OBJS = $(LIBOBJS:.o=.32.o) |
74 | LIB64OBJS = $(LIBOBJS:.o=.64.o) | |
ef416fc2 | 75 | OBJS = \ |
76 | $(LIBOBJS) \ | |
e1d6a774 | 77 | $(LIB32OBJS) \ |
78 | $(LIB64OBJS) \ | |
757d2cad | 79 | testadmin.o \ |
ef416fc2 | 80 | testarray.o \ |
81 | testfile.o \ | |
82 | testhttp.o \ | |
83 | testi18n.o \ | |
84 | testipp.o \ | |
85 | testlang.o \ | |
fa73b229 | 86 | testppd.o \ |
ef416fc2 | 87 | php_cups_wrap.o |
88 | ||
89 | ||
90 | # | |
91 | # Header files to install... | |
92 | # | |
93 | ||
94 | HEADERS = \ | |
757d2cad | 95 | adminutil.h \ |
ef416fc2 | 96 | array.h \ |
d09495fa | 97 | backend.h \ |
ef416fc2 | 98 | cups.h \ |
99 | dir.h \ | |
100 | file.h \ | |
101 | http.h \ | |
102 | i18n.h \ | |
103 | ipp.h \ | |
104 | language.h \ | |
ef416fc2 | 105 | ppd.h \ |
f7deaa1a | 106 | sidechannel.h \ |
ef416fc2 | 107 | transcode.h |
108 | ||
109 | ||
110 | # | |
111 | # Targets in this directory... | |
112 | # | |
113 | ||
114 | TARGETS = \ | |
115 | $(LIBCUPS) \ | |
e1d6a774 | 116 | $(LIB32CUPS) \ |
117 | $(LIB64CUPS) \ | |
ef416fc2 | 118 | libcups.a \ |
757d2cad | 119 | testadmin \ |
ef416fc2 | 120 | testarray \ |
121 | testfile \ | |
122 | testhttp \ | |
123 | testi18n \ | |
124 | testipp \ | |
fa73b229 | 125 | testlang \ |
126 | testppd | |
ef416fc2 | 127 | |
128 | ||
129 | # | |
130 | # Make all targets... | |
131 | # | |
132 | ||
133 | all: $(TARGETS) | |
134 | ||
135 | ||
136 | # | |
137 | # Remove object and target files... | |
138 | # | |
139 | ||
140 | clean: | |
e1d6a774 | 141 | $(RM) $(OBJS) $(TARGETS) |
f301802f | 142 | $(RM) libcups.so libcups.sl libcups.dylib |
ed486911 | 143 | $(RM) -r 32bit 64bit |
ef416fc2 | 144 | |
145 | ||
146 | # | |
147 | # Update dependencies (without system header dependencies...) | |
148 | # | |
149 | ||
150 | depend: | |
e1d6a774 | 151 | touch Dependencies.tmp |
152 | makedepend -Y -I.. -fDependencies.tmp $(OBJS:.o=.c) >/dev/null 2>&1 | |
153 | $(RM) Dependencies | |
154 | cp Dependencies.tmp Dependencies | |
155 | sed -r -e '1,$$s/^([^.]+)\.o:/\1\.32.o: \1\.c /' Dependencies.tmp >>Dependencies | |
156 | sed -r -e '1,$$s/^([^.]+)\.o:/\1\.64.o: \1\.c /' Dependencies.tmp >>Dependencies | |
157 | $(RM) Dependencies.tmp | |
ef416fc2 | 158 | |
159 | ||
160 | # | |
161 | # Install object and target files... | |
162 | # | |
163 | ||
e1d6a774 | 164 | install: all installhdrs $(INSTALLSTATIC) $(INSTALL32) $(INSTALL64) |
bd7854cb | 165 | $(INSTALL_DIR) -m 755 $(LIBDIR) |
ef416fc2 | 166 | $(INSTALL_LIB) $(LIBCUPS) $(LIBDIR) |
167 | if test $(LIBCUPS) = "libcups.so.2" -o $(LIBCUPS) = "libcups.sl.2"; then \ | |
168 | $(RM) $(LIBDIR)/`basename $(LIBCUPS) .2`; \ | |
169 | $(LN) $(LIBCUPS) $(LIBDIR)/`basename $(LIBCUPS) .2`; \ | |
170 | fi | |
171 | if test $(LIBCUPS) = "libcups.2.dylib"; then \ | |
172 | $(STRIP) -x $(LIBDIR)/$(LIBCUPS); \ | |
173 | $(RM) $(LIBDIR)/libcups.dylib; \ | |
174 | $(LN) $(LIBCUPS) $(LIBDIR)/libcups.dylib; \ | |
175 | fi | |
923edb68 | 176 | |
177 | installstatic: | |
178 | $(INSTALL_DIR) -m 755 $(LIBDIR) | |
d6ae789d | 179 | $(INSTALL_LIB) libcups.a $(LIBDIR) |
180 | $(RANLIB) $(LIBDIR)/libcups.a | |
ef416fc2 | 181 | |
182 | installhdrs: | |
bd7854cb | 183 | $(INSTALL_DIR) -m 755 $(INCLUDEDIR)/cups |
ef416fc2 | 184 | for file in $(HEADERS); do \ |
185 | $(INSTALL_DATA) $$file $(INCLUDEDIR)/cups; \ | |
186 | done | |
187 | ||
e1d6a774 | 188 | install32bit: |
189 | $(INSTALL_DIR) -m 755 $(LIB32DIR) | |
f301802f | 190 | $(INSTALL_LIB) 32bit/libcups.so.2 $(LIB32DIR)/libcups.so.2 |
ed486911 | 191 | $(LN) libcups.so.2 $(LIB32DIR)/libcups.so |
e1d6a774 | 192 | |
193 | install64bit: | |
194 | $(INSTALL_DIR) -m 755 $(LIB64DIR) | |
f301802f | 195 | $(INSTALL_LIB) 64bit/libcups.so.2 $(LIB64DIR)/libcups.so.2 |
ed486911 | 196 | $(LN) libcups.so.2 $(LIB64DIR)/libcups.so |
e1d6a774 | 197 | |
ef416fc2 | 198 | |
757d2cad | 199 | # |
200 | # Uninstall object and target files... | |
201 | # | |
202 | ||
e1d6a774 | 203 | uninstall: $(UNINSTALL32) $(UNINSTALL64) |
757d2cad | 204 | $(RM) $(LIBDIR)/libcups.2.dylib |
205 | $(RM) $(LIBDIR)/libcups.a | |
206 | $(RM) $(LIBDIR)/libcups.dylib | |
207 | $(RM) $(LIBDIR)/libcups_s.a | |
208 | $(RM) $(LIBDIR)/libcups.sl | |
209 | $(RM) $(LIBDIR)/libcups.sl.2 | |
210 | $(RM) $(LIBDIR)/libcups.so | |
211 | $(RM) $(LIBDIR)/libcups.so.2 | |
212 | -$(RMDIR) $(LIBDIR) | |
213 | for file in $(HEADERS); do \ | |
214 | $(RM) $(INCLUDEDIR)/cups/$$file; \ | |
215 | done | |
216 | -$(RMDIR) $(INCLUDEDIR)/cups | |
217 | ||
e1d6a774 | 218 | uninstall32bit: |
219 | $(RM) $(LIB32DIR)/libcups.so | |
220 | $(RM) $(LIB32DIR)/libcups.so.2 | |
221 | -$(RMDIR) $(LIB32DIR) | |
222 | ||
223 | uninstall64bit: | |
224 | $(RM) $(LIB64DIR)/libcups.so | |
225 | $(RM) $(LIB64DIR)/libcups.so.2 | |
226 | -$(RMDIR) $(LIB64DIR) | |
227 | ||
757d2cad | 228 | |
ef416fc2 | 229 | # |
230 | # libcups.so.2, libcups.sl.2 | |
231 | # | |
232 | ||
233 | libcups.so.2 libcups.sl.2: $(LIBOBJS) | |
234 | echo Linking $@... | |
f7deaa1a | 235 | $(DSO) $(ARCHFLAGS) $(DSOFLAGS) -o $@ $(LIBOBJS) $(LIBGSSAPI) $(SSLLIBS) $(COMMONLIBS) $(LIBZ) |
ef416fc2 | 236 | $(RM) `basename $@ .2` |
237 | $(LN) $@ `basename $@ .2` | |
238 | ||
239 | ||
e1d6a774 | 240 | # |
f301802f | 241 | # 32bit/libcups.so.2 |
e1d6a774 | 242 | # |
243 | ||
f301802f | 244 | 32bit/libcups.so.2: $(LIB32OBJS) |
e1d6a774 | 245 | echo Linking 32-bit $@... |
f301802f | 246 | -mkdir 32bit |
f7deaa1a | 247 | $(DSO) $(ARCH32FLAGS) $(DSO32FLAGS) -o $@ $(LIB32OBJS) $(LIBGSSAPI) $(SSLLIBS) $(COMMONLIBS) $(LIBZ) |
f301802f | 248 | $(RM) 32bit/libcups.so |
249 | $(LN) libcups.so.2 32bit/libcups.so | |
e1d6a774 | 250 | |
251 | ||
252 | # | |
f301802f | 253 | # 64bit/libcups.so.2 |
e1d6a774 | 254 | # |
255 | ||
f301802f | 256 | 64bit/libcups.so.2: $(LIB64OBJS) |
e1d6a774 | 257 | echo Linking 64-bit $@... |
f301802f | 258 | -mkdir 64bit |
f7deaa1a | 259 | $(DSO) $(ARCH64FLAGS) $(DSO64FLAGS) -o $@ $(LIB64OBJS) $(LIBGSSAPI) $(SSLLIBS) $(COMMONLIBS) $(LIBZ) |
f301802f | 260 | $(RM) 64bit/libcups.so |
261 | $(LN) libcups.so.2 64bit/libcups.so | |
e1d6a774 | 262 | |
263 | ||
ef416fc2 | 264 | # |
265 | # libcups.2.dylib | |
266 | # | |
267 | ||
268 | libcups.2.dylib: $(LIBOBJS) | |
269 | echo Linking $@... | |
e1d6a774 | 270 | $(DSO) $(ARCHFLAGS) $(DSOFLAGS) -o $@ \ |
fa73b229 | 271 | -install_name $(libdir)/$@ \ |
f7deaa1a | 272 | -current_version 2.8.0 \ |
ef416fc2 | 273 | -compatibility_version 2.0.0 \ |
f7deaa1a | 274 | $(LIBOBJS) $(LIBGSSAPI) $(SSLLIBS) $(COMMONLIBS) $(LIBZ) |
ef416fc2 | 275 | $(RM) libcups.dylib |
276 | $(LN) $@ libcups.dylib | |
277 | ||
278 | ||
279 | # | |
280 | # libcups_s.a | |
281 | # | |
282 | ||
a74454a7 | 283 | libcups_s.a: $(LIBOBJS) libcups_s.exp |
ef416fc2 | 284 | echo Creating $@... |
f7deaa1a | 285 | $(DSO) $(DSOFLAGS) -Wl,-bexport:libcups_s.exp -o libcups_s.o $(LIBOBJS) $(LIBGSSAPI) $(SSLLIBS) $(COMMONLIBS) $(LIBZ) -lm |
ef416fc2 | 286 | $(RM) $@ |
287 | $(AR) $(ARFLAGS) $@ libcups_s.o | |
288 | ||
289 | ||
290 | # | |
291 | # libcups.la | |
292 | # | |
293 | ||
294 | libcups.la: $(LIBOBJS) | |
295 | echo Linking $@... | |
e1d6a774 | 296 | $(CC) $(ARCHFLAGS) $(DSOFLAGS) -o $@ $(LIBOBJS:.o=.lo) -rpath $(LIBDIR) \ |
f7deaa1a | 297 | -version-info 2:8 $(LIBGSSAPI) $(SSLLIBS) $(COMMONLIBS) $(LIBZ) |
ef416fc2 | 298 | |
299 | ||
300 | # | |
301 | # libcups.a | |
302 | # | |
303 | ||
304 | libcups.a: $(LIBOBJS) | |
305 | echo Archiving $@... | |
306 | $(RM) $@ | |
307 | $(AR) $(ARFLAGS) $@ $(LIBOBJS) | |
308 | $(RANLIB) $@ | |
309 | ||
310 | ||
311 | # | |
312 | # CUPS language bindings for various scripting languages... | |
313 | # | |
757d2cad | 314 | # NOTE: Not currently used or functional - see the scripting/php directory |
315 | # for the hand-written bindings... | |
316 | # | |
ef416fc2 | 317 | |
318 | phpcups.so: $(LIBCUPS) php_cups_wrap.o | |
319 | echo Linking $@... | |
320 | if test `uname` = Darwin; then \ | |
321 | DSOFLAGS="-bundle -flat_namespace -undefined suppress"; \ | |
322 | else \ | |
323 | DSOFLAGS="$(DSOFLAGS)"; \ | |
324 | fi; \ | |
325 | $(DSO) $$DSOFLAGS -o $@ php_cups_wrap.o $(LIBS) `php-config --ldflags --libs` | |
326 | ||
327 | php_cups_wrap.o: php_cups_wrap.c | |
328 | echo Compiling $<... | |
329 | $(CC) $(CFLAGS) `php-config --includes` -c $< | |
330 | php_cups_wrap.c: cups.h | |
331 | echo Creating $< using SWIG... | |
332 | swig -php -o $@ -module cups cups.h | |
333 | ||
334 | ||
757d2cad | 335 | # |
336 | # testadmin (dependency on static CUPS library is intentional) | |
337 | # | |
338 | ||
339 | testadmin: testadmin.o libcups.a | |
340 | echo Linking $@... | |
341 | $(CC) $(LDFLAGS) -o $@ testadmin.o libcups.a \ | |
f7deaa1a | 342 | $(LIBGSSAPI) $(SSLLIBS) $(COMMONLIBS) $(LIBZ) |
757d2cad | 343 | |
344 | ||
ef416fc2 | 345 | # |
346 | # testarray (dependency on static CUPS library is intentional) | |
347 | # | |
348 | ||
349 | testarray: testarray.o libcups.a | |
350 | echo Linking $@... | |
351 | $(CC) $(LDFLAGS) -o $@ testarray.o libcups.a \ | |
f7deaa1a | 352 | $(LIBGSSAPI) $(SSLLIBS) $(COMMONLIBS) $(LIBZ) |
ef416fc2 | 353 | |
354 | ||
355 | # | |
356 | # testfile (dependency on static CUPS library is intentional) | |
357 | # | |
358 | ||
359 | testfile: testfile.o libcups.a | |
360 | echo Linking $@... | |
361 | $(CC) $(LDFLAGS) -o $@ testfile.o libcups.a \ | |
f7deaa1a | 362 | $(LIBGSSAPI) $(SSLLIBS) $(COMMONLIBS) $(LIBZ) |
ef416fc2 | 363 | |
364 | ||
365 | # | |
366 | # testhttp (dependency on static CUPS library is intentional) | |
367 | # | |
368 | ||
369 | testhttp: testhttp.o libcups.a | |
370 | echo Linking $@... | |
371 | $(CC) $(LDFLAGS) -o $@ testhttp.o libcups.a \ | |
f7deaa1a | 372 | $(LIBGSSAPI) $(SSLLIBS) $(COMMONLIBS) $(LIBZ) |
ef416fc2 | 373 | |
374 | ||
375 | # | |
376 | # testipp (dependency on static CUPS library is intentional) | |
377 | # | |
378 | ||
379 | testipp: testipp.o libcups.a | |
380 | echo Linking $@... | |
381 | $(CC) $(LDFLAGS) -o $@ testipp.o libcups.a \ | |
f7deaa1a | 382 | $(LIBGSSAPI) $(SSLLIBS) $(COMMONLIBS) $(LIBZ) |
ef416fc2 | 383 | |
384 | ||
385 | # | |
386 | # testi18n (dependency on static CUPS library is intentional) | |
387 | # | |
388 | ||
389 | testi18n: testi18n.o libcups.a | |
390 | echo Linking $@... | |
391 | $(CC) $(LDFLAGS) -o $@ testi18n.o libcups.a \ | |
f7deaa1a | 392 | $(LIBGSSAPI) $(SSLLIBS) $(COMMONLIBS) $(LIBZ) |
ef416fc2 | 393 | |
394 | ||
395 | # | |
396 | # testlang (dependency on static CUPS library is intentional) | |
397 | # | |
398 | ||
399 | testlang: testlang.o libcups.a | |
400 | echo Linking $@... | |
401 | $(CC) $(LDFLAGS) -o $@ testlang.o libcups.a \ | |
f7deaa1a | 402 | $(LIBGSSAPI) $(SSLLIBS) $(COMMONLIBS) $(LIBZ) |
ef416fc2 | 403 | |
404 | ||
fa73b229 | 405 | # |
406 | # testppd (dependency on static CUPS library is intentional) | |
407 | # | |
408 | ||
409 | testppd: testppd.o libcups.a | |
410 | echo Linking $@... | |
411 | $(CC) $(LDFLAGS) -o $@ testppd.o libcups.a \ | |
f7deaa1a | 412 | $(LIBGSSAPI) $(SSLLIBS) $(COMMONLIBS) $(LIBZ) |
fa73b229 | 413 | |
414 | ||
ef416fc2 | 415 | # |
416 | # Automatic API help files... | |
417 | # | |
418 | ||
419 | apihelp: | |
420 | echo Generating CUPS API help files... | |
421 | mxmldoc --section "Programming" --title "Array API" \ | |
422 | --intro api-array.shtml \ | |
423 | array.h array.c >../doc/help/api-array.html | |
424 | mxmldoc --section "Programming" --title "CUPS API" \ | |
425 | --intro api-cups.shtml \ | |
f7deaa1a | 426 | cups.h dest.c getputfile.c language.c notify.c \ |
ef416fc2 | 427 | options.c tempfile.c usersys.c \ |
428 | util.c >../doc/help/api-cups.html | |
429 | mxmldoc --section "Programming" --title "File and Directory APIs" \ | |
430 | --intro api-filedir.shtml \ | |
431 | file.h file.c dir.h dir.c >../doc/help/api-filedir.html | |
432 | mxmldoc --section "Programming" --title "PPD API" \ | |
433 | --intro api-ppd.shtml \ | |
89d46774 | 434 | ppd.h attr.c custom.c emit.c localize.c mark.c page.c \ |
ef416fc2 | 435 | ppd.c >../doc/help/api-ppd.html |
436 | mxmldoc --section "Programming" --title "HTTP and IPP APIs" \ | |
437 | --intro api-httpipp.shtml \ | |
ecdc0628 | 438 | http.h ipp.h auth.c encode.c http.c http-addr.c \ |
439 | http-support.c ipp.c ipp-support.c md5passwd.c \ | |
440 | request.c >../doc/help/api-httpipp.html | |
ef416fc2 | 441 | mxmldoc --section "Programming" --title "Filter and Backend APIs" \ |
442 | --intro api-filter.shtml \ | |
f7deaa1a | 443 | backchannel.c sidechannel.c sidechannel.h >../doc/help/api-filter.html |
ef416fc2 | 444 | |
445 | ||
446 | # | |
447 | # Dependencies... | |
448 | # | |
449 | ||
450 | include Dependencies | |
451 | ||
452 | ||
453 | # | |
f7deaa1a | 454 | # End of "$Id: Makefile 6304 2007-02-22 22:06:23Z mike $". |
ef416fc2 | 455 | # |