]> git.ipfire.org Git - thirdparty/cups.git/blob - cups/Makefile
Import changes from CUPS 1.4svn-r8704.
[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) -m 755 libcups.a $(LIBDIR)
241 $(RANLIB) $(LIBDIR)/libcups.a
242 $(CHMOD) 555 $(LIBDIR)/libcups.a
243
244 install32bit:
245 echo Installing libraries in $(LIB32DIR)...
246 $(INSTALL_DIR) -m 755 $(LIB32DIR)
247 $(INSTALL_LIB) 32bit/libcups.so.2 $(LIB32DIR)/libcups.so.2
248 $(LN) libcups.so.2 $(LIB32DIR)/libcups.so
249
250 install64bit:
251 echo Installing libraries in $(LIB64DIR)...
252 $(INSTALL_DIR) -m 755 $(LIB64DIR)
253 $(INSTALL_LIB) 64bit/libcups.so.2 $(LIB64DIR)/libcups.so.2
254 $(LN) libcups.so.2 $(LIB64DIR)/libcups.so
255
256
257 #
258 # Uninstall object and target files...
259 #
260
261 uninstall: $(UNINSTALL32) $(UNINSTALL64)
262 $(RM) $(LIBDIR)/libcups.2.dylib
263 $(RM) $(LIBDIR)/libcups.a
264 $(RM) $(LIBDIR)/libcups.dylib
265 $(RM) $(LIBDIR)/libcups_s.a
266 $(RM) $(LIBDIR)/libcups.sl
267 $(RM) $(LIBDIR)/libcups.sl.2
268 $(RM) $(LIBDIR)/libcups.so
269 $(RM) $(LIBDIR)/libcups.so.2
270 -$(RMDIR) $(LIBDIR)
271 for file in $(HEADERS); do \
272 $(RM) $(INCLUDEDIR)/cups/$$file; \
273 done
274 -$(RMDIR) $(INCLUDEDIR)/cups
275
276 uninstall32bit:
277 $(RM) $(LIB32DIR)/libcups.so
278 $(RM) $(LIB32DIR)/libcups.so.2
279 -$(RMDIR) $(LIB32DIR)
280
281 uninstall64bit:
282 $(RM) $(LIB64DIR)/libcups.so
283 $(RM) $(LIB64DIR)/libcups.so.2
284 -$(RMDIR) $(LIB64DIR)
285
286
287 #
288 # libcups.so.2, libcups.sl.2
289 #
290
291 libcups.so.2 libcups.sl.2: $(LIBOBJS)
292 echo Linking $@...
293 $(DSO) $(ARCHFLAGS) $(DSOFLAGS) -o $@ $(LIBOBJS) $(LIBGSSAPI) \
294 $(SSLLIBS) $(DNSSDLIBS) $(COMMONLIBS) $(LIBZ)
295 $(RM) `basename $@ .2`
296 $(LN) $@ `basename $@ .2`
297
298
299 #
300 # 32bit/libcups.so.2
301 #
302
303 32bit/libcups.so.2: $(LIB32OBJS)
304 echo Linking 32-bit $@...
305 -mkdir 32bit
306 $(DSO) $(ARCH32FLAGS) $(DSO32FLAGS) -o $@ $(LIB32OBJS) $(LIBGSSAPI) \
307 $(DNSSDLIBS) $(SSLLIBS) $(COMMONLIBS) $(LIBZ)
308 $(RM) 32bit/libcups.so
309 $(LN) libcups.so.2 32bit/libcups.so
310
311
312 #
313 # 64bit/libcups.so.2
314 #
315
316 64bit/libcups.so.2: $(LIB64OBJS)
317 echo Linking 64-bit $@...
318 -mkdir 64bit
319 $(DSO) $(ARCH64FLAGS) $(DSO64FLAGS) -o $@ $(LIB64OBJS) $(LIBGSSAPI) \
320 $(DNSSDLIBS) $(SSLLIBS) $(COMMONLIBS) $(LIBZ)
321 $(RM) 64bit/libcups.so
322 $(LN) libcups.so.2 64bit/libcups.so
323
324
325 #
326 # libcups.2.dylib
327 #
328
329 libcups.2.dylib: $(LIBOBJS) $(LIBCUPSORDER) libcups.exp
330 echo Linking $@...
331 $(DSO) $(ARCHFLAGS) $(DSOFLAGS) -o $@ \
332 -install_name $(libdir)/$@ \
333 -current_version 2.8.0 \
334 -compatibility_version 2.0.0 \
335 -exported_symbols_list libcups.exp \
336 -sectorder __TEXT __text $(LIBCUPSORDER) \
337 $(LIBOBJS) $(LIBGSSAPI) $(SSLLIBS) $(DNSSDLIBS) \
338 $(COMMONLIBS) $(LIBZ)
339 $(RM) libcups.dylib
340 $(LN) $@ libcups.dylib
341
342
343 #
344 # libcups_s.a
345 #
346
347 libcups_s.a: $(LIBOBJS) libcups_s.exp
348 echo Creating $@...
349 $(DSO) $(DSOFLAGS) -Wl,-bexport:libcups_s.exp -o libcups_s.o \
350 $(LIBOBJS) $(LIBGSSAPI) $(SSLLIBS) $(DNSSDLIBS) \
351 $(COMMONLIBS) $(LIBZ) -lm
352 $(RM) $@
353 $(AR) $(ARFLAGS) $@ libcups_s.o
354
355
356 #
357 # libcups.la
358 #
359
360 libcups.la: $(LIBOBJS)
361 echo Linking $@...
362 $(CC) $(ARCHFLAGS) $(DSOFLAGS) -o $@ $(LIBOBJS:.o=.lo) \
363 -rpath $(LIBDIR) -version-info 2:8 $(LIBGSSAPI) $(SSLLIBS) \
364 $(DNSSDLIBS) $(COMMONLIBS) $(LIBZ)
365
366
367 #
368 # libcups.a
369 #
370
371 libcups.a: $(LIBOBJS)
372 echo Archiving $@...
373 $(RM) $@
374 $(AR) $(ARFLAGS) $@ $(LIBOBJS)
375 $(RANLIB) $@
376
377
378 #
379 # CUPS language bindings for various scripting languages...
380 #
381 # NOTE: Not currently used or functional - see the scripting/php directory
382 # for the hand-written bindings...
383 #
384
385 phpcups.so: $(LIBCUPS) php_cups_wrap.o
386 echo Linking $@...
387 if test `uname` = Darwin; then \
388 DSOFLAGS="-bundle -flat_namespace -undefined suppress"; \
389 else \
390 DSOFLAGS="$(DSOFLAGS)"; \
391 fi; \
392 $(DSO) $$DSOFLAGS -o $@ php_cups_wrap.o $(LIBS) `php-config --ldflags --libs`
393
394 php_cups_wrap.o: php_cups_wrap.c
395 echo Compiling $<...
396 $(CC) $(CFLAGS) `php-config --includes` -c $<
397 php_cups_wrap.c: cups.h
398 echo Creating $< using SWIG...
399 swig -php -o $@ -module cups cups.h
400
401
402 #
403 # testadmin (dependency on static CUPS library is intentional)
404 #
405
406 testadmin: testadmin.o libcups.a
407 echo Linking $@...
408 $(CC) $(LDFLAGS) -o $@ testadmin.o libcups.a \
409 $(LIBGSSAPI) $(SSLLIBS) $(DNSSDLIBS) $(COMMONLIBS) $(LIBZ)
410
411
412 #
413 # testarray (dependency on static CUPS library is intentional)
414 #
415
416 testarray: testarray.o libcups.a
417 echo Linking $@...
418 $(CC) $(ARCHFLAGS) $(LDFLAGS) -o $@ testarray.o libcups.a \
419 $(LIBGSSAPI) $(SSLLIBS) $(DNSSDLIBS) $(COMMONLIBS) $(LIBZ)
420 echo Running array API tests...
421 ./testarray
422
423
424 #
425 # testconflicts (dependency on static CUPS library is intentional)
426 #
427
428 testconflicts: testconflicts.o libcups.a
429 echo Linking $@...
430 $(CC) $(LDFLAGS) -o $@ testconflicts.o libcups.a \
431 $(LIBGSSAPI) $(SSLLIBS) $(DNSSDLIBS) $(COMMONLIBS) $(LIBZ)
432
433
434 #
435 # testcups (dependency on static CUPS library is intentional)
436 #
437
438 testcups: testcups.o libcups.a
439 echo Linking $@...
440 $(CC) $(LDFLAGS) -o $@ testcups.o libcups.a \
441 $(LIBGSSAPI) $(SSLLIBS) $(DNSSDLIBS) $(COMMONLIBS) $(LIBZ)
442
443
444 #
445 # testfile (dependency on static CUPS library is intentional)
446 #
447
448 testfile: testfile.o libcups.a
449 echo Linking $@...
450 $(CC) $(ARCHFLAGS) $(LDFLAGS) -o $@ testfile.o libcups.a \
451 $(LIBGSSAPI) $(SSLLIBS) $(DNSSDLIBS) $(COMMONLIBS) $(LIBZ)
452 echo Running file API tests...
453 ./testfile
454
455
456 #
457 # testhttp (dependency on static CUPS library is intentional)
458 #
459
460 testhttp: testhttp.o libcups.a
461 echo Linking $@...
462 $(CC) $(ARCHFLAGS) $(LDFLAGS) -o $@ testhttp.o libcups.a \
463 $(LIBGSSAPI) $(SSLLIBS) $(DNSSDLIBS) $(COMMONLIBS) $(LIBZ)
464 echo Running HTTP API tests...
465 ./testhttp
466
467
468 #
469 # testipp (dependency on static CUPS library is intentional)
470 #
471
472 testipp: testipp.o libcups.a
473 echo Linking $@...
474 $(CC) $(ARCHFLAGS) $(LDFLAGS) -o $@ testipp.o libcups.a \
475 $(LIBGSSAPI) $(SSLLIBS) $(DNSSDLIBS) $(COMMONLIBS) $(LIBZ)
476 echo Running IPP API tests...
477 ./testipp
478
479
480 #
481 # testi18n (dependency on static CUPS library is intentional)
482 #
483
484 testi18n: testi18n.o libcups.a
485 echo Linking $@...
486 $(CC) $(ARCHFLAGS) $(LDFLAGS) -o $@ testi18n.o libcups.a \
487 $(LIBGSSAPI) $(SSLLIBS) $(DNSSDLIBS) $(COMMONLIBS) $(LIBZ)
488 echo Running internationalization API tests...
489 ./testi18n
490
491
492 #
493 # testlang (dependency on static CUPS library is intentional)
494 #
495
496 testlang: testlang.o libcups.a
497 echo Linking $@...
498 $(CC) $(ARCHFLAGS) $(LDFLAGS) -o $@ testlang.o libcups.a \
499 $(LIBGSSAPI) $(SSLLIBS) $(DNSSDLIBS) $(COMMONLIBS) $(LIBZ)
500 echo Running language API tests...
501 ./testlang
502
503
504 #
505 # testoptions (dependency on static CUPS library is intentional)
506 #
507
508 testoptions: testoptions.o libcups.a
509 echo Linking $@...
510 $(CC) $(ARCHFLAGS) $(LDFLAGS) -o $@ testoptions.o libcups.a \
511 $(LIBGSSAPI) $(SSLLIBS) $(DNSSDLIBS) $(COMMONLIBS) $(LIBZ)
512 echo Running option API tests...
513 ./testoptions
514
515
516 #
517 # testppd (dependency on static CUPS library is intentional)
518 #
519
520 testppd: testppd.o libcups.a test.ppd test2.ppd
521 echo Linking $@...
522 $(CC) $(ARCHFLAGS) $(LDFLAGS) -o $@ testppd.o libcups.a \
523 $(LIBGSSAPI) $(SSLLIBS) $(DNSSDLIBS) $(COMMONLIBS) $(LIBZ)
524 echo Running PPD API tests...
525 ./testppd
526
527
528 #
529 # testsnmp (dependency on static CUPS library is intentional)
530 #
531
532 testsnmp: testsnmp.o libcups.a
533 echo Linking $@...
534 $(CC) $(LDFLAGS) -o $@ testsnmp.o libcups.a \
535 $(LIBGSSAPI) $(SSLLIBS) $(DNSSDLIBS) $(COMMONLIBS) $(LIBZ)
536
537
538 #
539 # Automatic API help files...
540 #
541
542 apihelp:
543 echo Generating CUPS API help files...
544 mxmldoc --section "Programming" \
545 --title "Introduction to CUPS Programming" \
546 --css ../doc/cups-printable.css \
547 --header api-overview.header --intro api-overview.shtml \
548 >../doc/help/api-overview.html
549 mxmldoc --section "Programming" --title "Array API" \
550 --css ../doc/cups-printable.css \
551 --header api-array.header --intro api-array.shtml \
552 api-array.xml \
553 array.h array.c >../doc/help/api-array.html
554 mxmldoc --tokens help/api-array.html api-array.xml >../doc/help/api-array.tokens
555 $(RM) api-array.xml
556 mxmldoc --section "Programming" --title "CUPS API" \
557 --css ../doc/cups-printable.css \
558 --header api-cups.header --intro api-cups.shtml \
559 api-cups.xml \
560 cups.h adminutil.c dest.c language.c notify.c \
561 options.c tempfile.c usersys.c \
562 util.c >../doc/help/api-cups.html
563 mxmldoc --tokens help/api-cups.html api-cups.xml >../doc/help/api-cups.tokens
564 $(RM) api-cups.xml
565 mxmldoc --section "Programming" --title "File and Directory APIs" \
566 --css ../doc/cups-printable.css \
567 --header api-filedir.header --intro api-filedir.shtml \
568 api-filedir.xml \
569 file.h file.c dir.h dir.c >../doc/help/api-filedir.html
570 mxmldoc --tokens api-filedir.xml >../doc/help/api-filedir.tokens
571 $(RM) api-filedir.xml
572 mxmldoc --section "Programming" --title "PPD API" \
573 --css ../doc/cups-printable.css \
574 --header api-ppd.header --intro api-ppd.shtml \
575 api-ppd.xml \
576 ppd.h attr.c conflicts.c custom.c emit.c localize.c mark.c page.c \
577 ppd.c >../doc/help/api-ppd.html
578 mxmldoc --tokens help/api-ppd.html api-ppd.xml >../doc/help/api-ppd.tokens
579 $(RM) api-ppd.xml
580 mxmldoc --section "Programming" --title "HTTP and IPP APIs" \
581 --css ../doc/cups-printable.css \
582 --header api-httpipp.header --intro api-httpipp.shtml \
583 api-httpipp.xml \
584 http.h ipp.h auth.c getdevices.c getputfile.c encode.c \
585 http.c http-addr.c http-support.c ipp.c ipp-support.c \
586 md5passwd.c request.c >../doc/help/api-httpipp.html
587 mxmldoc --tokens help/api-httpipp.html api-httpipp.xml >../doc/help/api-httpipp.tokens
588 $(RM) api-httpipp.xml
589 mxmldoc --section "Programming" \
590 --title "Filter and Backend Programming" \
591 --css ../doc/cups-printable.css \
592 --header api-filter.header --intro api-filter.shtml \
593 api-filter.xml \
594 backchannel.c backend.h backend.c sidechannel.c sidechannel.h \
595 >../doc/help/api-filter.html
596 mxmldoc --tokens help/api-filter.html api-filter.xml >../doc/help/api-filter.tokens
597 $(RM) api-filter.xml
598
599 framedhelp:
600 echo Generating CUPS API help files...
601 mxmldoc --framed api-overview \
602 --section "Programming" \
603 --title "Introduction to CUPS Programming" \
604 --css ../doc/cups-printable.css \
605 --header api-overview.header --intro api-overview.shtml
606 mxmldoc --framed api-array \
607 --section "Programming" --title "Array API" \
608 --css ../doc/cups-printable.css \
609 --header api-array.header --intro api-array.shtml \
610 array.h array.c
611 mxmldoc --framed api-cups \
612 --section "Programming" --title "CUPS API" \
613 --css ../doc/cups-printable.css \
614 --header api-cups.header --intro api-cups.shtml \
615 cups.h adminutil.c dest.c language.c notify.c \
616 options.c tempfile.c usersys.c \
617 util.c
618 mxmldoc --framed api-filedir \
619 --section "Programming" --title "File and Directory APIs" \
620 --css ../doc/cups-printable.css \
621 --header api-filedir.header --intro api-filedir.shtml \
622 file.h file.c dir.h dir.c
623 mxmldoc --framed api-ppd \
624 --section "Programming" --title "PPD API" \
625 --css ../doc/cups-printable.css \
626 --header api-ppd.header --intro api-ppd.shtml \
627 ppd.h attr.c conflicts.c custom.c emit.c localize.c mark.c \
628 page.c ppd.c
629 mxmldoc --framed api-httpipp \
630 --section "Programming" --title "HTTP and IPP APIs" \
631 --css ../doc/cups-printable.css \
632 --header api-httpipp.header --intro api-httpipp.shtml \
633 http.h ipp.h auth.c getdevices.c getputfile.c encode.c \
634 http.c http-addr.c http-support.c ipp.c ipp-support.c \
635 md5passwd.c request.c
636 mxmldoc --framed api-filter \
637 --section "Programming" \
638 --title "Filter and Backend Programming" \
639 --css ../doc/cups-printable.css \
640 --header api-filter.header --intro api-filter.shtml \
641 backchannel.c backend.h backend.c sidechannel.c sidechannel.h
642
643
644 #
645 # Dependencies...
646 #
647
648 include Dependencies
649
650
651 #
652 # End of "$Id: Makefile 7871 2008-08-27 21:12:43Z mike $".
653 #