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