2 # "$Id: Makefile 7589 2008-05-19 00:13:23Z 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.
68 LIB32OBJS
= $(LIBOBJS
:.o
=.32.o
)
69 LIB64OBJS
= $(LIBOBJS
:.o
=.64.o
)
90 # Header files to install...
111 # Targets in this directory...
137 # Make all targets...
144 # Make library targets...
151 # Remove object and target files...
155 $(RM
) $(OBJS
) $(TARGETS
)
156 $(RM
) libcups.so libcups.sl libcups.dylib
161 # Update dependencies (without system header dependencies...)
165 touch Dependencies.tmp
166 makedepend
-Y
-I..
-fDependencies.tmp
$(OBJS
:.o
=.c
) >/dev
/null
2>&1
168 cp Dependencies.tmp Dependencies
169 sed
-E
-e
'1,$$s/^([^.]+)\.o:/\1\.32.o: \1\.c /' Dependencies.tmp
>>Dependencies
170 sed
-E
-e
'1,$$s/^([^.]+)\.o:/\1\.64.o: \1\.c /' Dependencies.tmp
>>Dependencies
171 $(RM
) Dependencies.tmp
175 # Install all targets...
178 install: all install-data install-headers install-libs install-exec
182 # Install data files...
189 # Install programs...
200 echo Installing header files into
$(INCLUDEDIR
)/cups...
201 $(INSTALL_DIR
) -m
755 $(INCLUDEDIR
)/cups
202 for file in
$(HEADERS
); do \
203 $(INSTALL_DATA
) $$file $(INCLUDEDIR
)/cups
; \
208 # Install libraries...
211 install-libs
: $(INSTALLSTATIC
) $(INSTALL32
) $(INSTALL64
)
212 echo Installing libraries in
$(LIBDIR
)...
213 $(INSTALL_DIR
) -m
755 $(LIBDIR
)
214 $(INSTALL_LIB
) $(LIBCUPS
) $(LIBDIR
)
215 if
test $(LIBCUPS
) = "libcups.so.2" -o
$(LIBCUPS
) = "libcups.sl.2"; then \
216 $(RM
) $(LIBDIR
)/`basename $(LIBCUPS) .2`; \
217 $(LN
) $(LIBCUPS
) $(LIBDIR
)/`basename $(LIBCUPS) .2`; \
219 if
test $(LIBCUPS
) = "libcups.2.dylib"; then \
220 $(RM
) $(LIBDIR
)/libcups.dylib
; \
221 $(LN
) $(LIBCUPS
) $(LIBDIR
)/libcups.dylib
; \
223 if
test "x$(SYMROOT)" != "x"; then \
224 $(INSTALL_DIR
) $(SYMROOT
); \
225 cp
$(LIBCUPS
) $(SYMROOT
); \
229 $(INSTALL_DIR
) -m
755 $(LIBDIR
)
230 $(INSTALL_LIB
) libcups.a
$(LIBDIR
)
231 $(RANLIB
) $(LIBDIR
)/libcups.a
234 echo Installing libraries in
$(LIB32DIR
)...
235 $(INSTALL_DIR
) -m
755 $(LIB32DIR
)
236 $(INSTALL_LIB
) 32bit
/libcups.so
.2 $(LIB32DIR
)/libcups.so
.2
237 $(LN
) libcups.so
.2 $(LIB32DIR
)/libcups.so
240 echo Installing libraries in
$(LIB64DIR
)...
241 $(INSTALL_DIR
) -m
755 $(LIB64DIR
)
242 $(INSTALL_LIB
) 64bit
/libcups.so
.2 $(LIB64DIR
)/libcups.so
.2
243 $(LN
) libcups.so
.2 $(LIB64DIR
)/libcups.so
247 # Uninstall object and target files...
250 uninstall: $(UNINSTALL32
) $(UNINSTALL64
)
251 $(RM
) $(LIBDIR
)/libcups
.2.dylib
252 $(RM
) $(LIBDIR
)/libcups.a
253 $(RM
) $(LIBDIR
)/libcups.dylib
254 $(RM
) $(LIBDIR
)/libcups_s.a
255 $(RM
) $(LIBDIR
)/libcups.sl
256 $(RM
) $(LIBDIR
)/libcups.sl
.2
257 $(RM
) $(LIBDIR
)/libcups.so
258 $(RM
) $(LIBDIR
)/libcups.so
.2
260 for file in
$(HEADERS
); do \
261 $(RM
) $(INCLUDEDIR
)/cups
/$$file; \
263 -$(RMDIR
) $(INCLUDEDIR
)/cups
266 $(RM
) $(LIB32DIR
)/libcups.so
267 $(RM
) $(LIB32DIR
)/libcups.so
.2
268 -$(RMDIR
) $(LIB32DIR
)
271 $(RM
) $(LIB64DIR
)/libcups.so
272 $(RM
) $(LIB64DIR
)/libcups.so
.2
273 -$(RMDIR
) $(LIB64DIR
)
277 # libcups.so.2, libcups.sl.2
280 libcups.so
.2 libcups.sl
.2: $(LIBOBJS
)
282 $(DSO
) $(ARCHFLAGS
) $(DSOFLAGS
) -o
$@
$(LIBOBJS
) $(LIBGSSAPI
) $(SSLLIBS
) $(COMMONLIBS
) $(LIBZ
)
283 $(RM
) `basename $@ .2`
284 $(LN
) $@
`basename $@ .2`
291 32bit
/libcups.so
.2: $(LIB32OBJS
)
292 echo Linking
32-bit
$@...
294 $(DSO
) $(ARCH32FLAGS
) $(DSO32FLAGS
) -o
$@
$(LIB32OBJS
) $(LIBGSSAPI
) $(SSLLIBS
) $(COMMONLIBS
) $(LIBZ
)
295 $(RM
) 32bit
/libcups.so
296 $(LN
) libcups.so
.2 32bit
/libcups.so
303 64bit
/libcups.so
.2: $(LIB64OBJS
)
304 echo Linking
64-bit
$@...
306 $(DSO
) $(ARCH64FLAGS
) $(DSO64FLAGS
) -o
$@
$(LIB64OBJS
) $(LIBGSSAPI
) $(SSLLIBS
) $(COMMONLIBS
) $(LIBZ
)
307 $(RM
) 64bit
/libcups.so
308 $(LN
) libcups.so
.2 64bit
/libcups.so
315 libcups
.2.dylib
: $(LIBOBJS
) $(LIBCUPSORDER
) libcups.exp
317 $(DSO
) $(ARCHFLAGS
) $(DSOFLAGS
) -o
$@ \
318 -install_name
$(libdir)/$@ \
319 -current_version
2.8.0 \
320 -compatibility_version
2.0.0 \
321 -exported_symbols_list libcups.exp \
322 -sectorder __TEXT __text
$(LIBCUPSORDER
) \
323 $(LIBOBJS
) $(LIBGSSAPI
) $(SSLLIBS
) $(COMMONLIBS
) $(LIBZ
)
325 $(LN
) $@ libcups.dylib
332 libcups_s.a
: $(LIBOBJS
) libcups_s.exp
334 $(DSO
) $(DSOFLAGS
) -Wl
,-bexport
:libcups_s.exp
-o libcups_s.o
$(LIBOBJS
) $(LIBGSSAPI
) $(SSLLIBS
) $(COMMONLIBS
) $(LIBZ
) -lm
336 $(AR
) $(ARFLAGS
) $@ libcups_s.o
343 libcups.la
: $(LIBOBJS
)
345 $(CC
) $(ARCHFLAGS
) $(DSOFLAGS
) -o
$@
$(LIBOBJS
:.o
=.lo
) -rpath
$(LIBDIR
) \
346 -version-info
2:8 $(LIBGSSAPI
) $(SSLLIBS
) $(COMMONLIBS
) $(LIBZ
)
353 libcups.a
: $(LIBOBJS
)
356 $(AR
) $(ARFLAGS
) $@
$(LIBOBJS
)
361 # CUPS language bindings for various scripting languages...
363 # NOTE: Not currently used or functional - see the scripting/php directory
364 # for the hand-written bindings...
367 phpcups.so
: $(LIBCUPS
) php_cups_wrap.o
369 if
test `uname` = Darwin
; then \
370 DSOFLAGS
="-bundle -flat_namespace -undefined suppress"; \
372 DSOFLAGS
="$(DSOFLAGS)"; \
374 $(DSO
) $$DSOFLAGS -o
$@ php_cups_wrap.o
$(LIBS
) `php-config --ldflags --libs`
376 php_cups_wrap.o
: php_cups_wrap.c
378 $(CC
) $(CFLAGS
) `php-config --includes` -c
$<
379 php_cups_wrap.c
: cups.h
380 echo Creating
$< using SWIG...
381 swig
-php
-o
$@
-module cups cups.h
385 # testadmin (dependency on static CUPS library is intentional)
388 testadmin
: testadmin.o libcups.a
390 $(CC
) $(LDFLAGS
) -o
$@ testadmin.o libcups.a \
391 $(LIBGSSAPI
) $(SSLLIBS
) $(COMMONLIBS
) $(LIBZ
)
395 # testarray (dependency on static CUPS library is intentional)
398 testarray
: testarray.o libcups.a
400 $(CC
) $(ARCHFLAGS
) $(LDFLAGS
) -o
$@ testarray.o libcups.a \
401 $(LIBGSSAPI
) $(SSLLIBS
) $(COMMONLIBS
) $(LIBZ
)
402 echo Running array API tests...
407 # testconflicts (dependency on static CUPS library is intentional)
410 testconflicts
: testconflicts.o libcups.a
412 $(CC
) $(LDFLAGS
) -o
$@ testconflicts.o libcups.a \
413 $(LIBGSSAPI
) $(SSLLIBS
) $(COMMONLIBS
) $(LIBZ
)
417 # testcups (dependency on static CUPS library is intentional)
420 testcups
: testcups.o libcups.a
422 $(CC
) $(LDFLAGS
) -o
$@ testcups.o libcups.a \
423 $(LIBGSSAPI
) $(SSLLIBS
) $(COMMONLIBS
) $(LIBZ
)
427 # testfile (dependency on static CUPS library is intentional)
430 testfile
: testfile.o libcups.a
432 $(CC
) $(ARCHFLAGS
) $(LDFLAGS
) -o
$@ testfile.o libcups.a \
433 $(LIBGSSAPI
) $(SSLLIBS
) $(COMMONLIBS
) $(LIBZ
)
434 echo Running file API tests...
439 # testhttp (dependency on static CUPS library is intentional)
442 testhttp
: testhttp.o libcups.a
444 $(CC
) $(ARCHFLAGS
) $(LDFLAGS
) -o
$@ testhttp.o libcups.a \
445 $(LIBGSSAPI
) $(SSLLIBS
) $(COMMONLIBS
) $(LIBZ
)
446 echo Running HTTP API tests...
451 # testipp (dependency on static CUPS library is intentional)
454 testipp
: testipp.o libcups.a
456 $(CC
) $(ARCHFLAGS
) $(LDFLAGS
) -o
$@ testipp.o libcups.a \
457 $(LIBGSSAPI
) $(SSLLIBS
) $(COMMONLIBS
) $(LIBZ
)
458 echo Running IPP API tests...
463 # testi18n (dependency on static CUPS library is intentional)
466 testi18n
: testi18n.o libcups.a
468 $(CC
) $(ARCHFLAGS
) $(LDFLAGS
) -o
$@ testi18n.o libcups.a \
469 $(LIBGSSAPI
) $(SSLLIBS
) $(COMMONLIBS
) $(LIBZ
)
470 echo Running internationalization API tests...
475 # testlang (dependency on static CUPS library is intentional)
478 testlang
: testlang.o libcups.a
480 $(CC
) $(ARCHFLAGS
) $(LDFLAGS
) -o
$@ testlang.o libcups.a \
481 $(LIBGSSAPI
) $(SSLLIBS
) $(COMMONLIBS
) $(LIBZ
)
482 echo Running language API tests...
487 # testoptions (dependency on static CUPS library is intentional)
490 testoptions
: testoptions.o libcups.a
492 $(CC
) $(ARCHFLAGS
) $(LDFLAGS
) -o
$@ testoptions.o libcups.a \
493 $(LIBGSSAPI
) $(SSLLIBS
) $(COMMONLIBS
) $(LIBZ
)
494 echo Running option API tests...
499 # testppd (dependency on static CUPS library is intentional)
502 testppd
: testppd.o libcups.a
504 $(CC
) $(ARCHFLAGS
) $(LDFLAGS
) -o
$@ testppd.o libcups.a \
505 $(LIBGSSAPI
) $(SSLLIBS
) $(COMMONLIBS
) $(LIBZ
)
506 echo Running PPD API tests...
511 # testsnmp (dependency on static CUPS library is intentional)
514 testsnmp
: testsnmp.o libcups.a
516 $(CC
) $(LDFLAGS
) -o
$@ testsnmp.o libcups.a \
517 $(LIBGSSAPI
) $(SSLLIBS
) $(COMMONLIBS
) $(LIBZ
)
521 # Automatic API help files...
525 echo Generating CUPS API help files...
526 mxmldoc
--section
"Programming" \
527 --title
"Introduction to CUPS Programming" \
528 --css ..
/doc
/cups-printable.css \
529 --header api-overview.header
--intro api-overview.shtml \
530 >..
/doc
/help
/api-overview.html
531 mxmldoc
--section
"Programming" --title
"Array API" \
532 --css ..
/doc
/cups-printable.css \
533 --header api-array.header
--intro api-array.shtml \
534 array.h array.c
>..
/doc
/help
/api-array.html
535 mxmldoc
--section
"Programming" --title
"CUPS API" \
536 --css ..
/doc
/cups-printable.css \
537 --header api-cups.header
--intro api-cups.shtml \
538 cups.h dest.c language.c notify.c \
539 options.c tempfile.c usersys.c \
540 util.c
>..
/doc
/help
/api-cups.html
541 mxmldoc
--section
"Programming" --title
"File and Directory APIs" \
542 --css ..
/doc
/cups-printable.css \
543 --header api-filedir.header
--intro api-filedir.shtml \
544 file.h file.c
dir.h
dir.c
>..
/doc
/help
/api-filedir.html
545 mxmldoc
--section
"Programming" --title
"PPD API" \
546 --css ..
/doc
/cups-printable.css \
547 --header api-ppd.header
--intro api-ppd.shtml \
548 ppd.h attr.c conflicts.c custom.c emit.c localize.c mark.c page.c \
549 ppd.c
>..
/doc
/help
/api-ppd.html
550 mxmldoc
--section
"Programming" --title
"HTTP and IPP APIs" \
551 --css ..
/doc
/cups-printable.css \
552 --header api-httpipp.header
--intro api-httpipp.shtml \
553 http.h ipp.h auth.c getdevices.c getputfile.c encode.c \
554 http.c http-addr.c http-support.c ipp.c ipp-support.c \
555 md5passwd.c request.c
>..
/doc
/help
/api-httpipp.html
556 mxmldoc
--section
"Programming" \
557 --title
"Filter and Backend Programming" \
558 --css ..
/doc
/cups-printable.css \
559 --header api-filter.header
--intro api-filter.shtml \
560 backchannel.c backend.h backend.c sidechannel.c sidechannel.h \
561 >..
/doc
/help
/api-filter.html
564 echo Generating CUPS API help files...
565 mxmldoc
--framed api-overview \
566 --section
"Programming" \
567 --title
"Introduction to CUPS Programming" \
568 --css ..
/doc
/cups-printable.css \
569 --header api-overview.header
--intro api-overview.shtml
570 mxmldoc
--framed api-array \
571 --section
"Programming" --title
"Array API" \
572 --css ..
/doc
/cups-printable.css \
573 --header api-array.header
--intro api-array.shtml \
575 mxmldoc
--framed api-cups \
576 --section
"Programming" --title
"CUPS API" \
577 --css ..
/doc
/cups-printable.css \
578 --header api-cups.header
--intro api-cups.shtml \
579 cups.h dest.c language.c notify.c \
580 options.c tempfile.c usersys.c \
582 mxmldoc
--framed api-filedir \
583 --section
"Programming" --title
"File and Directory APIs" \
584 --css ..
/doc
/cups-printable.css \
585 --header api-filedir.header
--intro api-filedir.shtml \
586 file.h file.c
dir.h
dir.c
587 mxmldoc
--framed api-ppd \
588 --section
"Programming" --title
"PPD API" \
589 --css ..
/doc
/cups-printable.css \
590 --header api-ppd.header
--intro api-ppd.shtml \
591 ppd.h attr.c conflicts.c custom.c emit.c localize.c mark.c \
593 mxmldoc
--framed api-httpipp \
594 --section
"Programming" --title
"HTTP and IPP APIs" \
595 --css ..
/doc
/cups-printable.css \
596 --header api-httpipp.header
--intro api-httpipp.shtml \
597 http.h ipp.h auth.c getdevices.c getputfile.c encode.c \
598 http.c http-addr.c http-support.c ipp.c ipp-support.c \
599 md5passwd.c request.c
600 mxmldoc
--framed api-filter \
601 --section
"Programming" \
602 --title
"Filter and Backend Programming" \
603 --css ..
/doc
/cups-printable.css \
604 --header api-filter.header
--intro api-filter.shtml \
605 backchannel.c backend.h backend.c sidechannel.c sidechannel.h
616 # End of "$Id: Makefile 7589 2008-05-19 00:13:23Z mike $".