]> git.ipfire.org Git - thirdparty/cups.git/blob - cups/Makefile
Import CUPS 1.4svn-r7464.
[thirdparty/cups.git] / cups / Makefile
1 #
2 # "$Id: Makefile 6649 2007-07-11 21:46:42Z mike $"
3 #
4 # API library Makefile for the Common UNIX Printing System (CUPS).
5 #
6 # Copyright 2007-2008 by Apple Inc.
7 # Copyright 1997-2006 by Easy Software Products, all rights reserved.
8 #
9 # These coded instructions, statements, and computer programs are the
10 # property of Apple Inc. and are protected by Federal copyright
11 # law. Distribution and use rights are outlined in the file "LICENSE.txt"
12 # which should have been included with this file. If this file is
13 # file is missing or damaged, see the license at "http://www.cups.org/".
14 #
15 # This file is subject to the Apple OS-Developed Software exception.
16 #
17
18 include ../Makedefs
19
20 #
21 # Object files...
22 #
23
24 LIBOBJS = \
25 adminutil.o \
26 array.o \
27 attr.o \
28 auth.o \
29 backchannel.o \
30 backend.o \
31 custom.o \
32 debug.o \
33 dest.o \
34 dir.o \
35 emit.o \
36 encode.o \
37 file.o \
38 getdevices.o \
39 getifaddrs.o \
40 getputfile.o \
41 globals.o \
42 http.o \
43 http-addr.o \
44 http-addrlist.o \
45 http-support.o \
46 ipp.o \
47 ipp-support.o \
48 langprintf.o \
49 language.o \
50 localize.o \
51 mark.o \
52 md5.o \
53 md5passwd.o \
54 notify.o \
55 options.o \
56 page.o \
57 ppd.o \
58 request.o \
59 sidechannel.o \
60 snmp.o \
61 snprintf.o \
62 string.o \
63 tempfile.o \
64 transcode.o \
65 usersys.o \
66 util.o
67 LIB32OBJS = $(LIBOBJS:.o=.32.o)
68 LIB64OBJS = $(LIBOBJS:.o=.64.o)
69 OBJS = \
70 $(LIBOBJS) \
71 $(LIB32OBJS) \
72 $(LIB64OBJS) \
73 testadmin.o \
74 testarray.o \
75 testcups.o \
76 testfile.o \
77 testhttp.o \
78 testi18n.o \
79 testipp.o \
80 testlang.o \
81 testppd.o \
82 testsnmp.o \
83 php_cups_wrap.o
84
85
86 #
87 # Header files to install...
88 #
89
90 HEADERS = \
91 adminutil.h \
92 array.h \
93 backend.h \
94 cups.h \
95 dir.h \
96 file.h \
97 http.h \
98 ipp.h \
99 language.h \
100 ppd.h \
101 raster.h \
102 sidechannel.h \
103 snmp.h \
104 transcode.h \
105 versioning.h
106
107
108 #
109 # Targets in this directory...
110 #
111
112 TARGETS = \
113 $(LIBCUPS) \
114 $(LIB32CUPS) \
115 $(LIB64CUPS) \
116 libcups.a \
117 testadmin \
118 testarray \
119 testcups \
120 testfile \
121 testhttp \
122 testi18n \
123 testipp \
124 testlang \
125 testppd \
126 testsnmp
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:
141 $(RM) $(OBJS) $(TARGETS)
142 $(RM) libcups.so libcups.sl libcups.dylib
143 $(RM) -r 32bit 64bit
144
145
146 #
147 # Update dependencies (without system header dependencies...)
148 #
149
150 depend:
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 -E -e '1,$$s/^([^.]+)\.o:/\1\.32.o: \1\.c /' Dependencies.tmp >>Dependencies
156 sed -E -e '1,$$s/^([^.]+)\.o:/\1\.64.o: \1\.c /' Dependencies.tmp >>Dependencies
157 $(RM) Dependencies.tmp
158
159
160 #
161 # Install all targets...
162 #
163
164 install: all install-data install-headers install-libs install-exec
165
166
167 #
168 # Install data files...
169 #
170
171 install-data:
172
173
174 #
175 # Install programs...
176 #
177
178 install-exec:
179
180
181 #
182 # Install headers...
183 #
184
185 install-headers:
186 echo Installing header files into $(INCLUDEDIR)/cups...
187 $(INSTALL_DIR) -m 755 $(INCLUDEDIR)/cups
188 for file in $(HEADERS); do \
189 $(INSTALL_DATA) $$file $(INCLUDEDIR)/cups; \
190 done
191
192
193 #
194 # Install libraries...
195 #
196
197 install-libs: $(INSTALLSTATIC) $(INSTALL32) $(INSTALL64)
198 echo Installing libraries in $(LIBDIR)...
199 $(INSTALL_DIR) -m 755 $(LIBDIR)
200 $(INSTALL_LIB) $(LIBCUPS) $(LIBDIR)
201 if test $(LIBCUPS) = "libcups.so.2" -o $(LIBCUPS) = "libcups.sl.2"; then \
202 $(RM) $(LIBDIR)/`basename $(LIBCUPS) .2`; \
203 $(LN) $(LIBCUPS) $(LIBDIR)/`basename $(LIBCUPS) .2`; \
204 fi
205 if test $(LIBCUPS) = "libcups.2.dylib"; then \
206 $(RM) $(LIBDIR)/libcups.dylib; \
207 $(LN) $(LIBCUPS) $(LIBDIR)/libcups.dylib; \
208 fi
209 if test "x$(SYMROOT)" != "x"; then \
210 $(INSTALL_DIR) $(SYMROOT); \
211 cp $(LIBCUPS) $(SYMROOT); \
212 fi
213
214 installstatic:
215 $(INSTALL_DIR) -m 755 $(LIBDIR)
216 $(INSTALL_LIB) libcups.a $(LIBDIR)
217 $(RANLIB) $(LIBDIR)/libcups.a
218
219 install32bit:
220 echo Installing libraries in $(LIB32DIR)...
221 $(INSTALL_DIR) -m 755 $(LIB32DIR)
222 $(INSTALL_LIB) 32bit/libcups.so.2 $(LIB32DIR)/libcups.so.2
223 $(LN) libcups.so.2 $(LIB32DIR)/libcups.so
224
225 install64bit:
226 echo Installing libraries in $(LIB64DIR)...
227 $(INSTALL_DIR) -m 755 $(LIB64DIR)
228 $(INSTALL_LIB) 64bit/libcups.so.2 $(LIB64DIR)/libcups.so.2
229 $(LN) libcups.so.2 $(LIB64DIR)/libcups.so
230
231
232 #
233 # Uninstall object and target files...
234 #
235
236 uninstall: $(UNINSTALL32) $(UNINSTALL64)
237 $(RM) $(LIBDIR)/libcups.2.dylib
238 $(RM) $(LIBDIR)/libcups.a
239 $(RM) $(LIBDIR)/libcups.dylib
240 $(RM) $(LIBDIR)/libcups_s.a
241 $(RM) $(LIBDIR)/libcups.sl
242 $(RM) $(LIBDIR)/libcups.sl.2
243 $(RM) $(LIBDIR)/libcups.so
244 $(RM) $(LIBDIR)/libcups.so.2
245 -$(RMDIR) $(LIBDIR)
246 for file in $(HEADERS); do \
247 $(RM) $(INCLUDEDIR)/cups/$$file; \
248 done
249 -$(RMDIR) $(INCLUDEDIR)/cups
250
251 uninstall32bit:
252 $(RM) $(LIB32DIR)/libcups.so
253 $(RM) $(LIB32DIR)/libcups.so.2
254 -$(RMDIR) $(LIB32DIR)
255
256 uninstall64bit:
257 $(RM) $(LIB64DIR)/libcups.so
258 $(RM) $(LIB64DIR)/libcups.so.2
259 -$(RMDIR) $(LIB64DIR)
260
261
262 #
263 # libcups.so.2, libcups.sl.2
264 #
265
266 libcups.so.2 libcups.sl.2: $(LIBOBJS)
267 echo Linking $@...
268 $(DSO) $(ARCHFLAGS) $(DSOFLAGS) -o $@ $(LIBOBJS) $(LIBGSSAPI) $(SSLLIBS) $(COMMONLIBS) $(LIBZ)
269 $(RM) `basename $@ .2`
270 $(LN) $@ `basename $@ .2`
271
272
273 #
274 # 32bit/libcups.so.2
275 #
276
277 32bit/libcups.so.2: $(LIB32OBJS)
278 echo Linking 32-bit $@...
279 -mkdir 32bit
280 $(DSO) $(ARCH32FLAGS) $(DSO32FLAGS) -o $@ $(LIB32OBJS) $(LIBGSSAPI) $(SSLLIBS) $(COMMONLIBS) $(LIBZ)
281 $(RM) 32bit/libcups.so
282 $(LN) libcups.so.2 32bit/libcups.so
283
284
285 #
286 # 64bit/libcups.so.2
287 #
288
289 64bit/libcups.so.2: $(LIB64OBJS)
290 echo Linking 64-bit $@...
291 -mkdir 64bit
292 $(DSO) $(ARCH64FLAGS) $(DSO64FLAGS) -o $@ $(LIB64OBJS) $(LIBGSSAPI) $(SSLLIBS) $(COMMONLIBS) $(LIBZ)
293 $(RM) 64bit/libcups.so
294 $(LN) libcups.so.2 64bit/libcups.so
295
296
297 #
298 # libcups.2.dylib
299 #
300
301 libcups.2.dylib: $(LIBOBJS) $(LIBCUPSORDER) libcups.exp
302 echo Linking $@...
303 $(DSO) $(ARCHFLAGS) $(DSOFLAGS) -o $@ \
304 -install_name $(libdir)/$@ \
305 -current_version 2.8.0 \
306 -compatibility_version 2.0.0 \
307 -exported_symbols_list libcups.exp \
308 -sectorder __TEXT __text $(LIBCUPSORDER) \
309 $(LIBOBJS) $(LIBGSSAPI) $(SSLLIBS) $(COMMONLIBS) $(LIBZ)
310 $(RM) libcups.dylib
311 $(LN) $@ libcups.dylib
312
313
314 #
315 # libcups_s.a
316 #
317
318 libcups_s.a: $(LIBOBJS) libcups_s.exp
319 echo Creating $@...
320 $(DSO) $(DSOFLAGS) -Wl,-bexport:libcups_s.exp -o libcups_s.o $(LIBOBJS) $(LIBGSSAPI) $(SSLLIBS) $(COMMONLIBS) $(LIBZ) -lm
321 $(RM) $@
322 $(AR) $(ARFLAGS) $@ libcups_s.o
323
324
325 #
326 # libcups.la
327 #
328
329 libcups.la: $(LIBOBJS)
330 echo Linking $@...
331 $(CC) $(ARCHFLAGS) $(DSOFLAGS) -o $@ $(LIBOBJS:.o=.lo) -rpath $(LIBDIR) \
332 -version-info 2:8 $(LIBGSSAPI) $(SSLLIBS) $(COMMONLIBS) $(LIBZ)
333
334
335 #
336 # libcups.a
337 #
338
339 libcups.a: $(LIBOBJS)
340 echo Archiving $@...
341 $(RM) $@
342 $(AR) $(ARFLAGS) $@ $(LIBOBJS)
343 $(RANLIB) $@
344
345
346 #
347 # CUPS language bindings for various scripting languages...
348 #
349 # NOTE: Not currently used or functional - see the scripting/php directory
350 # for the hand-written bindings...
351 #
352
353 phpcups.so: $(LIBCUPS) php_cups_wrap.o
354 echo Linking $@...
355 if test `uname` = Darwin; then \
356 DSOFLAGS="-bundle -flat_namespace -undefined suppress"; \
357 else \
358 DSOFLAGS="$(DSOFLAGS)"; \
359 fi; \
360 $(DSO) $$DSOFLAGS -o $@ php_cups_wrap.o $(LIBS) `php-config --ldflags --libs`
361
362 php_cups_wrap.o: php_cups_wrap.c
363 echo Compiling $<...
364 $(CC) $(CFLAGS) `php-config --includes` -c $<
365 php_cups_wrap.c: cups.h
366 echo Creating $< using SWIG...
367 swig -php -o $@ -module cups cups.h
368
369
370 #
371 # testadmin (dependency on static CUPS library is intentional)
372 #
373
374 testadmin: testadmin.o libcups.a
375 echo Linking $@...
376 $(CC) $(LDFLAGS) -o $@ testadmin.o libcups.a \
377 $(LIBGSSAPI) $(SSLLIBS) $(COMMONLIBS) $(LIBZ)
378
379
380 #
381 # testarray (dependency on static CUPS library is intentional)
382 #
383
384 testarray: testarray.o libcups.a
385 echo Linking $@...
386 $(CC) $(LDFLAGS) -o $@ testarray.o libcups.a \
387 $(LIBGSSAPI) $(SSLLIBS) $(COMMONLIBS) $(LIBZ)
388
389
390 #
391 # testcups (dependency on static CUPS library is intentional)
392 #
393
394 testcups: testcups.o libcups.a
395 echo Linking $@...
396 $(CC) $(LDFLAGS) -o $@ testcups.o libcups.a \
397 $(LIBGSSAPI) $(SSLLIBS) $(COMMONLIBS) $(LIBZ)
398
399
400 #
401 # testfile (dependency on static CUPS library is intentional)
402 #
403
404 testfile: testfile.o libcups.a
405 echo Linking $@...
406 $(CC) $(LDFLAGS) -o $@ testfile.o libcups.a \
407 $(LIBGSSAPI) $(SSLLIBS) $(COMMONLIBS) $(LIBZ)
408
409
410 #
411 # testhttp (dependency on static CUPS library is intentional)
412 #
413
414 testhttp: testhttp.o libcups.a
415 echo Linking $@...
416 $(CC) $(LDFLAGS) -o $@ testhttp.o libcups.a \
417 $(LIBGSSAPI) $(SSLLIBS) $(COMMONLIBS) $(LIBZ)
418
419
420 #
421 # testipp (dependency on static CUPS library is intentional)
422 #
423
424 testipp: testipp.o libcups.a
425 echo Linking $@...
426 $(CC) $(LDFLAGS) -o $@ testipp.o libcups.a \
427 $(LIBGSSAPI) $(SSLLIBS) $(COMMONLIBS) $(LIBZ)
428
429
430 #
431 # testi18n (dependency on static CUPS library is intentional)
432 #
433
434 testi18n: testi18n.o libcups.a
435 echo Linking $@...
436 $(CC) $(LDFLAGS) -o $@ testi18n.o libcups.a \
437 $(LIBGSSAPI) $(SSLLIBS) $(COMMONLIBS) $(LIBZ)
438
439
440 #
441 # testlang (dependency on static CUPS library is intentional)
442 #
443
444 testlang: testlang.o libcups.a
445 echo Linking $@...
446 $(CC) $(LDFLAGS) -o $@ testlang.o libcups.a \
447 $(LIBGSSAPI) $(SSLLIBS) $(COMMONLIBS) $(LIBZ)
448
449
450 #
451 # testppd (dependency on static CUPS library is intentional)
452 #
453
454 testppd: testppd.o libcups.a
455 echo Linking $@...
456 $(CC) $(LDFLAGS) -o $@ testppd.o libcups.a \
457 $(LIBGSSAPI) $(SSLLIBS) $(COMMONLIBS) $(LIBZ)
458
459
460 #
461 # testsnmp (dependency on static CUPS library is intentional)
462 #
463
464 testsnmp: testsnmp.o libcups.a
465 echo Linking $@...
466 $(CC) $(LDFLAGS) -o $@ testsnmp.o libcups.a \
467 $(LIBGSSAPI) $(SSLLIBS) $(COMMONLIBS) $(LIBZ)
468
469
470 #
471 # Automatic API help files...
472 #
473
474 apihelp:
475 echo Generating CUPS API help files...
476 mxmldoc --section "Programming" \
477 --title "Introduction to CUPS Programming" \
478 --css ../doc/cups-printable.css \
479 --header api-overview.header --intro api-overview.shtml \
480 >../doc/help/api-overview.html
481 mxmldoc --section "Programming" --title "Array API" \
482 --css ../doc/cups-printable.css \
483 --header api-array.header --intro api-array.shtml \
484 array.h array.c >../doc/help/api-array.html
485 mxmldoc --section "Programming" --title "CUPS API" \
486 --css ../doc/cups-printable.css \
487 --header api-cups.header --intro api-cups.shtml \
488 cups.h dest.c language.c notify.c \
489 options.c tempfile.c usersys.c \
490 util.c >../doc/help/api-cups.html
491 mxmldoc --section "Programming" --title "File and Directory APIs" \
492 --css ../doc/cups-printable.css \
493 --header api-filedir.header --intro api-filedir.shtml \
494 file.h file.c dir.h dir.c >../doc/help/api-filedir.html
495 mxmldoc --section "Programming" --title "PPD API" \
496 --css ../doc/cups-printable.css \
497 --header api-ppd.header --intro api-ppd.shtml \
498 ppd.h attr.c custom.c emit.c localize.c mark.c page.c \
499 ppd.c >../doc/help/api-ppd.html
500 mxmldoc --section "Programming" --title "HTTP and IPP APIs" \
501 --css ../doc/cups-printable.css \
502 --header api-httpipp.header --intro api-httpipp.shtml \
503 http.h ipp.h auth.c getdevices.c getputfile.c encode.c \
504 http.c http-addr.c http-support.c ipp.c ipp-support.c \
505 md5passwd.c request.c >../doc/help/api-httpipp.html
506 mxmldoc --section "Programming" \
507 --title "Filter and Backend Programming" \
508 --css ../doc/cups-printable.css \
509 --header api-filter.header --intro api-filter.shtml \
510 backchannel.c backend.h backend.c sidechannel.c sidechannel.h \
511 snmp.c snmp.h >../doc/help/api-filter.html
512
513 framedhelp:
514 echo Generating CUPS API help files...
515 mxmldoc --framed api-overview \
516 --section "Programming" \
517 --title "Introduction to CUPS Programming" \
518 --css ../doc/cups-printable.css \
519 --header api-overview.header --intro api-overview.shtml
520 mxmldoc --framed api-array \
521 --section "Programming" --title "Array API" \
522 --css ../doc/cups-printable.css \
523 --header api-array.header --intro api-array.shtml \
524 array.h array.c
525 mxmldoc --framed api-cups \
526 --section "Programming" --title "CUPS API" \
527 --css ../doc/cups-printable.css \
528 --header api-cups.header --intro api-cups.shtml \
529 cups.h dest.c language.c notify.c \
530 options.c tempfile.c usersys.c \
531 util.c
532 mxmldoc --framed api-filedir \
533 --section "Programming" --title "File and Directory APIs" \
534 --css ../doc/cups-printable.css \
535 --header api-filedir.header --intro api-filedir.shtml \
536 file.h file.c dir.h dir.c
537 mxmldoc --framed api-ppd \
538 --section "Programming" --title "PPD API" \
539 --css ../doc/cups-printable.css \
540 --header api-ppd.header --intro api-ppd.shtml \
541 ppd.h attr.c custom.c emit.c localize.c mark.c page.c \
542 ppd.c
543 mxmldoc --framed api-httpipp \
544 --section "Programming" --title "HTTP and IPP APIs" \
545 --css ../doc/cups-printable.css \
546 --header api-httpipp.header --intro api-httpipp.shtml \
547 http.h ipp.h auth.c getdevices.c getputfile.c encode.c \
548 http.c http-addr.c http-support.c ipp.c ipp-support.c \
549 md5passwd.c request.c
550 mxmldoc --framed api-filter \
551 --section "Programming" \
552 --title "Filter and Backend Programming" \
553 --css ../doc/cups-printable.css \
554 --header api-filter.header --intro api-filter.shtml \
555 backchannel.c backend.h backend.c sidechannel.c sidechannel.h \
556 snmp.c snmp.h
557
558
559 #
560 # Dependencies...
561 #
562
563 include Dependencies
564
565
566 #
567 # End of "$Id: Makefile 6649 2007-07-11 21:46:42Z mike $".
568 #