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