2 # "$Id: Makefile 6649 2007-07-11 21:46:42Z mike $"
4 # API library Makefile for the Common UNIX Printing System (CUPS).
6 # Copyright 2007-2008 by Apple Inc.
7 # Copyright 1997-2006 by Easy Software Products, all rights reserved.
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/".
15 # This file is subject to the Apple OS-Developed Software exception.
67 LIB32OBJS
= $(LIBOBJS
:.o
=.32.o
)
68 LIB64OBJS
= $(LIBOBJS
:.o
=.64.o
)
87 # Header files to install...
108 # Targets in this directory...
129 # Make all targets...
136 # Remove object and target files...
140 $(RM
) $(OBJS
) $(TARGETS
)
141 $(RM
) libcups.so libcups.sl libcups.dylib
146 # Update dependencies (without system header dependencies...)
150 touch Dependencies.tmp
151 makedepend
-Y
-I..
-fDependencies.tmp
$(OBJS
:.o
=.c
) >/dev
/null
2>&1
153 cp Dependencies.tmp Dependencies
154 sed
-E
-e
'1,$$s/^([^.]+)\.o:/\1\.32.o: \1\.c /' Dependencies.tmp
>>Dependencies
155 sed
-E
-e
'1,$$s/^([^.]+)\.o:/\1\.64.o: \1\.c /' Dependencies.tmp
>>Dependencies
156 $(RM
) Dependencies.tmp
160 # Install all targets...
163 install: all install-data install-headers install-libs install-exec
167 # Install data files...
174 # Install programs...
185 echo Installing header files into
$(INCLUDEDIR
)/cups...
186 $(INSTALL_DIR
) -m
755 $(INCLUDEDIR
)/cups
187 for file in
$(HEADERS
); do \
188 $(INSTALL_DATA
) $$file $(INCLUDEDIR
)/cups
; \
193 # Install libraries...
196 install-libs
: $(INSTALLSTATIC
) $(INSTALL32
) $(INSTALL64
)
197 echo Installing libraries in
$(LIBDIR
)...
198 $(INSTALL_DIR
) -m
755 $(LIBDIR
)
199 $(INSTALL_LIB
) $(LIBCUPS
) $(LIBDIR
)
200 if
test $(LIBCUPS
) = "libcups.so.2" -o
$(LIBCUPS
) = "libcups.sl.2"; then \
201 $(RM
) $(LIBDIR
)/`basename $(LIBCUPS) .2`; \
202 $(LN
) $(LIBCUPS
) $(LIBDIR
)/`basename $(LIBCUPS) .2`; \
204 if
test $(LIBCUPS
) = "libcups.2.dylib"; then \
205 $(RM
) $(LIBDIR
)/libcups.dylib
; \
206 $(LN
) $(LIBCUPS
) $(LIBDIR
)/libcups.dylib
; \
208 if
test "x$(SYMROOT)" != "x"; then \
209 $(INSTALL_DIR
) $(SYMROOT
); \
210 cp
$(LIBCUPS
) $(SYMROOT
); \
214 $(INSTALL_DIR
) -m
755 $(LIBDIR
)
215 $(INSTALL_LIB
) libcups.a
$(LIBDIR
)
216 $(RANLIB
) $(LIBDIR
)/libcups.a
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
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
232 # Uninstall object and target files...
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
245 for file in
$(HEADERS
); do \
246 $(RM
) $(INCLUDEDIR
)/cups
/$$file; \
248 -$(RMDIR
) $(INCLUDEDIR
)/cups
251 $(RM
) $(LIB32DIR
)/libcups.so
252 $(RM
) $(LIB32DIR
)/libcups.so
.2
253 -$(RMDIR
) $(LIB32DIR
)
256 $(RM
) $(LIB64DIR
)/libcups.so
257 $(RM
) $(LIB64DIR
)/libcups.so
.2
258 -$(RMDIR
) $(LIB64DIR
)
262 # libcups.so.2, libcups.sl.2
265 libcups.so
.2 libcups.sl
.2: $(LIBOBJS
)
267 $(DSO
) $(ARCHFLAGS
) $(DSOFLAGS
) -o
$@
$(LIBOBJS
) $(LIBGSSAPI
) $(SSLLIBS
) $(COMMONLIBS
) $(LIBZ
)
268 $(RM
) `basename $@ .2`
269 $(LN
) $@
`basename $@ .2`
276 32bit
/libcups.so
.2: $(LIB32OBJS
)
277 echo Linking
32-bit
$@...
279 $(DSO
) $(ARCH32FLAGS
) $(DSO32FLAGS
) -o
$@
$(LIB32OBJS
) $(LIBGSSAPI
) $(SSLLIBS
) $(COMMONLIBS
) $(LIBZ
)
280 $(RM
) 32bit
/libcups.so
281 $(LN
) libcups.so
.2 32bit
/libcups.so
288 64bit
/libcups.so
.2: $(LIB64OBJS
)
289 echo Linking
64-bit
$@...
291 $(DSO
) $(ARCH64FLAGS
) $(DSO64FLAGS
) -o
$@
$(LIB64OBJS
) $(LIBGSSAPI
) $(SSLLIBS
) $(COMMONLIBS
) $(LIBZ
)
292 $(RM
) 64bit
/libcups.so
293 $(LN
) libcups.so
.2 64bit
/libcups.so
300 libcups
.2.dylib
: $(LIBOBJS
) $(LIBCUPSORDER
) libcups.exp
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
)
310 $(LN
) $@ libcups.dylib
317 libcups_s.a
: $(LIBOBJS
) libcups_s.exp
319 $(DSO
) $(DSOFLAGS
) -Wl
,-bexport
:libcups_s.exp
-o libcups_s.o
$(LIBOBJS
) $(LIBGSSAPI
) $(SSLLIBS
) $(COMMONLIBS
) $(LIBZ
) -lm
321 $(AR
) $(ARFLAGS
) $@ libcups_s.o
328 libcups.la
: $(LIBOBJS
)
330 $(CC
) $(ARCHFLAGS
) $(DSOFLAGS
) -o
$@
$(LIBOBJS
:.o
=.lo
) -rpath
$(LIBDIR
) \
331 -version-info
2:8 $(LIBGSSAPI
) $(SSLLIBS
) $(COMMONLIBS
) $(LIBZ
)
338 libcups.a
: $(LIBOBJS
)
341 $(AR
) $(ARFLAGS
) $@
$(LIBOBJS
)
346 # CUPS language bindings for various scripting languages...
348 # NOTE: Not currently used or functional - see the scripting/php directory
349 # for the hand-written bindings...
352 phpcups.so
: $(LIBCUPS
) php_cups_wrap.o
354 if
test `uname` = Darwin
; then \
355 DSOFLAGS
="-bundle -flat_namespace -undefined suppress"; \
357 DSOFLAGS
="$(DSOFLAGS)"; \
359 $(DSO
) $$DSOFLAGS -o
$@ php_cups_wrap.o
$(LIBS
) `php-config --ldflags --libs`
361 php_cups_wrap.o
: php_cups_wrap.c
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
370 # testadmin (dependency on static CUPS library is intentional)
373 testadmin
: testadmin.o libcups.a
375 $(CC
) $(LDFLAGS
) -o
$@ testadmin.o libcups.a \
376 $(LIBGSSAPI
) $(SSLLIBS
) $(COMMONLIBS
) $(LIBZ
)
380 # testarray (dependency on static CUPS library is intentional)
383 testarray
: testarray.o libcups.a
385 $(CC
) $(LDFLAGS
) -o
$@ testarray.o libcups.a \
386 $(LIBGSSAPI
) $(SSLLIBS
) $(COMMONLIBS
) $(LIBZ
)
390 # testcups (dependency on static CUPS library is intentional)
393 testcups
: testcups.o libcups.a
395 $(CC
) $(LDFLAGS
) -o
$@ testcups.o libcups.a \
396 $(LIBGSSAPI
) $(SSLLIBS
) $(COMMONLIBS
) $(LIBZ
)
400 # testfile (dependency on static CUPS library is intentional)
403 testfile
: testfile.o libcups.a
405 $(CC
) $(LDFLAGS
) -o
$@ testfile.o libcups.a \
406 $(LIBGSSAPI
) $(SSLLIBS
) $(COMMONLIBS
) $(LIBZ
)
410 # testhttp (dependency on static CUPS library is intentional)
413 testhttp
: testhttp.o libcups.a
415 $(CC
) $(LDFLAGS
) -o
$@ testhttp.o libcups.a \
416 $(LIBGSSAPI
) $(SSLLIBS
) $(COMMONLIBS
) $(LIBZ
)
420 # testipp (dependency on static CUPS library is intentional)
423 testipp
: testipp.o libcups.a
425 $(CC
) $(LDFLAGS
) -o
$@ testipp.o libcups.a \
426 $(LIBGSSAPI
) $(SSLLIBS
) $(COMMONLIBS
) $(LIBZ
)
430 # testi18n (dependency on static CUPS library is intentional)
433 testi18n
: testi18n.o libcups.a
435 $(CC
) $(LDFLAGS
) -o
$@ testi18n.o libcups.a \
436 $(LIBGSSAPI
) $(SSLLIBS
) $(COMMONLIBS
) $(LIBZ
)
440 # testlang (dependency on static CUPS library is intentional)
443 testlang
: testlang.o libcups.a
445 $(CC
) $(LDFLAGS
) -o
$@ testlang.o libcups.a \
446 $(LIBGSSAPI
) $(SSLLIBS
) $(COMMONLIBS
) $(LIBZ
)
450 # testppd (dependency on static CUPS library is intentional)
453 testppd
: testppd.o libcups.a
455 $(CC
) $(LDFLAGS
) -o
$@ testppd.o libcups.a \
456 $(LIBGSSAPI
) $(SSLLIBS
) $(COMMONLIBS
) $(LIBZ
)
460 # testsnmp (dependency on static CUPS library is intentional)
463 testsnmp
: testsnmp.o libcups.a
465 $(CC
) $(LDFLAGS
) -o
$@ testsnmp.o libcups.a \
466 $(LIBGSSAPI
) $(SSLLIBS
) $(COMMONLIBS
) $(LIBZ
)
470 # Automatic API help files...
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 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 getdevices.c getputfile.c encode.c \
503 http.c http-addr.c http-support.c ipp.c ipp-support.c \
504 md5passwd.c 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 >..
/doc
/help
/api-filter.html
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 \
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 language.c notify.c \
529 options.c tempfile.c usersys.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 \
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 getdevices.c getputfile.c encode.c \
547 http.c http-addr.c http-support.c ipp.c ipp-support.c \
548 md5passwd.c 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
565 # End of "$Id: Makefile 6649 2007-07-11 21:46:42Z mike $".