]> git.ipfire.org Git - thirdparty/cups.git/blob - cups/Makefile
Merge changes from CUPS 1.7svn-r10629.
[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 fi
255
256 installstatic:
257 $(INSTALL_DIR) -m 755 $(LIBDIR)
258 $(INSTALL_LIB) -m 755 $(LIBCUPSSTATIC) $(LIBDIR)
259 $(RANLIB) $(LIBDIR)/$(LIBCUPSSTATIC)
260 $(CHMOD) 555 $(LIBDIR)/$(LIBCUPSSTATIC)
261
262
263 #
264 # Uninstall object and target files...
265 #
266
267 uninstall:
268 $(RM) $(LIBDIR)/libcups.2.dylib
269 $(RM) $(LIBDIR)/$(LIBCUPSSTATIC)
270 $(RM) $(LIBDIR)/libcups.dylib
271 $(RM) $(LIBDIR)/libcups_s.a
272 $(RM) $(LIBDIR)/libcups.sl
273 $(RM) $(LIBDIR)/libcups.sl.2
274 $(RM) $(LIBDIR)/libcups.so
275 $(RM) $(LIBDIR)/libcups.so.2
276 -$(RMDIR) $(LIBDIR)
277 for file in $(HEADERS); do \
278 $(RM) $(INCLUDEDIR)/cups/$$file; \
279 done
280 -$(RMDIR) $(INCLUDEDIR)/cups
281
282
283 #
284 # libcups.so.2, libcups.sl.2
285 #
286
287 libcups.so.2 libcups.sl.2: $(LIBOBJS)
288 echo Linking $@...
289 $(DSO) $(ARCHFLAGS) $(DSOFLAGS) -o $@ $(LIBOBJS) $(LIBGSSAPI) \
290 $(SSLLIBS) $(DNSSDLIBS) $(COMMONLIBS) $(LIBZ)
291 $(RM) `basename $@ .2`
292 $(LN) $@ `basename $@ .2`
293
294
295 #
296 # libcups.2.dylib
297 #
298
299 libcups.2.dylib: $(LIBOBJS) $(LIBCUPSORDER)
300 echo Creating export list for $@...
301 nm $(LIBOBJS) 2>/dev/null | grep "T _" | awk '{print $$3}' | \
302 grep -v -e '^(_cupsConnect|_cupsCharset|_cupsEncodingName|_cupsSetDefaults|_cupsSetHTTPError|_cupsUserDefault|_httpWait)$$' | \
303 sort >t.exp
304 echo Linking $@...
305 $(DSO) $(ARCHFLAGS) $(DSOFLAGS) -o $@ \
306 -install_name $(libdir)/$@ \
307 -current_version 2.10.0 \
308 -compatibility_version 2.0.0 \
309 -exported_symbols_list t.exp \
310 $(LIBOBJS) $(LIBGSSAPI) $(SSLLIBS) $(DNSSDLIBS) \
311 $(COMMONLIBS) $(LIBZ)
312 $(RM) libcups.dylib t.exp
313 $(LN) $@ libcups.dylib
314
315
316 #
317 # libcups_s.a
318 #
319
320 libcups_s.a: $(LIBOBJS) libcups_s.exp
321 echo Creating $@...
322 $(DSO) $(DSOFLAGS) -Wl,-bexport:libcups_s.exp -o libcups_s.o \
323 $(LIBOBJS) $(LIBGSSAPI) $(SSLLIBS) $(DNSSDLIBS) \
324 $(COMMONLIBS) $(LIBZ)
325 $(RM) $@
326 $(AR) $(ARFLAGS) $@ libcups_s.o
327
328
329 #
330 # libcups.la
331 #
332
333 libcups.la: $(LIBOBJS)
334 echo Linking $@...
335 $(CC) $(ARCHFLAGS) $(DSOFLAGS) -o $@ $(LIBOBJS:.o=.lo) \
336 -rpath $(LIBDIR) -version-info 2:10 $(LIBGSSAPI) $(SSLLIBS) \
337 $(DNSSDLIBS) $(COMMONLIBS) $(LIBZ)
338
339
340 #
341 # libcups.a
342 #
343
344 libcups.a: $(LIBOBJS)
345 echo Archiving $@...
346 $(RM) $@
347 $(AR) $(ARFLAGS) $@ $(LIBOBJS)
348 $(RANLIB) $@
349
350
351 #
352 # testadmin (dependency on static CUPS library is intentional)
353 #
354
355 testadmin: testadmin.o $(LIBCUPSSTATIC)
356 echo Linking $@...
357 $(CC) $(LDFLAGS) -o $@ testadmin.o $(LIBCUPSSTATIC) \
358 $(LIBGSSAPI) $(SSLLIBS) $(DNSSDLIBS) $(COMMONLIBS) $(LIBZ)
359
360
361 #
362 # testarray (dependency on static CUPS library is intentional)
363 #
364
365 testarray: testarray.o $(LIBCUPSSTATIC)
366 echo Linking $@...
367 $(CC) $(ARCHFLAGS) $(LDFLAGS) -o $@ testarray.o $(LIBCUPSSTATIC) \
368 $(LIBGSSAPI) $(SSLLIBS) $(DNSSDLIBS) $(COMMONLIBS) $(LIBZ)
369 echo Running array API tests...
370 ./testarray
371
372
373 #
374 # testconflicts (dependency on static CUPS library is intentional)
375 #
376
377 testconflicts: testconflicts.o $(LIBCUPSSTATIC)
378 echo Linking $@...
379 $(CC) $(LDFLAGS) -o $@ testconflicts.o $(LIBCUPSSTATIC) \
380 $(LIBGSSAPI) $(SSLLIBS) $(DNSSDLIBS) $(COMMONLIBS) $(LIBZ)
381
382
383 #
384 # testcups (dependency on static CUPS library is intentional)
385 #
386
387 testcups: testcups.o $(LIBCUPSSTATIC)
388 echo Linking $@...
389 $(CC) $(LDFLAGS) -o $@ testcups.o $(LIBCUPSSTATIC) \
390 $(LIBGSSAPI) $(SSLLIBS) $(DNSSDLIBS) $(COMMONLIBS) $(LIBZ)
391
392
393 #
394 # testfile (dependency on static CUPS library is intentional)
395 #
396
397 testfile: testfile.o $(LIBCUPSSTATIC)
398 echo Linking $@...
399 $(CC) $(ARCHFLAGS) $(LDFLAGS) -o $@ testfile.o $(LIBCUPSSTATIC) \
400 $(LIBGSSAPI) $(SSLLIBS) $(DNSSDLIBS) $(COMMONLIBS) $(LIBZ)
401 echo Running file API tests...
402 ./testfile
403
404
405 #
406 # testhttp (dependency on static CUPS library is intentional)
407 #
408
409 testhttp: testhttp.o $(LIBCUPSSTATIC)
410 echo Linking $@...
411 $(CC) $(ARCHFLAGS) $(LDFLAGS) -o $@ testhttp.o $(LIBCUPSSTATIC) \
412 $(LIBGSSAPI) $(SSLLIBS) $(DNSSDLIBS) $(COMMONLIBS) $(LIBZ)
413 echo Running HTTP API tests...
414 ./testhttp
415
416
417 #
418 # testipp (dependency on static CUPS library is intentional)
419 #
420
421 testipp: testipp.o $(LIBCUPSSTATIC)
422 echo Linking $@...
423 $(CC) $(ARCHFLAGS) $(LDFLAGS) -o $@ testipp.o $(LIBCUPSSTATIC) \
424 $(LIBGSSAPI) $(SSLLIBS) $(DNSSDLIBS) $(COMMONLIBS) $(LIBZ)
425 echo Running IPP API tests...
426 ./testipp
427
428
429 #
430 # testi18n (dependency on static CUPS library is intentional)
431 #
432
433 testi18n: testi18n.o $(LIBCUPSSTATIC)
434 echo Linking $@...
435 $(CC) $(ARCHFLAGS) $(LDFLAGS) -o $@ testi18n.o $(LIBCUPSSTATIC) \
436 $(LIBGSSAPI) $(SSLLIBS) $(DNSSDLIBS) $(COMMONLIBS) $(LIBZ)
437 echo Running internationalization API tests...
438 ./testi18n
439
440
441 #
442 # testlang (dependency on static CUPS library is intentional)
443 #
444
445 testlang: testlang.o $(LIBCUPSSTATIC)
446 echo Linking $@...
447 $(CC) $(ARCHFLAGS) $(LDFLAGS) -o $@ testlang.o $(LIBCUPSSTATIC) \
448 $(LIBGSSAPI) $(SSLLIBS) $(DNSSDLIBS) $(COMMONLIBS) $(LIBZ)
449 echo Running language API tests...
450 ./testlang
451
452
453 #
454 # testoptions (dependency on static CUPS library is intentional)
455 #
456
457 testoptions: testoptions.o $(LIBCUPSSTATIC)
458 echo Linking $@...
459 $(CC) $(ARCHFLAGS) $(LDFLAGS) -o $@ testoptions.o $(LIBCUPSSTATIC) \
460 $(LIBGSSAPI) $(SSLLIBS) $(DNSSDLIBS) $(COMMONLIBS) $(LIBZ)
461 echo Running option API tests...
462 ./testoptions
463
464
465 #
466 # testppd (dependency on static CUPS library is intentional)
467 #
468
469 testppd: testppd.o $(LIBCUPSSTATIC) test.ppd test2.ppd
470 echo Linking $@...
471 $(CC) $(ARCHFLAGS) $(LDFLAGS) -o $@ testppd.o $(LIBCUPSSTATIC) \
472 $(LIBGSSAPI) $(SSLLIBS) $(DNSSDLIBS) $(COMMONLIBS) $(LIBZ)
473 echo Running PPD API tests...
474 ./testppd
475
476
477 #
478 # testpwg (dependency on static CUPS library is intentional)
479 #
480
481 testpwg: testpwg.o $(LIBCUPSSTATIC) test.ppd
482 echo Linking $@...
483 $(CC) $(ARCHFLAGS) $(LDFLAGS) -o $@ testpwg.o $(LIBCUPSSTATIC) \
484 $(LIBGSSAPI) $(SSLLIBS) $(DNSSDLIBS) $(COMMONLIBS) $(LIBZ)
485 echo Running PWG API tests...
486 ./testpwg test.ppd
487
488
489 #
490 # testsnmp (dependency on static CUPS library is intentional)
491 #
492
493 testsnmp: testsnmp.o $(LIBCUPSSTATIC)
494 echo Linking $@...
495 $(CC) $(LDFLAGS) -o $@ testsnmp.o $(LIBCUPSSTATIC) \
496 $(LIBGSSAPI) $(SSLLIBS) $(DNSSDLIBS) $(COMMONLIBS) $(LIBZ)
497
498
499 #
500 # Automatic API help files...
501 #
502
503 apihelp:
504 echo Generating CUPS API help files...
505 mxmldoc --section "Programming" \
506 --title "Introduction to CUPS Programming" \
507 --css ../doc/cups-printable.css \
508 --header api-overview.header --intro api-overview.shtml \
509 >../doc/help/api-overview.html
510 mxmldoc --section "Programming" --title "Array API" \
511 --css ../doc/cups-printable.css \
512 --header api-array.header --intro api-array.shtml \
513 api-array.xml \
514 array.h array.c >../doc/help/api-array.html
515 mxmldoc --tokens help/api-array.html api-array.xml >../doc/help/api-array.tokens
516 $(RM) api-array.xml
517 mxmldoc --section "Programming" --title "CUPS API" \
518 --css ../doc/cups-printable.css \
519 --header api-cups.header --intro api-cups.shtml \
520 api-cups.xml \
521 cups.h adminutil.c dest*.c language.c notify.c \
522 options.c tempfile.c usersys.c \
523 util.c >../doc/help/api-cups.html
524 mxmldoc --tokens help/api-cups.html api-cups.xml >../doc/help/api-cups.tokens
525 $(RM) api-cups.xml
526 mxmldoc --section "Programming" --title "File and Directory APIs" \
527 --css ../doc/cups-printable.css \
528 --header api-filedir.header --intro api-filedir.shtml \
529 api-filedir.xml \
530 file.h file.c dir.h dir.c >../doc/help/api-filedir.html
531 mxmldoc --tokens api-filedir.xml >../doc/help/api-filedir.tokens
532 $(RM) api-filedir.xml
533 mxmldoc --section "Programming" --title "PPD API (DEPRECATED)" \
534 --css ../doc/cups-printable.css \
535 --header api-ppd.header --intro api-ppd.shtml \
536 api-ppd.xml \
537 ppd.h attr.c conflicts.c custom.c emit.c localize.c mark.c page.c \
538 ppd.c >../doc/help/api-ppd.html
539 mxmldoc --tokens help/api-ppd.html api-ppd.xml >../doc/help/api-ppd.tokens
540 $(RM) api-ppd.xml
541 mxmldoc --section "Programming" --title "HTTP and IPP APIs" \
542 --css ../doc/cups-printable.css \
543 --header api-httpipp.header --intro api-httpipp.shtml \
544 api-httpipp.xml \
545 http.h ipp.h auth.c getdevices.c getputfile.c encode.c \
546 http.c http-addr.c http-support.c ipp.c ipp-support.c \
547 md5passwd.c request.c >../doc/help/api-httpipp.html
548 mxmldoc --tokens help/api-httpipp.html api-httpipp.xml >../doc/help/api-httpipp.tokens
549 $(RM) api-httpipp.xml
550 mxmldoc --section "Programming" \
551 --title "Filter and Backend Programming" \
552 --css ../doc/cups-printable.css \
553 --header api-filter.header --intro api-filter.shtml \
554 api-filter.xml \
555 backchannel.c backend.h backend.c sidechannel.c sidechannel.h \
556 >../doc/help/api-filter.html
557 mxmldoc --tokens help/api-filter.html api-filter.xml >../doc/help/api-filter.tokens
558 $(RM) api-filter.xml
559
560 framedhelp:
561 echo Generating CUPS API help files...
562 mxmldoc --framed api-overview \
563 --section "Programming" \
564 --title "Introduction to CUPS Programming" \
565 --css ../doc/cups-printable.css \
566 --header api-overview.header --intro api-overview.shtml
567 mxmldoc --framed api-array \
568 --section "Programming" --title "Array API" \
569 --css ../doc/cups-printable.css \
570 --header api-array.header --intro api-array.shtml \
571 array.h array.c
572 mxmldoc --framed api-cups \
573 --section "Programming" --title "CUPS API" \
574 --css ../doc/cups-printable.css \
575 --header api-cups.header --intro api-cups.shtml \
576 cups.h adminutil.c dest*.c language.c notify.c \
577 options.c tempfile.c usersys.c \
578 util.c
579 mxmldoc --framed api-filedir \
580 --section "Programming" --title "File and Directory APIs" \
581 --css ../doc/cups-printable.css \
582 --header api-filedir.header --intro api-filedir.shtml \
583 file.h file.c dir.h dir.c
584 mxmldoc --framed api-ppd \
585 --section "Programming" --title "PPD API (DEPRECATED)" \
586 --css ../doc/cups-printable.css \
587 --header api-ppd.header --intro api-ppd.shtml \
588 ppd.h attr.c conflicts.c custom.c emit.c localize.c mark.c \
589 page.c ppd.c
590 mxmldoc --framed api-httpipp \
591 --section "Programming" --title "HTTP and IPP APIs" \
592 --css ../doc/cups-printable.css \
593 --header api-httpipp.header --intro api-httpipp.shtml \
594 http.h ipp.h auth.c getdevices.c getputfile.c encode.c \
595 http.c http-addr.c http-support.c ipp.c ipp-support.c \
596 md5passwd.c request.c
597 mxmldoc --framed api-filter \
598 --section "Programming" \
599 --title "Filter and Backend Programming" \
600 --css ../doc/cups-printable.css \
601 --header api-filter.header --intro api-filter.shtml \
602 backchannel.c backend.h backend.c sidechannel.c sidechannel.h
603
604
605 #
606 # Lines of code computation...
607 #
608
609 sloc:
610 echo "libcupslite: \c"
611 sloccount $(LITEOBJS:.o=.c) 2>/dev/null | grep "Total Physical" | awk '{print $$9}'
612 echo "libcups: \c"
613 sloccount $(LIBOBJS:.o=.c) 2>/dev/null | grep "Total Physical" | awk '{print $$9}'
614
615
616 #
617 # Dependencies...
618 #
619
620 include Dependencies
621
622
623 #
624 # End of "$Id: Makefile 7871 2008-08-27 21:12:43Z mike $".
625 #