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