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