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