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