]> git.ipfire.org Git - thirdparty/cups.git/blob - cups/Makefile
Remove all of the Subversion keywords from various source files.
[thirdparty/cups.git] / cups / Makefile
1 #
2 # API library Makefile for CUPS.
3 #
4 # Copyright 2007-2015 by Apple Inc.
5 # Copyright 1997-2006 by Easy Software Products, all rights reserved.
6 #
7 # These coded instructions, statements, and computer programs are the
8 # property of Apple Inc. and are protected by Federal copyright
9 # law. Distribution and use rights are outlined in the file "LICENSE.txt"
10 # which should have been included with this file. If this file is
11 # file is missing or damaged, see the license at "http://www.cups.org/".
12 #
13 # This file is subject to the Apple OS-Developed Software exception.
14 #
15
16 include ../Makedefs
17
18
19 #
20 # Options to build libcups without the use of deprecated APIs...
21 #
22
23 OPTIONS = -D_CUPS_NO_DEPRECATED=1 -D_PPD_DEPRECATED=""
24
25
26 #
27 # Object files...
28 #
29
30 LIBOBJS = \
31 adminutil.o \
32 array.o \
33 auth.o \
34 backchannel.o \
35 backend.o \
36 debug.o \
37 dest.o \
38 dest-job.o \
39 dest-localization.o \
40 dest-options.o \
41 dir.o \
42 encode.o \
43 file.o \
44 getdevices.o \
45 getifaddrs.o \
46 getputfile.o \
47 globals.o \
48 hash.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 \
57 md5.o \
58 md5passwd.o \
59 notify.o \
60 options.o \
61 ppd.o \
62 ppd-attr.o \
63 ppd-cache.o \
64 ppd-conflicts.o \
65 ppd-custom.o \
66 ppd-emit.o \
67 ppd-localize.o \
68 ppd-mark.o \
69 ppd-page.o \
70 ppd-util.o \
71 pwg-media.o \
72 request.o \
73 sidechannel.o \
74 snmp.o \
75 snprintf.o \
76 string.o \
77 tempfile.o \
78 thread.o \
79 tls.o \
80 transcode.o \
81 usersys.o \
82 util.o
83 TESTOBJS = \
84 testadmin.o \
85 testarray.o \
86 testcache.o \
87 testconflicts.o \
88 testcups.o \
89 testdest.o \
90 testfile.o \
91 testhttp.o \
92 testi18n.o \
93 testipp.o \
94 testoptions.o \
95 testlang.o \
96 testppd.o \
97 testpwg.o \
98 testsnmp.o \
99 tlscheck.o
100 OBJS = \
101 $(LIBOBJS) \
102 $(TESTOBJS)
103
104
105 #
106 # Header files to install...
107 #
108
109 HEADERS = \
110 adminutil.h \
111 array.h \
112 backend.h \
113 cups.h \
114 dir.h \
115 file.h \
116 http.h \
117 ipp.h \
118 language.h \
119 ppd.h \
120 pwg.h \
121 raster.h \
122 sidechannel.h \
123 transcode.h \
124 versioning.h
125
126 HEADERSPRIV = \
127 array-private.h \
128 cups-private.h \
129 debug-private.h \
130 file-private.h \
131 http-private.h \
132 ipp-private.h \
133 language-private.h \
134 md5-private.h \
135 ppd-private.h \
136 pwg-private.h \
137 raster-private.h \
138 snmp-private.h \
139 string-private.h \
140 thread-private.h
141
142
143 #
144 # Targets in this directory...
145 #
146
147 LIBTARGETS = \
148 $(LIBCUPSSTATIC) \
149 $(LIBCUPS)
150
151 UNITTARGETS = \
152 testadmin \
153 testarray \
154 testcache \
155 testconflicts \
156 testcups \
157 testdest \
158 testfile \
159 testhttp \
160 testi18n \
161 testipp \
162 testlang \
163 testoptions \
164 testppd \
165 testpwg \
166 testsnmp \
167 tlscheck
168
169 TARGETS = \
170 $(LIBTARGETS)
171
172
173 #
174 # Make all targets...
175 #
176
177 all: $(TARGETS)
178
179
180 #
181 # Make library targets...
182 #
183
184 libs: $(LIBTARGETS)
185
186
187 #
188 # Make unit tests...
189 #
190
191 unittests: $(UNITTARGETS)
192
193
194 #
195 # Remove object and target files...
196 #
197
198 clean:
199 $(RM) $(OBJS) $(TARGETS) $(UNITTARGETS)
200 $(RM) libcups.so libcups.dylib
201
202
203 #
204 # Update dependencies (without system header dependencies...)
205 #
206
207 depend:
208 $(CC) -MM $(ALL_CFLAGS) $(OBJS:.o=.c) >Dependencies
209
210
211 #
212 # Run oclint to check code coverage...
213 #
214
215 oclint:
216 oclint -o=oclint.html -html $(LIBOBJS:.o=.c) -- $(ALL_CFLAGS)
217
218
219 #
220 # Install all targets...
221 #
222
223 install: all install-data install-headers install-libs install-exec
224
225
226 #
227 # Install data files...
228 #
229
230 install-data:
231
232
233 #
234 # Install programs...
235 #
236
237 install-exec:
238
239
240 #
241 # Install headers...
242 #
243
244 install-headers:
245 echo Installing header files into $(INCLUDEDIR)/cups...
246 $(INSTALL_DIR) -m 755 $(INCLUDEDIR)/cups
247 for file in $(HEADERS); do \
248 $(INSTALL_DATA) $$file $(INCLUDEDIR)/cups; \
249 done
250 if test "x$(privateinclude)" != x; then \
251 echo Installing private header files into $(PRIVATEINCLUDE)...; \
252 $(INSTALL_DIR) -m 755 $(PRIVATEINCLUDE); \
253 for file in $(HEADERSPRIV); do \
254 $(INSTALL_DATA) $$file $(PRIVATEINCLUDE)/$$file; \
255 done; \
256 fi
257
258
259 #
260 # Install libraries...
261 #
262
263 install-libs: $(INSTALLSTATIC)
264 echo Installing libraries in $(LIBDIR)...
265 $(INSTALL_DIR) -m 755 $(LIBDIR)
266 $(INSTALL_LIB) $(LIBCUPS) $(LIBDIR)
267 if test $(LIBCUPS) = "libcups.so.2"; then \
268 $(RM) $(LIBDIR)/`basename $(LIBCUPS) .2`; \
269 $(LN) $(LIBCUPS) $(LIBDIR)/`basename $(LIBCUPS) .2`; \
270 fi
271 if test $(LIBCUPS) = "libcups.2.dylib"; then \
272 $(RM) $(LIBDIR)/libcups.dylib; \
273 $(LN) $(LIBCUPS) $(LIBDIR)/libcups.dylib; \
274 fi
275 if test "x$(SYMROOT)" != "x"; then \
276 $(INSTALL_DIR) $(SYMROOT); \
277 cp $(LIBCUPS) $(SYMROOT); \
278 dsymutil $(SYMROOT)/$(LIBCUPS); \
279 fi
280
281 installstatic:
282 $(INSTALL_DIR) -m 755 $(LIBDIR)
283 $(INSTALL_LIB) -m 755 $(LIBCUPSSTATIC) $(LIBDIR)
284 $(RANLIB) $(LIBDIR)/$(LIBCUPSSTATIC)
285 $(CHMOD) 555 $(LIBDIR)/$(LIBCUPSSTATIC)
286
287
288 #
289 # Uninstall object and target files...
290 #
291
292 uninstall:
293 $(RM) $(LIBDIR)/libcups.2.dylib
294 $(RM) $(LIBDIR)/$(LIBCUPSSTATIC)
295 $(RM) $(LIBDIR)/libcups.dylib
296 $(RM) $(LIBDIR)/libcups.so
297 $(RM) $(LIBDIR)/libcups.so.2
298 -$(RMDIR) $(LIBDIR)
299 for file in $(HEADERS); do \
300 $(RM) $(INCLUDEDIR)/cups/$$file; \
301 done
302 -$(RMDIR) $(INCLUDEDIR)/cups
303
304
305 #
306 # libcups.so.2
307 #
308
309 libcups.so.2: $(LIBOBJS)
310 echo Linking $@...
311 $(DSO) $(ARCHFLAGS) $(DSOFLAGS) -o $@ $(LIBOBJS) $(LIBGSSAPI) \
312 $(SSLLIBS) $(DNSSDLIBS) $(COMMONLIBS) $(LIBZ)
313 $(RM) `basename $@ .2`
314 $(LN) $@ `basename $@ .2`
315
316
317 #
318 # libcups.2.dylib
319 #
320
321 libcups.2.dylib: $(LIBOBJS) $(LIBCUPSORDER)
322 echo Creating export list for $@...
323 nm -gm $(LIBOBJS) 2>/dev/null | grep "__text" | grep -v weak | \
324 awk '{print $$NF}' | \
325 grep -v -E -e '^(_cupsConnect|_cupsCharset|_cupsEncodingName|_cupsSetDefaults|_cupsSetHTTPError|_cupsUserDefault)$$' | \
326 sort >t.exp
327 echo Linking $@...
328 $(DSO) $(ARCHFLAGS) $(DSOFLAGS) -o $@ \
329 -install_name $(libdir)/$@ \
330 -current_version 2.12.0 \
331 -compatibility_version 2.0.0 \
332 -exported_symbols_list t.exp \
333 $(LIBOBJS) $(LIBGSSAPI) $(SSLLIBS) $(DNSSDLIBS) \
334 $(COMMONLIBS) $(LIBZ)
335 $(RM) libcups.dylib t.exp
336 $(LN) $@ libcups.dylib
337
338
339 #
340 # libcups.la
341 #
342
343 libcups.la: $(LIBOBJS)
344 echo Linking $@...
345 $(CC) $(ARCHFLAGS) $(DSOFLAGS) -o $@ $(LIBOBJS:.o=.lo) \
346 -rpath $(LIBDIR) -version-info 2:12 $(LIBGSSAPI) $(SSLLIBS) \
347 $(DNSSDLIBS) $(COMMONLIBS) $(LIBZ)
348
349
350 #
351 # libcups.a
352 #
353
354 libcups.a: $(LIBOBJS)
355 echo Archiving $@...
356 $(RM) $@
357 $(AR) $(ARFLAGS) $@ $(LIBOBJS)
358 $(RANLIB) $@
359
360
361 #
362 # libcups2.def (Windows DLL exports file...)
363 #
364
365 libcups2.def: $(LIBOBJS) Makefile
366 echo Generating $@...
367 echo "LIBRARY libcups2" >libcups2.def
368 echo "VERSION 2.11" >>libcups2.def
369 echo "EXPORTS" >>libcups2.def
370 (nm $(LIBOBJS) 2>/dev/null | grep "T _" | awk '{print $$3}'; \
371 echo __cups_strcpy; echo __cups_strlcat; echo __cups_strlcpy) | \
372 grep -v -E \
373 -e 'cups_debug|Apple|BackChannel|Backend|FileCheck|Filter|GSSService|SetNegotiate|SideChannel' \
374 -e 'Block$$' | \
375 sed -e '1,$$s/^_//' | sort >>libcups2.def
376
377
378 #
379 # testadmin (dependency on static CUPS library is intentional)
380 #
381
382 testadmin: testadmin.o $(LIBCUPSSTATIC)
383 echo Linking $@...
384 $(CC) $(LDFLAGS) -o $@ testadmin.o $(LIBCUPSSTATIC) \
385 $(LIBGSSAPI) $(SSLLIBS) $(DNSSDLIBS) $(COMMONLIBS) $(LIBZ)
386
387
388 #
389 # testarray (dependency on static CUPS library is intentional)
390 #
391
392 testarray: testarray.o $(LIBCUPSSTATIC)
393 echo Linking $@...
394 $(CC) $(ARCHFLAGS) $(LDFLAGS) -o $@ testarray.o $(LIBCUPSSTATIC) \
395 $(LIBGSSAPI) $(SSLLIBS) $(DNSSDLIBS) $(COMMONLIBS) $(LIBZ)
396 echo Running array API tests...
397 ./testarray
398
399
400 #
401 # testcache (dependency on static CUPS library is intentional)
402 #
403
404 testcache: testcache.o $(LIBCUPSSTATIC)
405 echo Linking $@...
406 $(CC) $(LDFLAGS) -o $@ testcache.o $(LIBCUPSSTATIC) \
407 $(LIBGSSAPI) $(SSLLIBS) $(DNSSDLIBS) $(COMMONLIBS) $(LIBZ)
408
409
410 #
411 # testconflicts (dependency on static CUPS library is intentional)
412 #
413
414 testconflicts: testconflicts.o $(LIBCUPSSTATIC)
415 echo Linking $@...
416 $(CC) $(LDFLAGS) -o $@ testconflicts.o $(LIBCUPSSTATIC) \
417 $(LIBGSSAPI) $(SSLLIBS) $(DNSSDLIBS) $(COMMONLIBS) $(LIBZ)
418
419
420 #
421 # testcups (dependency on static CUPS library is intentional)
422 #
423
424 testcups: testcups.o $(LIBCUPSSTATIC)
425 echo Linking $@...
426 $(CC) $(LDFLAGS) -o $@ testcups.o $(LIBCUPSSTATIC) \
427 $(LIBGSSAPI) $(SSLLIBS) $(DNSSDLIBS) $(COMMONLIBS) $(LIBZ)
428
429
430 #
431 # testdest (dependency on static CUPS library is intentional)
432 #
433
434 testdest: testdest.o $(LIBCUPSSTATIC)
435 echo Linking $@...
436 $(CC) $(LDFLAGS) -o $@ testdest.o $(LIBCUPSSTATIC) \
437 $(LIBGSSAPI) $(SSLLIBS) $(DNSSDLIBS) $(COMMONLIBS) $(LIBZ)
438
439
440 #
441 # testfile (dependency on static CUPS library is intentional)
442 #
443
444 testfile: testfile.o $(LIBCUPSSTATIC)
445 echo Linking $@...
446 $(CC) $(ARCHFLAGS) $(LDFLAGS) -o $@ testfile.o $(LIBCUPSSTATIC) \
447 $(LIBGSSAPI) $(SSLLIBS) $(DNSSDLIBS) $(COMMONLIBS) $(LIBZ)
448 echo Running file API tests...
449 ./testfile
450
451
452 #
453 # testhttp (dependency on static CUPS library is intentional)
454 #
455
456 testhttp: testhttp.o $(LIBCUPSSTATIC)
457 echo Linking $@...
458 $(CC) $(ARCHFLAGS) $(LDFLAGS) -o $@ testhttp.o $(LIBCUPSSTATIC) \
459 $(LIBGSSAPI) $(SSLLIBS) $(DNSSDLIBS) $(COMMONLIBS) $(LIBZ)
460 echo Running HTTP API tests...
461 ./testhttp
462
463
464 #
465 # testipp (dependency on static CUPS library is intentional)
466 #
467
468 testipp: testipp.o $(LIBCUPSSTATIC)
469 echo Linking $@...
470 $(CC) $(ARCHFLAGS) $(LDFLAGS) -o $@ testipp.o $(LIBCUPSSTATIC) \
471 $(LIBGSSAPI) $(SSLLIBS) $(DNSSDLIBS) $(COMMONLIBS) $(LIBZ)
472 echo Running IPP API tests...
473 ./testipp
474
475
476 #
477 # testi18n (dependency on static CUPS library is intentional)
478 #
479
480 testi18n: testi18n.o $(LIBCUPSSTATIC)
481 echo Linking $@...
482 $(CC) $(ARCHFLAGS) $(LDFLAGS) -o $@ testi18n.o $(LIBCUPSSTATIC) \
483 $(LIBGSSAPI) $(SSLLIBS) $(DNSSDLIBS) $(COMMONLIBS) $(LIBZ)
484 echo Running internationalization API tests...
485 ./testi18n
486
487
488 #
489 # testlang (dependency on static CUPS library is intentional)
490 #
491
492 testlang: testlang.o $(LIBCUPSSTATIC)
493 echo Linking $@...
494 $(CC) $(ARCHFLAGS) $(LDFLAGS) -o $@ testlang.o $(LIBCUPSSTATIC) \
495 $(LIBGSSAPI) $(SSLLIBS) $(DNSSDLIBS) $(COMMONLIBS) $(LIBZ)
496 echo Running language API tests...
497 ./testlang
498
499
500 #
501 # testoptions (dependency on static CUPS library is intentional)
502 #
503
504 testoptions: testoptions.o $(LIBCUPSSTATIC)
505 echo Linking $@...
506 $(CC) $(ARCHFLAGS) $(LDFLAGS) -o $@ testoptions.o $(LIBCUPSSTATIC) \
507 $(LIBGSSAPI) $(SSLLIBS) $(DNSSDLIBS) $(COMMONLIBS) $(LIBZ)
508 echo Running option API tests...
509 ./testoptions
510
511
512 #
513 # testppd (dependency on static CUPS library is intentional)
514 #
515
516 testppd: testppd.o $(LIBCUPSSTATIC) test.ppd test2.ppd
517 echo Linking $@...
518 $(CC) $(ARCHFLAGS) $(LDFLAGS) -o $@ testppd.o $(LIBCUPSSTATIC) \
519 $(LIBGSSAPI) $(SSLLIBS) $(DNSSDLIBS) $(COMMONLIBS) $(LIBZ)
520 echo Running PPD API tests...
521 ./testppd
522
523
524 #
525 # testpwg (dependency on static CUPS library is intentional)
526 #
527
528 testpwg: testpwg.o $(LIBCUPSSTATIC) test.ppd
529 echo Linking $@...
530 $(CC) $(ARCHFLAGS) $(LDFLAGS) -o $@ testpwg.o $(LIBCUPSSTATIC) \
531 $(LIBGSSAPI) $(SSLLIBS) $(DNSSDLIBS) $(COMMONLIBS) $(LIBZ)
532 echo Running PWG API tests...
533 ./testpwg test.ppd
534
535
536 #
537 # testsnmp (dependency on static CUPS library is intentional)
538 #
539
540 testsnmp: testsnmp.o $(LIBCUPSSTATIC)
541 echo Linking $@...
542 $(CC) $(LDFLAGS) -o $@ testsnmp.o $(LIBCUPSSTATIC) \
543 $(LIBGSSAPI) $(SSLLIBS) $(DNSSDLIBS) $(COMMONLIBS) $(LIBZ)
544
545
546 #
547 # tlscheck (dependency on static CUPS library is intentional)
548 #
549
550 tlscheck: tlscheck.o $(LIBCUPSSTATIC)
551 echo Linking $@...
552 $(CC) $(ARCHFLAGS) $(LDFLAGS) -o $@ tlscheck.o $(LIBCUPSSTATIC) \
553 $(LIBGSSAPI) $(SSLLIBS) $(DNSSDLIBS) $(COMMONLIBS) $(LIBZ)
554
555
556 #
557 # Automatic API help files...
558 #
559
560 apihelp:
561 echo Generating CUPS API help files...
562 mxmldoc --section "Programming" \
563 --title "Introduction to CUPS Programming" \
564 --css ../doc/cups-printable.css \
565 --header api-overview.header --intro api-overview.shtml \
566 >../doc/help/api-overview.html
567 mxmldoc --section "Programming" --title "Array API" \
568 --css ../doc/cups-printable.css \
569 --header api-array.header --intro api-array.shtml \
570 api-array.xml \
571 array.h array.c >../doc/help/api-array.html
572 mxmldoc --tokens help/api-array.html api-array.xml >../doc/help/api-array.tokens
573 $(RM) api-array.xml
574 mxmldoc --section "Programming" --title "CUPS API" \
575 --css ../doc/cups-printable.css \
576 --header api-cups.header --intro api-cups.shtml \
577 api-cups.xml \
578 cups.h pwg.h adminutil.c dest*.c language.c notify.c \
579 options.c pwg-media.c tempfile.c usersys.c \
580 util.c >../doc/help/api-cups.html
581 mxmldoc --tokens help/api-cups.html api-cups.xml >../doc/help/api-cups.tokens
582 $(RM) api-cups.xml
583 mxmldoc --section "Programming" --title "File and Directory APIs" \
584 --css ../doc/cups-printable.css \
585 --header api-filedir.header --intro api-filedir.shtml \
586 api-filedir.xml \
587 file.h file.c dir.h dir.c >../doc/help/api-filedir.html
588 mxmldoc --tokens api-filedir.xml >../doc/help/api-filedir.tokens
589 $(RM) api-filedir.xml
590 mxmldoc --section "Programming" --title "PPD API (DEPRECATED)" \
591 --css ../doc/cups-printable.css \
592 --header api-ppd.header --intro api-ppd.shtml \
593 api-ppd.xml ppd.h ppd-*.c >../doc/help/api-ppd.html
594 mxmldoc --tokens help/api-ppd.html api-ppd.xml >../doc/help/api-ppd.tokens
595 $(RM) api-ppd.xml
596 mxmldoc --section "Programming" --title "HTTP and IPP APIs" \
597 --css ../doc/cups-printable.css \
598 --header api-httpipp.header --intro api-httpipp.shtml \
599 api-httpipp.xml \
600 http.h ipp.h auth.c getdevices.c getputfile.c encode.c \
601 http.c http-addr.c http-support.c ipp.c ipp-support.c \
602 md5passwd.c request.c >../doc/help/api-httpipp.html
603 mxmldoc --tokens help/api-httpipp.html api-httpipp.xml >../doc/help/api-httpipp.tokens
604 $(RM) api-httpipp.xml
605 mxmldoc --section "Programming" \
606 --title "Filter and Backend Programming" \
607 --css ../doc/cups-printable.css \
608 --header api-filter.header --intro api-filter.shtml \
609 api-filter.xml \
610 backchannel.c backend.h backend.c sidechannel.c sidechannel.h \
611 >../doc/help/api-filter.html
612 mxmldoc --tokens help/api-filter.html api-filter.xml >../doc/help/api-filter.tokens
613 $(RM) api-filter.xml
614
615 framedhelp:
616 echo Generating CUPS API help files...
617 mxmldoc --framed api-overview \
618 --section "Programming" \
619 --title "Introduction to CUPS Programming" \
620 --css ../doc/cups-printable.css \
621 --header api-overview.header --intro api-overview.shtml
622 mxmldoc --framed api-array \
623 --section "Programming" --title "Array API" \
624 --css ../doc/cups-printable.css \
625 --header api-array.header --intro api-array.shtml \
626 array.h array.c
627 mxmldoc --framed api-cups \
628 --section "Programming" --title "CUPS API" \
629 --css ../doc/cups-printable.css \
630 --header api-cups.header --intro api-cups.shtml \
631 cups.h adminutil.c dest*.c language.c notify.c \
632 options.c tempfile.c usersys.c \
633 util.c
634 mxmldoc --framed api-filedir \
635 --section "Programming" --title "File and Directory APIs" \
636 --css ../doc/cups-printable.css \
637 --header api-filedir.header --intro api-filedir.shtml \
638 file.h file.c dir.h dir.c
639 mxmldoc --framed api-ppd \
640 --section "Programming" --title "PPD API (DEPRECATED)" \
641 --css ../doc/cups-printable.css \
642 --header api-ppd.header --intro api-ppd.shtml \
643 ppd.h attr.c conflicts.c custom.c emit.c localize.c mark.c \
644 page.c ppd.c
645 mxmldoc --framed api-httpipp \
646 --section "Programming" --title "HTTP and IPP APIs" \
647 --css ../doc/cups-printable.css \
648 --header api-httpipp.header --intro api-httpipp.shtml \
649 http.h ipp.h auth.c getdevices.c getputfile.c encode.c \
650 http.c http-addr.c http-support.c ipp.c ipp-support.c \
651 md5passwd.c request.c
652 mxmldoc --framed api-filter \
653 --section "Programming" \
654 --title "Filter and Backend Programming" \
655 --css ../doc/cups-printable.css \
656 --header api-filter.header --intro api-filter.shtml \
657 backchannel.c backend.h backend.c sidechannel.c sidechannel.h
658
659
660 #
661 # Lines of code computation...
662 #
663
664 sloc:
665 echo "libcupslite: \c"
666 sloccount $(LITEOBJS:.o=.c) 2>/dev/null | grep "Total Physical" | awk '{print $$9}'
667 echo "libcups: \c"
668 sloccount $(LIBOBJS:.o=.c) 2>/dev/null | grep "Total Physical" | awk '{print $$9}'
669
670
671 #
672 # Dependencies...
673 #
674
675 include Dependencies
676 tls.o: tls-darwin.c tls-gnutls.c tls-sspi.c