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