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