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