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