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