]> git.ipfire.org Git - thirdparty/cups.git/blob - cups/Makefile
Merge changes from CUPS 1.5svn-r9000.
[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-2010 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 $(LIBCUPSSTATIC) \
117 $(LIBCUPS) \
118 $(LIB32CUPS) \
119 $(LIB64CUPS)
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 $(LIBCUPSSTATIC) $(LIBDIR)
241 $(RANLIB) $(LIBDIR)/$(LIBCUPSSTATIC)
242 $(CHMOD) 555 $(LIBDIR)/$(LIBCUPSSTATIC)
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)
330 echo Creating export list for $@...
331 nm $(LIBOBJS) 2>/dev/null | grep "T _" | awk '{print $$3}' | \
332 grep -v -e '^(_cupsConnect|_cupsSetDefaults|_cupsSetHTTPError|_cupsUserDefault|_httpWait)$$' | \
333 sort >t.exp
334 echo Linking $@...
335 $(DSO) $(ARCHFLAGS) $(DSOFLAGS) -o $@ \
336 -install_name $(libdir)/$@ \
337 -current_version 2.8.0 \
338 -compatibility_version 2.0.0 \
339 -exported_symbols_list t.exp \
340 -sectorder __TEXT __text $(LIBCUPSORDER) \
341 $(LIBOBJS) $(LIBGSSAPI) $(SSLLIBS) $(DNSSDLIBS) \
342 $(COMMONLIBS) $(LIBZ)
343 $(RM) libcups.dylib t.exp
344 $(LN) $@ libcups.dylib
345
346
347 #
348 # libcups_s.a
349 #
350
351 libcups_s.a: $(LIBOBJS) libcups_s.exp
352 echo Creating $@...
353 $(DSO) $(DSOFLAGS) -Wl,-bexport:libcups_s.exp -o libcups_s.o \
354 $(LIBOBJS) $(LIBGSSAPI) $(SSLLIBS) $(DNSSDLIBS) \
355 $(COMMONLIBS) $(LIBZ) -lm
356 $(RM) $@
357 $(AR) $(ARFLAGS) $@ libcups_s.o
358
359
360 #
361 # libcups.la
362 #
363
364 libcups.la: $(LIBOBJS)
365 echo Linking $@...
366 $(CC) $(ARCHFLAGS) $(DSOFLAGS) -o $@ $(LIBOBJS:.o=.lo) \
367 -rpath $(LIBDIR) -version-info 2:8 $(LIBGSSAPI) $(SSLLIBS) \
368 $(DNSSDLIBS) $(COMMONLIBS) $(LIBZ)
369
370
371 #
372 # libcups.a
373 #
374
375 libcups.a: $(LIBOBJS)
376 echo Archiving $@...
377 $(RM) $@
378 $(AR) $(ARFLAGS) $@ $(LIBOBJS)
379 $(RANLIB) $@
380
381
382 #
383 # testadmin (dependency on static CUPS library is intentional)
384 #
385
386 testadmin: testadmin.o $(LIBCUPSSTATIC)
387 echo Linking $@...
388 $(CC) $(LDFLAGS) -o $@ testadmin.o $(LIBCUPSSTATIC) \
389 $(LIBGSSAPI) $(SSLLIBS) $(DNSSDLIBS) $(COMMONLIBS) $(LIBZ)
390
391
392 #
393 # testarray (dependency on static CUPS library is intentional)
394 #
395
396 testarray: testarray.o $(LIBCUPSSTATIC)
397 echo Linking $@...
398 $(CC) $(ARCHFLAGS) $(LDFLAGS) -o $@ testarray.o $(LIBCUPSSTATIC) \
399 $(LIBGSSAPI) $(SSLLIBS) $(DNSSDLIBS) $(COMMONLIBS) $(LIBZ)
400 echo Running array API tests...
401 ./testarray
402
403
404 #
405 # testconflicts (dependency on static CUPS library is intentional)
406 #
407
408 testconflicts: testconflicts.o $(LIBCUPSSTATIC)
409 echo Linking $@...
410 $(CC) $(LDFLAGS) -o $@ testconflicts.o $(LIBCUPSSTATIC) \
411 $(LIBGSSAPI) $(SSLLIBS) $(DNSSDLIBS) $(COMMONLIBS) $(LIBZ)
412
413
414 #
415 # testcups (dependency on static CUPS library is intentional)
416 #
417
418 testcups: testcups.o $(LIBCUPSSTATIC)
419 echo Linking $@...
420 $(CC) $(LDFLAGS) -o $@ testcups.o $(LIBCUPSSTATIC) \
421 $(LIBGSSAPI) $(SSLLIBS) $(DNSSDLIBS) $(COMMONLIBS) $(LIBZ)
422
423
424 #
425 # testfile (dependency on static CUPS library is intentional)
426 #
427
428 testfile: testfile.o $(LIBCUPSSTATIC)
429 echo Linking $@...
430 $(CC) $(ARCHFLAGS) $(LDFLAGS) -o $@ testfile.o $(LIBCUPSSTATIC) \
431 $(LIBGSSAPI) $(SSLLIBS) $(DNSSDLIBS) $(COMMONLIBS) $(LIBZ)
432 echo Running file API tests...
433 ./testfile
434
435
436 #
437 # testhttp (dependency on static CUPS library is intentional)
438 #
439
440 testhttp: testhttp.o $(LIBCUPSSTATIC)
441 echo Linking $@...
442 $(CC) $(ARCHFLAGS) $(LDFLAGS) -o $@ testhttp.o $(LIBCUPSSTATIC) \
443 $(LIBGSSAPI) $(SSLLIBS) $(DNSSDLIBS) $(COMMONLIBS) $(LIBZ)
444 echo Running HTTP API tests...
445 ./testhttp
446
447
448 #
449 # testipp (dependency on static CUPS library is intentional)
450 #
451
452 testipp: testipp.o $(LIBCUPSSTATIC)
453 echo Linking $@...
454 $(CC) $(ARCHFLAGS) $(LDFLAGS) -o $@ testipp.o $(LIBCUPSSTATIC) \
455 $(LIBGSSAPI) $(SSLLIBS) $(DNSSDLIBS) $(COMMONLIBS) $(LIBZ)
456 echo Running IPP API tests...
457 ./testipp
458
459
460 #
461 # testi18n (dependency on static CUPS library is intentional)
462 #
463
464 testi18n: testi18n.o $(LIBCUPSSTATIC)
465 echo Linking $@...
466 $(CC) $(ARCHFLAGS) $(LDFLAGS) -o $@ testi18n.o $(LIBCUPSSTATIC) \
467 $(LIBGSSAPI) $(SSLLIBS) $(DNSSDLIBS) $(COMMONLIBS) $(LIBZ)
468 echo Running internationalization API tests...
469 ./testi18n
470
471
472 #
473 # testlang (dependency on static CUPS library is intentional)
474 #
475
476 testlang: testlang.o $(LIBCUPSSTATIC)
477 echo Linking $@...
478 $(CC) $(ARCHFLAGS) $(LDFLAGS) -o $@ testlang.o $(LIBCUPSSTATIC) \
479 $(LIBGSSAPI) $(SSLLIBS) $(DNSSDLIBS) $(COMMONLIBS) $(LIBZ)
480 echo Running language API tests...
481 ./testlang
482
483
484 #
485 # testoptions (dependency on static CUPS library is intentional)
486 #
487
488 testoptions: testoptions.o $(LIBCUPSSTATIC)
489 echo Linking $@...
490 $(CC) $(ARCHFLAGS) $(LDFLAGS) -o $@ testoptions.o $(LIBCUPSSTATIC) \
491 $(LIBGSSAPI) $(SSLLIBS) $(DNSSDLIBS) $(COMMONLIBS) $(LIBZ)
492 echo Running option API tests...
493 ./testoptions
494
495
496 #
497 # testppd (dependency on static CUPS library is intentional)
498 #
499
500 testppd: testppd.o $(LIBCUPSSTATIC) test.ppd test2.ppd
501 echo Linking $@...
502 $(CC) $(ARCHFLAGS) $(LDFLAGS) -o $@ testppd.o $(LIBCUPSSTATIC) \
503 $(LIBGSSAPI) $(SSLLIBS) $(DNSSDLIBS) $(COMMONLIBS) $(LIBZ)
504 echo Running PPD API tests...
505 ./testppd
506
507
508 #
509 # testsnmp (dependency on static CUPS library is intentional)
510 #
511
512 testsnmp: testsnmp.o $(LIBCUPSSTATIC)
513 echo Linking $@...
514 $(CC) $(LDFLAGS) -o $@ testsnmp.o $(LIBCUPSSTATIC) \
515 $(LIBGSSAPI) $(SSLLIBS) $(DNSSDLIBS) $(COMMONLIBS) $(LIBZ)
516
517
518 #
519 # Automatic API help files...
520 #
521
522 apihelp:
523 echo Generating CUPS API help files...
524 mxmldoc --section "Programming" \
525 --title "Introduction to CUPS Programming" \
526 --css ../doc/cups-printable.css \
527 --header api-overview.header --intro api-overview.shtml \
528 >../doc/help/api-overview.html
529 mxmldoc --section "Programming" --title "Array API" \
530 --css ../doc/cups-printable.css \
531 --header api-array.header --intro api-array.shtml \
532 api-array.xml \
533 array.h array.c >../doc/help/api-array.html
534 mxmldoc --tokens help/api-array.html api-array.xml >../doc/help/api-array.tokens
535 $(RM) api-array.xml
536 mxmldoc --section "Programming" --title "CUPS API" \
537 --css ../doc/cups-printable.css \
538 --header api-cups.header --intro api-cups.shtml \
539 api-cups.xml \
540 cups.h adminutil.c dest.c language.c notify.c \
541 options.c tempfile.c usersys.c \
542 util.c >../doc/help/api-cups.html
543 mxmldoc --tokens help/api-cups.html api-cups.xml >../doc/help/api-cups.tokens
544 $(RM) api-cups.xml
545 mxmldoc --section "Programming" --title "File and Directory APIs" \
546 --css ../doc/cups-printable.css \
547 --header api-filedir.header --intro api-filedir.shtml \
548 api-filedir.xml \
549 file.h file.c dir.h dir.c >../doc/help/api-filedir.html
550 mxmldoc --tokens api-filedir.xml >../doc/help/api-filedir.tokens
551 $(RM) api-filedir.xml
552 mxmldoc --section "Programming" --title "PPD API" \
553 --css ../doc/cups-printable.css \
554 --header api-ppd.header --intro api-ppd.shtml \
555 api-ppd.xml \
556 ppd.h attr.c conflicts.c custom.c emit.c localize.c mark.c page.c \
557 ppd.c >../doc/help/api-ppd.html
558 mxmldoc --tokens help/api-ppd.html api-ppd.xml >../doc/help/api-ppd.tokens
559 $(RM) api-ppd.xml
560 mxmldoc --section "Programming" --title "HTTP and IPP APIs" \
561 --css ../doc/cups-printable.css \
562 --header api-httpipp.header --intro api-httpipp.shtml \
563 api-httpipp.xml \
564 http.h ipp.h auth.c getdevices.c getputfile.c encode.c \
565 http.c http-addr.c http-support.c ipp.c ipp-support.c \
566 md5passwd.c request.c >../doc/help/api-httpipp.html
567 mxmldoc --tokens help/api-httpipp.html api-httpipp.xml >../doc/help/api-httpipp.tokens
568 $(RM) api-httpipp.xml
569 mxmldoc --section "Programming" \
570 --title "Filter and Backend Programming" \
571 --css ../doc/cups-printable.css \
572 --header api-filter.header --intro api-filter.shtml \
573 api-filter.xml \
574 backchannel.c backend.h backend.c sidechannel.c sidechannel.h \
575 >../doc/help/api-filter.html
576 mxmldoc --tokens help/api-filter.html api-filter.xml >../doc/help/api-filter.tokens
577 $(RM) api-filter.xml
578
579 framedhelp:
580 echo Generating CUPS API help files...
581 mxmldoc --framed api-overview \
582 --section "Programming" \
583 --title "Introduction to CUPS Programming" \
584 --css ../doc/cups-printable.css \
585 --header api-overview.header --intro api-overview.shtml
586 mxmldoc --framed api-array \
587 --section "Programming" --title "Array API" \
588 --css ../doc/cups-printable.css \
589 --header api-array.header --intro api-array.shtml \
590 array.h array.c
591 mxmldoc --framed api-cups \
592 --section "Programming" --title "CUPS API" \
593 --css ../doc/cups-printable.css \
594 --header api-cups.header --intro api-cups.shtml \
595 cups.h adminutil.c dest.c language.c notify.c \
596 options.c tempfile.c usersys.c \
597 util.c
598 mxmldoc --framed api-filedir \
599 --section "Programming" --title "File and Directory APIs" \
600 --css ../doc/cups-printable.css \
601 --header api-filedir.header --intro api-filedir.shtml \
602 file.h file.c dir.h dir.c
603 mxmldoc --framed api-ppd \
604 --section "Programming" --title "PPD API" \
605 --css ../doc/cups-printable.css \
606 --header api-ppd.header --intro api-ppd.shtml \
607 ppd.h attr.c conflicts.c custom.c emit.c localize.c mark.c \
608 page.c ppd.c
609 mxmldoc --framed api-httpipp \
610 --section "Programming" --title "HTTP and IPP APIs" \
611 --css ../doc/cups-printable.css \
612 --header api-httpipp.header --intro api-httpipp.shtml \
613 http.h ipp.h auth.c getdevices.c getputfile.c encode.c \
614 http.c http-addr.c http-support.c ipp.c ipp-support.c \
615 md5passwd.c request.c
616 mxmldoc --framed api-filter \
617 --section "Programming" \
618 --title "Filter and Backend Programming" \
619 --css ../doc/cups-printable.css \
620 --header api-filter.header --intro api-filter.shtml \
621 backchannel.c backend.h backend.c sidechannel.c sidechannel.h
622
623
624 #
625 # Dependencies...
626 #
627
628 include Dependencies
629
630
631 #
632 # End of "$Id: Makefile 7871 2008-08-27 21:12:43Z mike $".
633 #