]> git.ipfire.org Git - thirdparty/cups.git/blob - cups/Makefile
Merge changes from CUPS 1.5svn-r9041.
[thirdparty/cups.git] / cups / Makefile
1 #
2 # "$Id: Makefile 7871 2008-08-27 21:12:43Z mike $"
3 #
4 # API library Makefile for CUPS.
5 #
6 # Copyright 2007-2010 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 conflicts.o \
32 custom.o \
33 debug.o \
34 dest.o \
35 dir.o \
36 emit.o \
37 encode.o \
38 file.o \
39 getdevices.o \
40 getifaddrs.o \
41 getputfile.o \
42 globals.o \
43 http.o \
44 http-addr.o \
45 http-addrlist.o \
46 http-support.o \
47 ipp.o \
48 ipp-support.o \
49 langprintf.o \
50 language.o \
51 localize.o \
52 mark.o \
53 md5.o \
54 md5passwd.o \
55 notify.o \
56 options.o \
57 page.o \
58 ppd.o \
59 pwg-file.o \
60 pwg-media.o \
61 pwg-ppd.o \
62 request.o \
63 sidechannel.o \
64 snmp.o \
65 snprintf.o \
66 string.o \
67 tempfile.o \
68 transcode.o \
69 usersys.o \
70 util.o
71 LIB32OBJS = $(LIBOBJS:.o=.32.o)
72 LIB64OBJS = $(LIBOBJS:.o=.64.o)
73 OBJS = \
74 $(LIBOBJS) \
75 $(LIB32OBJS) \
76 $(LIB64OBJS) \
77 testadmin.o \
78 testarray.o \
79 testconflicts.o \
80 testcups.o \
81 testfile.o \
82 testhttp.o \
83 testi18n.o \
84 testipp.o \
85 testoptions.o \
86 testlang.o \
87 testppd.o \
88 testpwg.o \
89 testsnmp.o \
90 php_cups_wrap.o
91
92
93 #
94 # Header files to install...
95 #
96
97 HEADERS = \
98 adminutil.h \
99 array.h \
100 backend.h \
101 cups.h \
102 dir.h \
103 file.h \
104 http.h \
105 ipp.h \
106 language.h \
107 ppd.h \
108 raster.h \
109 sidechannel.h \
110 transcode.h \
111 versioning.h
112
113
114 #
115 # Targets in this directory...
116 #
117
118 LIBTARGETS = \
119 $(LIBCUPSSTATIC) \
120 $(LIBCUPS) \
121 $(LIB32CUPS) \
122 $(LIB64CUPS)
123
124 UNITTARGETS = \
125 testadmin \
126 testarray \
127 testconflicts \
128 testcups \
129 testfile \
130 testhttp \
131 testi18n \
132 testipp \
133 testlang \
134 testoptions \
135 testppd \
136 testpwg \
137 testsnmp
138
139 TARGETS = \
140 $(LIBTARGETS)
141
142
143 #
144 # Make all targets...
145 #
146
147 all: $(TARGETS)
148
149
150 #
151 # Make library targets...
152 #
153
154 libs: $(LIBTARGETS)
155
156
157 #
158 # Make unit tests...
159 #
160
161 unittests: $(UNITTARGETS)
162
163
164 #
165 # Remove object and target files...
166 #
167
168 clean:
169 $(RM) $(OBJS) $(TARGETS) $(UNITTARGETS)
170 $(RM) libcups.so libcups.sl libcups.dylib
171 $(RM) -r 32bit 64bit
172
173
174 #
175 # Update dependencies (without system header dependencies...)
176 #
177
178 depend:
179 touch Dependencies.tmp
180 makedepend -Y -I.. -fDependencies.tmp $(OBJS:.o=.c) >/dev/null 2>&1
181 $(RM) Dependencies
182 cp Dependencies.tmp Dependencies
183 sed -E -e '1,$$s/^([^.]+)\.o:/\1\.32.o: \1\.c /' Dependencies.tmp >>Dependencies
184 sed -E -e '1,$$s/^([^.]+)\.o:/\1\.64.o: \1\.c /' Dependencies.tmp >>Dependencies
185 $(RM) Dependencies.tmp
186
187
188 #
189 # Install all targets...
190 #
191
192 install: all install-data install-headers install-libs install-exec
193
194
195 #
196 # Install data files...
197 #
198
199 install-data:
200
201
202 #
203 # Install programs...
204 #
205
206 install-exec:
207
208
209 #
210 # Install headers...
211 #
212
213 install-headers:
214 echo Installing header files into $(INCLUDEDIR)/cups...
215 $(INSTALL_DIR) -m 755 $(INCLUDEDIR)/cups
216 for file in $(HEADERS); do \
217 $(INSTALL_DATA) $$file $(INCLUDEDIR)/cups; \
218 done
219
220
221 #
222 # Install libraries...
223 #
224
225 install-libs: $(INSTALLSTATIC) $(INSTALL32) $(INSTALL64)
226 echo Installing libraries in $(LIBDIR)...
227 $(INSTALL_DIR) -m 755 $(LIBDIR)
228 $(INSTALL_LIB) $(LIBCUPS) $(LIBDIR)
229 if test $(LIBCUPS) = "libcups.so.2" -o $(LIBCUPS) = "libcups.sl.2"; then \
230 $(RM) $(LIBDIR)/`basename $(LIBCUPS) .2`; \
231 $(LN) $(LIBCUPS) $(LIBDIR)/`basename $(LIBCUPS) .2`; \
232 fi
233 if test $(LIBCUPS) = "libcups.2.dylib"; then \
234 $(RM) $(LIBDIR)/libcups.dylib; \
235 $(LN) $(LIBCUPS) $(LIBDIR)/libcups.dylib; \
236 fi
237 if test "x$(SYMROOT)" != "x"; then \
238 $(INSTALL_DIR) $(SYMROOT); \
239 cp $(LIBCUPS) $(SYMROOT); \
240 fi
241
242 installstatic:
243 $(INSTALL_DIR) -m 755 $(LIBDIR)
244 $(INSTALL_LIB) -m 755 $(LIBCUPSSTATIC) $(LIBDIR)
245 $(RANLIB) $(LIBDIR)/$(LIBCUPSSTATIC)
246 $(CHMOD) 555 $(LIBDIR)/$(LIBCUPSSTATIC)
247
248 install32bit:
249 echo Installing libraries in $(LIB32DIR)...
250 $(INSTALL_DIR) -m 755 $(LIB32DIR)
251 $(INSTALL_LIB) 32bit/libcups.so.2 $(LIB32DIR)/libcups.so.2
252 $(LN) libcups.so.2 $(LIB32DIR)/libcups.so
253
254 install64bit:
255 echo Installing libraries in $(LIB64DIR)...
256 $(INSTALL_DIR) -m 755 $(LIB64DIR)
257 $(INSTALL_LIB) 64bit/libcups.so.2 $(LIB64DIR)/libcups.so.2
258 $(LN) libcups.so.2 $(LIB64DIR)/libcups.so
259
260
261 #
262 # Uninstall object and target files...
263 #
264
265 uninstall: $(UNINSTALL32) $(UNINSTALL64)
266 $(RM) $(LIBDIR)/libcups.2.dylib
267 $(RM) $(LIBDIR)/libcups.a
268 $(RM) $(LIBDIR)/libcups.dylib
269 $(RM) $(LIBDIR)/libcups_s.a
270 $(RM) $(LIBDIR)/libcups.sl
271 $(RM) $(LIBDIR)/libcups.sl.2
272 $(RM) $(LIBDIR)/libcups.so
273 $(RM) $(LIBDIR)/libcups.so.2
274 -$(RMDIR) $(LIBDIR)
275 for file in $(HEADERS); do \
276 $(RM) $(INCLUDEDIR)/cups/$$file; \
277 done
278 -$(RMDIR) $(INCLUDEDIR)/cups
279
280 uninstall32bit:
281 $(RM) $(LIB32DIR)/libcups.so
282 $(RM) $(LIB32DIR)/libcups.so.2
283 -$(RMDIR) $(LIB32DIR)
284
285 uninstall64bit:
286 $(RM) $(LIB64DIR)/libcups.so
287 $(RM) $(LIB64DIR)/libcups.so.2
288 -$(RMDIR) $(LIB64DIR)
289
290
291 #
292 # libcups.so.2, libcups.sl.2
293 #
294
295 libcups.so.2 libcups.sl.2: $(LIBOBJS)
296 echo Linking $@...
297 $(DSO) $(ARCHFLAGS) $(DSOFLAGS) -o $@ $(LIBOBJS) $(LIBGSSAPI) \
298 $(SSLLIBS) $(DNSSDLIBS) $(COMMONLIBS) $(LIBZ)
299 $(RM) `basename $@ .2`
300 $(LN) $@ `basename $@ .2`
301
302
303 #
304 # 32bit/libcups.so.2
305 #
306
307 32bit/libcups.so.2: $(LIB32OBJS)
308 echo Linking 32-bit $@...
309 -mkdir 32bit
310 $(DSO) $(ARCH32FLAGS) $(DSO32FLAGS) -o $@ $(LIB32OBJS) $(LIBGSSAPI) \
311 $(DNSSDLIBS) $(SSLLIBS) $(COMMONLIBS) $(LIBZ)
312 $(RM) 32bit/libcups.so
313 $(LN) libcups.so.2 32bit/libcups.so
314
315
316 #
317 # 64bit/libcups.so.2
318 #
319
320 64bit/libcups.so.2: $(LIB64OBJS)
321 echo Linking 64-bit $@...
322 -mkdir 64bit
323 $(DSO) $(ARCH64FLAGS) $(DSO64FLAGS) -o $@ $(LIB64OBJS) $(LIBGSSAPI) \
324 $(DNSSDLIBS) $(SSLLIBS) $(COMMONLIBS) $(LIBZ)
325 $(RM) 64bit/libcups.so
326 $(LN) libcups.so.2 64bit/libcups.so
327
328
329 #
330 # libcups.2.dylib
331 #
332
333 libcups.2.dylib: $(LIBOBJS) $(LIBCUPSORDER)
334 echo Creating export list for $@...
335 nm $(LIBOBJS) 2>/dev/null | grep "T _" | awk '{print $$3}' | \
336 grep -v -e '^(_cupsConnect|_cupsSetDefaults|_cupsSetHTTPError|_cupsUserDefault|_httpWait)$$' | \
337 sort >t.exp
338 echo Linking $@...
339 $(DSO) $(ARCHFLAGS) $(DSOFLAGS) -o $@ \
340 -install_name $(libdir)/$@ \
341 -current_version 2.8.0 \
342 -compatibility_version 2.0.0 \
343 -exported_symbols_list t.exp \
344 -sectorder __TEXT __text $(LIBCUPSORDER) \
345 $(LIBOBJS) $(LIBGSSAPI) $(SSLLIBS) $(DNSSDLIBS) \
346 $(COMMONLIBS) $(LIBZ)
347 $(RM) libcups.dylib t.exp
348 $(LN) $@ libcups.dylib
349
350
351 #
352 # libcups_s.a
353 #
354
355 libcups_s.a: $(LIBOBJS) libcups_s.exp
356 echo Creating $@...
357 $(DSO) $(DSOFLAGS) -Wl,-bexport:libcups_s.exp -o libcups_s.o \
358 $(LIBOBJS) $(LIBGSSAPI) $(SSLLIBS) $(DNSSDLIBS) \
359 $(COMMONLIBS) $(LIBZ) -lm
360 $(RM) $@
361 $(AR) $(ARFLAGS) $@ libcups_s.o
362
363
364 #
365 # libcups.la
366 #
367
368 libcups.la: $(LIBOBJS)
369 echo Linking $@...
370 $(CC) $(ARCHFLAGS) $(DSOFLAGS) -o $@ $(LIBOBJS:.o=.lo) \
371 -rpath $(LIBDIR) -version-info 2:8 $(LIBGSSAPI) $(SSLLIBS) \
372 $(DNSSDLIBS) $(COMMONLIBS) $(LIBZ)
373
374
375 #
376 # libcups.a
377 #
378
379 libcups.a: $(LIBOBJS)
380 echo Archiving $@...
381 $(RM) $@
382 $(AR) $(ARFLAGS) $@ $(LIBOBJS)
383 $(RANLIB) $@
384
385
386 #
387 # testadmin (dependency on static CUPS library is intentional)
388 #
389
390 testadmin: testadmin.o $(LIBCUPSSTATIC)
391 echo Linking $@...
392 $(CC) $(LDFLAGS) -o $@ testadmin.o $(LIBCUPSSTATIC) \
393 $(LIBGSSAPI) $(SSLLIBS) $(DNSSDLIBS) $(COMMONLIBS) $(LIBZ)
394
395
396 #
397 # testarray (dependency on static CUPS library is intentional)
398 #
399
400 testarray: testarray.o $(LIBCUPSSTATIC)
401 echo Linking $@...
402 $(CC) $(ARCHFLAGS) $(LDFLAGS) -o $@ testarray.o $(LIBCUPSSTATIC) \
403 $(LIBGSSAPI) $(SSLLIBS) $(DNSSDLIBS) $(COMMONLIBS) $(LIBZ)
404 echo Running array API tests...
405 ./testarray
406
407
408 #
409 # testconflicts (dependency on static CUPS library is intentional)
410 #
411
412 testconflicts: testconflicts.o $(LIBCUPSSTATIC)
413 echo Linking $@...
414 $(CC) $(LDFLAGS) -o $@ testconflicts.o $(LIBCUPSSTATIC) \
415 $(LIBGSSAPI) $(SSLLIBS) $(DNSSDLIBS) $(COMMONLIBS) $(LIBZ)
416
417
418 #
419 # testcups (dependency on static CUPS library is intentional)
420 #
421
422 testcups: testcups.o $(LIBCUPSSTATIC)
423 echo Linking $@...
424 $(CC) $(LDFLAGS) -o $@ testcups.o $(LIBCUPSSTATIC) \
425 $(LIBGSSAPI) $(SSLLIBS) $(DNSSDLIBS) $(COMMONLIBS) $(LIBZ)
426
427
428 #
429 # testfile (dependency on static CUPS library is intentional)
430 #
431
432 testfile: testfile.o $(LIBCUPSSTATIC)
433 echo Linking $@...
434 $(CC) $(ARCHFLAGS) $(LDFLAGS) -o $@ testfile.o $(LIBCUPSSTATIC) \
435 $(LIBGSSAPI) $(SSLLIBS) $(DNSSDLIBS) $(COMMONLIBS) $(LIBZ)
436 echo Running file API tests...
437 ./testfile
438
439
440 #
441 # testhttp (dependency on static CUPS library is intentional)
442 #
443
444 testhttp: testhttp.o $(LIBCUPSSTATIC)
445 echo Linking $@...
446 $(CC) $(ARCHFLAGS) $(LDFLAGS) -o $@ testhttp.o $(LIBCUPSSTATIC) \
447 $(LIBGSSAPI) $(SSLLIBS) $(DNSSDLIBS) $(COMMONLIBS) $(LIBZ)
448 echo Running HTTP API tests...
449 ./testhttp
450
451
452 #
453 # testipp (dependency on static CUPS library is intentional)
454 #
455
456 testipp: testipp.o $(LIBCUPSSTATIC)
457 echo Linking $@...
458 $(CC) $(ARCHFLAGS) $(LDFLAGS) -o $@ testipp.o $(LIBCUPSSTATIC) \
459 $(LIBGSSAPI) $(SSLLIBS) $(DNSSDLIBS) $(COMMONLIBS) $(LIBZ)
460 echo Running IPP API tests...
461 ./testipp
462
463
464 #
465 # testi18n (dependency on static CUPS library is intentional)
466 #
467
468 testi18n: testi18n.o $(LIBCUPSSTATIC)
469 echo Linking $@...
470 $(CC) $(ARCHFLAGS) $(LDFLAGS) -o $@ testi18n.o $(LIBCUPSSTATIC) \
471 $(LIBGSSAPI) $(SSLLIBS) $(DNSSDLIBS) $(COMMONLIBS) $(LIBZ)
472 echo Running internationalization API tests...
473 ./testi18n
474
475
476 #
477 # testlang (dependency on static CUPS library is intentional)
478 #
479
480 testlang: testlang.o $(LIBCUPSSTATIC)
481 echo Linking $@...
482 $(CC) $(ARCHFLAGS) $(LDFLAGS) -o $@ testlang.o $(LIBCUPSSTATIC) \
483 $(LIBGSSAPI) $(SSLLIBS) $(DNSSDLIBS) $(COMMONLIBS) $(LIBZ)
484 echo Running language API tests...
485 ./testlang
486
487
488 #
489 # testoptions (dependency on static CUPS library is intentional)
490 #
491
492 testoptions: testoptions.o $(LIBCUPSSTATIC)
493 echo Linking $@...
494 $(CC) $(ARCHFLAGS) $(LDFLAGS) -o $@ testoptions.o $(LIBCUPSSTATIC) \
495 $(LIBGSSAPI) $(SSLLIBS) $(DNSSDLIBS) $(COMMONLIBS) $(LIBZ)
496 echo Running option API tests...
497 ./testoptions
498
499
500 #
501 # testppd (dependency on static CUPS library is intentional)
502 #
503
504 testppd: testppd.o $(LIBCUPSSTATIC) test.ppd test2.ppd
505 echo Linking $@...
506 $(CC) $(ARCHFLAGS) $(LDFLAGS) -o $@ testppd.o $(LIBCUPSSTATIC) \
507 $(LIBGSSAPI) $(SSLLIBS) $(DNSSDLIBS) $(COMMONLIBS) $(LIBZ)
508 echo Running PPD API tests...
509 ./testppd
510
511
512 #
513 # testpwg (dependency on static CUPS library is intentional)
514 #
515
516 testpwg: testpwg.o $(LIBCUPSSTATIC) test.ppd
517 echo Linking $@...
518 $(CC) $(ARCHFLAGS) $(LDFLAGS) -o $@ testpwg.o $(LIBCUPSSTATIC) \
519 $(LIBGSSAPI) $(SSLLIBS) $(DNSSDLIBS) $(COMMONLIBS) $(LIBZ)
520 echo Running PWG API tests...
521 ./testpwg test.ppd
522
523
524 #
525 # testsnmp (dependency on static CUPS library is intentional)
526 #
527
528 testsnmp: testsnmp.o $(LIBCUPSSTATIC)
529 echo Linking $@...
530 $(CC) $(LDFLAGS) -o $@ testsnmp.o $(LIBCUPSSTATIC) \
531 $(LIBGSSAPI) $(SSLLIBS) $(DNSSDLIBS) $(COMMONLIBS) $(LIBZ)
532
533
534 #
535 # Automatic API help files...
536 #
537
538 apihelp:
539 echo Generating CUPS API help files...
540 mxmldoc --section "Programming" \
541 --title "Introduction to CUPS Programming" \
542 --css ../doc/cups-printable.css \
543 --header api-overview.header --intro api-overview.shtml \
544 >../doc/help/api-overview.html
545 mxmldoc --section "Programming" --title "Array API" \
546 --css ../doc/cups-printable.css \
547 --header api-array.header --intro api-array.shtml \
548 api-array.xml \
549 array.h array.c >../doc/help/api-array.html
550 mxmldoc --tokens help/api-array.html api-array.xml >../doc/help/api-array.tokens
551 $(RM) api-array.xml
552 mxmldoc --section "Programming" --title "CUPS API" \
553 --css ../doc/cups-printable.css \
554 --header api-cups.header --intro api-cups.shtml \
555 api-cups.xml \
556 cups.h adminutil.c dest.c language.c notify.c \
557 options.c tempfile.c usersys.c \
558 util.c >../doc/help/api-cups.html
559 mxmldoc --tokens help/api-cups.html api-cups.xml >../doc/help/api-cups.tokens
560 $(RM) api-cups.xml
561 mxmldoc --section "Programming" --title "File and Directory APIs" \
562 --css ../doc/cups-printable.css \
563 --header api-filedir.header --intro api-filedir.shtml \
564 api-filedir.xml \
565 file.h file.c dir.h dir.c >../doc/help/api-filedir.html
566 mxmldoc --tokens api-filedir.xml >../doc/help/api-filedir.tokens
567 $(RM) api-filedir.xml
568 mxmldoc --section "Programming" --title "PPD API" \
569 --css ../doc/cups-printable.css \
570 --header api-ppd.header --intro api-ppd.shtml \
571 api-ppd.xml \
572 ppd.h attr.c conflicts.c custom.c emit.c localize.c mark.c page.c \
573 ppd.c >../doc/help/api-ppd.html
574 mxmldoc --tokens help/api-ppd.html api-ppd.xml >../doc/help/api-ppd.tokens
575 $(RM) api-ppd.xml
576 mxmldoc --section "Programming" --title "HTTP and IPP APIs" \
577 --css ../doc/cups-printable.css \
578 --header api-httpipp.header --intro api-httpipp.shtml \
579 api-httpipp.xml \
580 http.h ipp.h auth.c getdevices.c getputfile.c encode.c \
581 http.c http-addr.c http-support.c ipp.c ipp-support.c \
582 md5passwd.c request.c >../doc/help/api-httpipp.html
583 mxmldoc --tokens help/api-httpipp.html api-httpipp.xml >../doc/help/api-httpipp.tokens
584 $(RM) api-httpipp.xml
585 mxmldoc --section "Programming" \
586 --title "Filter and Backend Programming" \
587 --css ../doc/cups-printable.css \
588 --header api-filter.header --intro api-filter.shtml \
589 api-filter.xml \
590 backchannel.c backend.h backend.c sidechannel.c sidechannel.h \
591 >../doc/help/api-filter.html
592 mxmldoc --tokens help/api-filter.html api-filter.xml >../doc/help/api-filter.tokens
593 $(RM) api-filter.xml
594
595 framedhelp:
596 echo Generating CUPS API help files...
597 mxmldoc --framed api-overview \
598 --section "Programming" \
599 --title "Introduction to CUPS Programming" \
600 --css ../doc/cups-printable.css \
601 --header api-overview.header --intro api-overview.shtml
602 mxmldoc --framed api-array \
603 --section "Programming" --title "Array API" \
604 --css ../doc/cups-printable.css \
605 --header api-array.header --intro api-array.shtml \
606 array.h array.c
607 mxmldoc --framed api-cups \
608 --section "Programming" --title "CUPS API" \
609 --css ../doc/cups-printable.css \
610 --header api-cups.header --intro api-cups.shtml \
611 cups.h adminutil.c dest.c language.c notify.c \
612 options.c tempfile.c usersys.c \
613 util.c
614 mxmldoc --framed api-filedir \
615 --section "Programming" --title "File and Directory APIs" \
616 --css ../doc/cups-printable.css \
617 --header api-filedir.header --intro api-filedir.shtml \
618 file.h file.c dir.h dir.c
619 mxmldoc --framed api-ppd \
620 --section "Programming" --title "PPD API" \
621 --css ../doc/cups-printable.css \
622 --header api-ppd.header --intro api-ppd.shtml \
623 ppd.h attr.c conflicts.c custom.c emit.c localize.c mark.c \
624 page.c ppd.c
625 mxmldoc --framed api-httpipp \
626 --section "Programming" --title "HTTP and IPP APIs" \
627 --css ../doc/cups-printable.css \
628 --header api-httpipp.header --intro api-httpipp.shtml \
629 http.h ipp.h auth.c getdevices.c getputfile.c encode.c \
630 http.c http-addr.c http-support.c ipp.c ipp-support.c \
631 md5passwd.c request.c
632 mxmldoc --framed api-filter \
633 --section "Programming" \
634 --title "Filter and Backend Programming" \
635 --css ../doc/cups-printable.css \
636 --header api-filter.header --intro api-filter.shtml \
637 backchannel.c backend.h backend.c sidechannel.c sidechannel.h
638
639
640 #
641 # Dependencies...
642 #
643
644 include Dependencies
645
646
647 #
648 # End of "$Id: Makefile 7871 2008-08-27 21:12:43Z mike $".
649 #