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