]> git.ipfire.org Git - thirdparty/cups.git/blame - cups/Makefile
Merge changes from CUPS trunk, r7566.
[thirdparty/cups.git] / cups / Makefile
CommitLineData
ef416fc2 1#
bc44d920 2# "$Id: Makefile 6649 2007-07-11 21:46:42Z mike $"
ef416fc2 3#
4# API library Makefile for the Common UNIX Printing System (CUPS).
5#
91c84a35 6# Copyright 2007-2008 by Apple Inc.
ef416fc2 7# Copyright 1997-2006 by Easy Software Products, all rights reserved.
8#
9# These coded instructions, statements, and computer programs are the
bc44d920 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/".
ef416fc2 14#
15# This file is subject to the Apple OS-Developed Software exception.
16#
17
18include ../Makedefs
19
20#
21# Object files...
22#
23
24LIBOBJS = \
757d2cad 25 adminutil.o \
ef416fc2 26 array.o \
27 attr.o \
28 auth.o \
29 backchannel.o \
a4d04587 30 backend.o \
fa73b229 31 custom.o \
ae71f5de 32 debug.o \
ef416fc2 33 dest.o \
34 dir.o \
35 emit.o \
36 encode.o \
37 file.o \
ae71f5de 38 getdevices.o \
89d46774 39 getifaddrs.o \
ef416fc2 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 \
fa73b229 50 localize.o \
ef416fc2 51 mark.o \
52 md5.o \
53 md5passwd.o \
fa73b229 54 notify.o \
ef416fc2 55 options.o \
56 page.o \
57 ppd.o \
ecdc0628 58 request.o \
f7deaa1a 59 sidechannel.o \
91c84a35 60 snmp.o \
ef416fc2 61 snprintf.o \
62 string.o \
63 tempfile.o \
64 transcode.o \
65 usersys.o \
66 util.o
e1d6a774 67LIB32OBJS = $(LIBOBJS:.o=.32.o)
68LIB64OBJS = $(LIBOBJS:.o=.64.o)
ef416fc2 69OBJS = \
70 $(LIBOBJS) \
e1d6a774 71 $(LIB32OBJS) \
72 $(LIB64OBJS) \
757d2cad 73 testadmin.o \
ef416fc2 74 testarray.o \
09a101d6 75 testcups.o \
ef416fc2 76 testfile.o \
77 testhttp.o \
78 testi18n.o \
79 testipp.o \
80 testlang.o \
fa73b229 81 testppd.o \
91c84a35 82 testsnmp.o \
ef416fc2 83 php_cups_wrap.o
84
85
86#
87# Header files to install...
88#
89
90HEADERS = \
757d2cad 91 adminutil.h \
ef416fc2 92 array.h \
d09495fa 93 backend.h \
ef416fc2 94 cups.h \
95 dir.h \
96 file.h \
97 http.h \
ef416fc2 98 ipp.h \
99 language.h \
ef416fc2 100 ppd.h \
ac884b6a 101 raster.h \
f7deaa1a 102 sidechannel.h \
a41f09e2
MS
103 transcode.h \
104 versioning.h
ef416fc2 105
106
107#
108# Targets in this directory...
109#
110
c9fc04c6 111LIBTARGETS = \
ef416fc2 112 $(LIBCUPS) \
e1d6a774 113 $(LIB32CUPS) \
114 $(LIB64CUPS) \
ef416fc2 115 libcups.a \
116 testarray \
117 testfile \
118 testhttp \
119 testi18n \
120 testipp \
fa73b229 121 testlang \
c9fc04c6
MS
122 testppd
123
124TARGETS = \
125 $(LIBTARGETS) \
126 testadmin \
127 testcups \
91c84a35 128 testsnmp
ef416fc2 129
130
131#
132# Make all targets...
133#
134
135all: $(TARGETS)
136
137
c9fc04c6
MS
138#
139# Make library targets...
140#
141
142libs: $(LIBTARGETS)
143
144
ef416fc2 145#
146# Remove object and target files...
147#
148
149clean:
e1d6a774 150 $(RM) $(OBJS) $(TARGETS)
f301802f 151 $(RM) libcups.so libcups.sl libcups.dylib
ed486911 152 $(RM) -r 32bit 64bit
ef416fc2 153
154
155#
156# Update dependencies (without system header dependencies...)
157#
158
159depend:
e1d6a774 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
91c84a35
MS
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
e1d6a774 166 $(RM) Dependencies.tmp
ef416fc2 167
168
169#
50fe7201 170# Install all targets...
ef416fc2 171#
172
50fe7201
MS
173install: all install-data install-headers install-libs install-exec
174
175
176#
177# Install data files...
178#
179
180install-data:
181
182
183#
184# Install programs...
185#
186
187install-exec:
188
189
190#
191# Install headers...
192#
193
194install-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
206install-libs: $(INSTALLSTATIC) $(INSTALL32) $(INSTALL64)
207 echo Installing libraries in $(LIBDIR)...
bd7854cb 208 $(INSTALL_DIR) -m 755 $(LIBDIR)
ef416fc2 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 \
ef416fc2 215 $(RM) $(LIBDIR)/libcups.dylib; \
216 $(LN) $(LIBCUPS) $(LIBDIR)/libcups.dylib; \
217 fi
09a101d6 218 if test "x$(SYMROOT)" != "x"; then \
219 $(INSTALL_DIR) $(SYMROOT); \
50fe7201 220 cp $(LIBCUPS) $(SYMROOT); \
09a101d6 221 fi
923edb68 222
223installstatic:
224 $(INSTALL_DIR) -m 755 $(LIBDIR)
d6ae789d 225 $(INSTALL_LIB) libcups.a $(LIBDIR)
226 $(RANLIB) $(LIBDIR)/libcups.a
ef416fc2 227
e1d6a774 228install32bit:
50fe7201 229 echo Installing libraries in $(LIB32DIR)...
e1d6a774 230 $(INSTALL_DIR) -m 755 $(LIB32DIR)
f301802f 231 $(INSTALL_LIB) 32bit/libcups.so.2 $(LIB32DIR)/libcups.so.2
ed486911 232 $(LN) libcups.so.2 $(LIB32DIR)/libcups.so
e1d6a774 233
234install64bit:
50fe7201 235 echo Installing libraries in $(LIB64DIR)...
e1d6a774 236 $(INSTALL_DIR) -m 755 $(LIB64DIR)
f301802f 237 $(INSTALL_LIB) 64bit/libcups.so.2 $(LIB64DIR)/libcups.so.2
ed486911 238 $(LN) libcups.so.2 $(LIB64DIR)/libcups.so
e1d6a774 239
ef416fc2 240
757d2cad 241#
242# Uninstall object and target files...
243#
244
e1d6a774 245uninstall: $(UNINSTALL32) $(UNINSTALL64)
757d2cad 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
e1d6a774 260uninstall32bit:
261 $(RM) $(LIB32DIR)/libcups.so
262 $(RM) $(LIB32DIR)/libcups.so.2
263 -$(RMDIR) $(LIB32DIR)
264
265uninstall64bit:
266 $(RM) $(LIB64DIR)/libcups.so
267 $(RM) $(LIB64DIR)/libcups.so.2
268 -$(RMDIR) $(LIB64DIR)
269
757d2cad 270
ef416fc2 271#
272# libcups.so.2, libcups.sl.2
273#
274
275libcups.so.2 libcups.sl.2: $(LIBOBJS)
276 echo Linking $@...
f7deaa1a 277 $(DSO) $(ARCHFLAGS) $(DSOFLAGS) -o $@ $(LIBOBJS) $(LIBGSSAPI) $(SSLLIBS) $(COMMONLIBS) $(LIBZ)
ef416fc2 278 $(RM) `basename $@ .2`
279 $(LN) $@ `basename $@ .2`
280
281
e1d6a774 282#
f301802f 283# 32bit/libcups.so.2
e1d6a774 284#
285
f301802f 28632bit/libcups.so.2: $(LIB32OBJS)
e1d6a774 287 echo Linking 32-bit $@...
f301802f 288 -mkdir 32bit
f7deaa1a 289 $(DSO) $(ARCH32FLAGS) $(DSO32FLAGS) -o $@ $(LIB32OBJS) $(LIBGSSAPI) $(SSLLIBS) $(COMMONLIBS) $(LIBZ)
f301802f 290 $(RM) 32bit/libcups.so
291 $(LN) libcups.so.2 32bit/libcups.so
e1d6a774 292
293
294#
f301802f 295# 64bit/libcups.so.2
e1d6a774 296#
297
f301802f 29864bit/libcups.so.2: $(LIB64OBJS)
e1d6a774 299 echo Linking 64-bit $@...
f301802f 300 -mkdir 64bit
f7deaa1a 301 $(DSO) $(ARCH64FLAGS) $(DSO64FLAGS) -o $@ $(LIB64OBJS) $(LIBGSSAPI) $(SSLLIBS) $(COMMONLIBS) $(LIBZ)
f301802f 302 $(RM) 64bit/libcups.so
303 $(LN) libcups.so.2 64bit/libcups.so
e1d6a774 304
305
ef416fc2 306#
307# libcups.2.dylib
308#
309
a4924f6c 310libcups.2.dylib: $(LIBOBJS) $(LIBCUPSORDER) libcups.exp
ef416fc2 311 echo Linking $@...
e1d6a774 312 $(DSO) $(ARCHFLAGS) $(DSOFLAGS) -o $@ \
fa73b229 313 -install_name $(libdir)/$@ \
f7deaa1a 314 -current_version 2.8.0 \
ef416fc2 315 -compatibility_version 2.0.0 \
09a101d6 316 -exported_symbols_list libcups.exp \
317 -sectorder __TEXT __text $(LIBCUPSORDER) \
f7deaa1a 318 $(LIBOBJS) $(LIBGSSAPI) $(SSLLIBS) $(COMMONLIBS) $(LIBZ)
ef416fc2 319 $(RM) libcups.dylib
320 $(LN) $@ libcups.dylib
321
322
323#
324# libcups_s.a
325#
326
a74454a7 327libcups_s.a: $(LIBOBJS) libcups_s.exp
ef416fc2 328 echo Creating $@...
f7deaa1a 329 $(DSO) $(DSOFLAGS) -Wl,-bexport:libcups_s.exp -o libcups_s.o $(LIBOBJS) $(LIBGSSAPI) $(SSLLIBS) $(COMMONLIBS) $(LIBZ) -lm
ef416fc2 330 $(RM) $@
331 $(AR) $(ARFLAGS) $@ libcups_s.o
332
333
334#
335# libcups.la
336#
337
338libcups.la: $(LIBOBJS)
339 echo Linking $@...
e1d6a774 340 $(CC) $(ARCHFLAGS) $(DSOFLAGS) -o $@ $(LIBOBJS:.o=.lo) -rpath $(LIBDIR) \
f7deaa1a 341 -version-info 2:8 $(LIBGSSAPI) $(SSLLIBS) $(COMMONLIBS) $(LIBZ)
ef416fc2 342
343
344#
345# libcups.a
346#
347
348libcups.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#
757d2cad 358# NOTE: Not currently used or functional - see the scripting/php directory
359# for the hand-written bindings...
360#
ef416fc2 361
362phpcups.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
371php_cups_wrap.o: php_cups_wrap.c
372 echo Compiling $<...
373 $(CC) $(CFLAGS) `php-config --includes` -c $<
374php_cups_wrap.c: cups.h
375 echo Creating $< using SWIG...
376 swig -php -o $@ -module cups cups.h
377
378
757d2cad 379#
380# testadmin (dependency on static CUPS library is intentional)
381#
382
383testadmin: testadmin.o libcups.a
384 echo Linking $@...
385 $(CC) $(LDFLAGS) -o $@ testadmin.o libcups.a \
f7deaa1a 386 $(LIBGSSAPI) $(SSLLIBS) $(COMMONLIBS) $(LIBZ)
757d2cad 387
388
ef416fc2 389#
390# testarray (dependency on static CUPS library is intentional)
391#
392
393testarray: testarray.o libcups.a
394 echo Linking $@...
c9fc04c6 395 $(CC) $(ARCHFLAGS) $(LDFLAGS) -o $@ testarray.o libcups.a \
f7deaa1a 396 $(LIBGSSAPI) $(SSLLIBS) $(COMMONLIBS) $(LIBZ)
c9fc04c6
MS
397 echo Running array API tests...
398 ./testarray
ef416fc2 399
400
09a101d6 401#
402# testcups (dependency on static CUPS library is intentional)
403#
404
405testcups: testcups.o libcups.a
406 echo Linking $@...
407 $(CC) $(LDFLAGS) -o $@ testcups.o libcups.a \
408 $(LIBGSSAPI) $(SSLLIBS) $(COMMONLIBS) $(LIBZ)
409
410
ef416fc2 411#
412# testfile (dependency on static CUPS library is intentional)
413#
414
415testfile: testfile.o libcups.a
416 echo Linking $@...
c9fc04c6 417 $(CC) $(ARCHFLAGS) $(LDFLAGS) -o $@ testfile.o libcups.a \
f7deaa1a 418 $(LIBGSSAPI) $(SSLLIBS) $(COMMONLIBS) $(LIBZ)
c9fc04c6
MS
419 echo Running file API tests...
420 ./testfile
ef416fc2 421
422
423#
424# testhttp (dependency on static CUPS library is intentional)
425#
426
427testhttp: testhttp.o libcups.a
428 echo Linking $@...
c9fc04c6 429 $(CC) $(ARCHFLAGS) $(LDFLAGS) -o $@ testhttp.o libcups.a \
f7deaa1a 430 $(LIBGSSAPI) $(SSLLIBS) $(COMMONLIBS) $(LIBZ)
c9fc04c6
MS
431 echo Running HTTP API tests...
432 ./testhttp
ef416fc2 433
434
435#
436# testipp (dependency on static CUPS library is intentional)
437#
438
439testipp: testipp.o libcups.a
440 echo Linking $@...
c9fc04c6 441 $(CC) $(ARCHFLAGS) $(LDFLAGS) -o $@ testipp.o libcups.a \
f7deaa1a 442 $(LIBGSSAPI) $(SSLLIBS) $(COMMONLIBS) $(LIBZ)
c9fc04c6
MS
443 echo Running IPP API tests...
444 ./testipp
ef416fc2 445
446
447#
448# testi18n (dependency on static CUPS library is intentional)
449#
450
451testi18n: testi18n.o libcups.a
452 echo Linking $@...
c9fc04c6 453 $(CC) $(ARCHFLAGS) $(LDFLAGS) -o $@ testi18n.o libcups.a \
f7deaa1a 454 $(LIBGSSAPI) $(SSLLIBS) $(COMMONLIBS) $(LIBZ)
c9fc04c6
MS
455 echo Running internationalization API tests...
456 ./testi18n
ef416fc2 457
458
459#
460# testlang (dependency on static CUPS library is intentional)
461#
462
463testlang: testlang.o libcups.a
464 echo Linking $@...
c9fc04c6 465 $(CC) $(ARCHFLAGS) $(LDFLAGS) -o $@ testlang.o libcups.a \
f7deaa1a 466 $(LIBGSSAPI) $(SSLLIBS) $(COMMONLIBS) $(LIBZ)
c9fc04c6
MS
467 echo Running language API tests...
468 ./testlang
ef416fc2 469
470
fa73b229 471#
472# testppd (dependency on static CUPS library is intentional)
473#
474
475testppd: testppd.o libcups.a
476 echo Linking $@...
c9fc04c6 477 $(CC) $(ARCHFLAGS) $(LDFLAGS) -o $@ testppd.o libcups.a \
f7deaa1a 478 $(LIBGSSAPI) $(SSLLIBS) $(COMMONLIBS) $(LIBZ)
c9fc04c6
MS
479 echo Running PPD API tests...
480 ./testppd
fa73b229 481
482
91c84a35
MS
483#
484# testsnmp (dependency on static CUPS library is intentional)
485#
486
487testsnmp: testsnmp.o libcups.a
488 echo Linking $@...
489 $(CC) $(LDFLAGS) -o $@ testsnmp.o libcups.a \
490 $(LIBGSSAPI) $(SSLLIBS) $(COMMONLIBS) $(LIBZ)
491
492
ef416fc2 493#
494# Automatic API help files...
495#
496
497apihelp:
498 echo Generating CUPS API help files...
5a738aea
MS
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
ef416fc2 504 mxmldoc --section "Programming" --title "Array API" \
5a738aea
MS
505 --css ../doc/cups-printable.css \
506 --header api-array.header --intro api-array.shtml \
ef416fc2 507 array.h array.c >../doc/help/api-array.html
508 mxmldoc --section "Programming" --title "CUPS API" \
5a738aea
MS
509 --css ../doc/cups-printable.css \
510 --header api-cups.header --intro api-cups.shtml \
ae71f5de 511 cups.h dest.c language.c notify.c \
ef416fc2 512 options.c tempfile.c usersys.c \
513 util.c >../doc/help/api-cups.html
514 mxmldoc --section "Programming" --title "File and Directory APIs" \
5a738aea
MS
515 --css ../doc/cups-printable.css \
516 --header api-filedir.header --intro api-filedir.shtml \
ef416fc2 517 file.h file.c dir.h dir.c >../doc/help/api-filedir.html
518 mxmldoc --section "Programming" --title "PPD API" \
5a738aea
MS
519 --css ../doc/cups-printable.css \
520 --header api-ppd.header --intro api-ppd.shtml \
89d46774 521 ppd.h attr.c custom.c emit.c localize.c mark.c page.c \
ef416fc2 522 ppd.c >../doc/help/api-ppd.html
523 mxmldoc --section "Programming" --title "HTTP and IPP APIs" \
5a738aea
MS
524 --css ../doc/cups-printable.css \
525 --header api-httpipp.header --intro api-httpipp.shtml \
ae71f5de
MS
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
5a738aea
MS
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 \
ac884b6a 533 backchannel.c backend.h backend.c sidechannel.c sidechannel.h \
7a14d768 534 >../doc/help/api-filter.html
5a738aea
MS
535
536framedhelp:
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 \
ae71f5de 552 cups.h dest.c language.c notify.c \
5a738aea 553 options.c tempfile.c usersys.c \
ac884b6a 554 util.c
5a738aea
MS
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 \
ac884b6a 559 file.h file.c dir.h dir.c
5a738aea
MS
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 \
ac884b6a 565 ppd.c
5a738aea
MS
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 \
ae71f5de
MS
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
5a738aea
MS
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 \
7a14d768 578 backchannel.c backend.h backend.c sidechannel.c sidechannel.h
ef416fc2 579
580
581#
582# Dependencies...
583#
584
585include Dependencies
586
587
588#
bc44d920 589# End of "$Id: Makefile 6649 2007-07-11 21:46:42Z mike $".
ef416fc2 590#