2 # "$Id: Makefile 7871 2008-08-27 21:12:43Z mike $"
4 # API library Makefile for CUPS.
6 # Copyright 2007-2010 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.
72 LIB32OBJS
= $(LIBOBJS
:.o
=.32.o
)
73 LIB64OBJS
= $(LIBOBJS
:.o
=.64.o
)
95 # Header files to install...
130 # Targets in this directory...
159 # Make all targets...
166 # Make library targets...
176 unittests
: $(UNITTARGETS
)
180 # Remove object and target files...
184 $(RM
) $(OBJS
) $(TARGETS
) $(UNITTARGETS
)
185 $(RM
) libcups.so libcups.sl libcups.dylib
190 # Update dependencies (without system header dependencies...)
194 touch Dependencies.tmp
195 makedepend
-Y
-I..
-fDependencies.tmp
$(OBJS
:.o
=.c
) >/dev
/null
2>&1
197 cp Dependencies.tmp Dependencies
198 sed
-E
-e
'1,$$s/^([^.]+)\.o:/\1\.32.o: \1\.c /' Dependencies.tmp
>>Dependencies
199 sed
-E
-e
'1,$$s/^([^.]+)\.o:/\1\.64.o: \1\.c /' Dependencies.tmp
>>Dependencies
200 $(RM
) Dependencies.tmp
204 # Install all targets...
207 install: all install-data install-headers install-libs install-exec
211 # Install data files...
218 # Install programs...
229 echo Installing header files into
$(INCLUDEDIR
)/cups...
230 $(INSTALL_DIR
) -m
755 $(INCLUDEDIR
)/cups
231 for file in
$(HEADERS
); do \
232 $(INSTALL_DATA
) $$file $(INCLUDEDIR
)/cups
; \
234 if
test "x$(privateinclude)" != x
; then \
235 echo Installing private header files into
$(PRIVATEINCLUDE
)...
; \
236 $(INSTALL_DIR
) -m
755 $(PRIVATEINCLUDE
); \
237 for file in
$(HEADERSPRIV
); do \
238 $(INSTALL_DATA
) $$file $(PRIVATEINCLUDE
)/$$file; \
244 # Install libraries...
247 install-libs
: $(INSTALLSTATIC
) $(INSTALL32
) $(INSTALL64
)
248 echo Installing libraries in
$(LIBDIR
)...
249 $(INSTALL_DIR
) -m
755 $(LIBDIR
)
250 $(INSTALL_LIB
) $(LIBCUPS
) $(LIBDIR
)
251 if
test $(LIBCUPS
) = "libcups.so.2" -o
$(LIBCUPS
) = "libcups.sl.2"; then \
252 $(RM
) $(LIBDIR
)/`basename $(LIBCUPS) .2`; \
253 $(LN
) $(LIBCUPS
) $(LIBDIR
)/`basename $(LIBCUPS) .2`; \
255 if
test $(LIBCUPS
) = "libcups.2.dylib"; then \
256 $(RM
) $(LIBDIR
)/libcups.dylib
; \
257 $(LN
) $(LIBCUPS
) $(LIBDIR
)/libcups.dylib
; \
259 if
test "x$(SYMROOT)" != "x"; then \
260 $(INSTALL_DIR
) $(SYMROOT
); \
261 cp
$(LIBCUPS
) $(SYMROOT
); \
265 $(INSTALL_DIR
) -m
755 $(LIBDIR
)
266 $(INSTALL_LIB
) -m
755 $(LIBCUPSSTATIC
) $(LIBDIR
)
267 $(RANLIB
) $(LIBDIR
)/$(LIBCUPSSTATIC
)
268 $(CHMOD
) 555 $(LIBDIR
)/$(LIBCUPSSTATIC
)
271 echo Installing libraries in
$(LIB32DIR
)...
272 $(INSTALL_DIR
) -m
755 $(LIB32DIR
)
273 $(INSTALL_LIB
) 32bit
/libcups.so
.2 $(LIB32DIR
)/libcups.so
.2
274 $(LN
) libcups.so
.2 $(LIB32DIR
)/libcups.so
277 echo Installing libraries in
$(LIB64DIR
)...
278 $(INSTALL_DIR
) -m
755 $(LIB64DIR
)
279 $(INSTALL_LIB
) 64bit
/libcups.so
.2 $(LIB64DIR
)/libcups.so
.2
280 $(LN
) libcups.so
.2 $(LIB64DIR
)/libcups.so
284 # Uninstall object and target files...
287 uninstall: $(UNINSTALL32
) $(UNINSTALL64
)
288 $(RM
) $(LIBDIR
)/libcups
.2.dylib
289 $(RM
) $(LIBDIR
)/$(LIBCUPSSTATIC
)
290 $(RM
) $(LIBDIR
)/libcups.dylib
291 $(RM
) $(LIBDIR
)/libcups_s.a
292 $(RM
) $(LIBDIR
)/libcups.sl
293 $(RM
) $(LIBDIR
)/libcups.sl
.2
294 $(RM
) $(LIBDIR
)/libcups.so
295 $(RM
) $(LIBDIR
)/libcups.so
.2
297 for file in
$(HEADERS
); do \
298 $(RM
) $(INCLUDEDIR
)/cups
/$$file; \
300 -$(RMDIR
) $(INCLUDEDIR
)/cups
303 $(RM
) $(LIB32DIR
)/libcups.so
304 $(RM
) $(LIB32DIR
)/libcups.so
.2
305 -$(RMDIR
) $(LIB32DIR
)
308 $(RM
) $(LIB64DIR
)/libcups.so
309 $(RM
) $(LIB64DIR
)/libcups.so
.2
310 -$(RMDIR
) $(LIB64DIR
)
314 # libcups.so.2, libcups.sl.2
317 libcups.so
.2 libcups.sl
.2: $(LIBOBJS
)
319 $(DSO
) $(ARCHFLAGS
) $(DSOFLAGS
) -o
$@
$(LIBOBJS
) $(LIBGSSAPI
) \
320 $(SSLLIBS
) $(DNSSDLIBS
) $(COMMONLIBS
) $(LIBZ
)
321 $(RM
) `basename $@ .2`
322 $(LN
) $@
`basename $@ .2`
329 32bit
/libcups.so
.2: $(LIB32OBJS
)
330 echo Linking
32-bit
$@...
332 $(DSO
) $(ARCH32FLAGS
) $(DSO32FLAGS
) -o
$@
$(LIB32OBJS
) $(LIBGSSAPI
) \
333 $(DNSSDLIBS
) $(SSLLIBS
) $(COMMONLIBS
) $(LIBZ
)
334 $(RM
) 32bit
/libcups.so
335 $(LN
) libcups.so
.2 32bit
/libcups.so
342 64bit
/libcups.so
.2: $(LIB64OBJS
)
343 echo Linking
64-bit
$@...
345 $(DSO
) $(ARCH64FLAGS
) $(DSO64FLAGS
) -o
$@
$(LIB64OBJS
) $(LIBGSSAPI
) \
346 $(DNSSDLIBS
) $(SSLLIBS
) $(COMMONLIBS
) $(LIBZ
)
347 $(RM
) 64bit
/libcups.so
348 $(LN
) libcups.so
.2 64bit
/libcups.so
355 libcups
.2.dylib
: $(LIBOBJS
) $(LIBCUPSORDER
)
356 echo Creating
export list for
$@...
357 nm
$(LIBOBJS
) 2>/dev
/null | grep
"T _" | awk
'{print $$3}' | \
358 grep
-v
-e
'^(_cupsConnect|_cupsSetDefaults|_cupsSetHTTPError|_cupsUserDefault|_httpWait)$$' | \
361 $(DSO
) $(ARCHFLAGS
) $(DSOFLAGS
) -o
$@ \
362 -install_name
$(libdir)/$@ \
363 -current_version
2.8.0 \
364 -compatibility_version
2.0.0 \
365 -exported_symbols_list t.exp \
366 -sectorder __TEXT __text
$(LIBCUPSORDER
) \
367 $(LIBOBJS
) $(LIBGSSAPI
) $(SSLLIBS
) $(DNSSDLIBS
) \
368 $(COMMONLIBS
) $(LIBZ
)
369 $(RM
) libcups.dylib t.exp
370 $(LN
) $@ libcups.dylib
377 libcups_s.a
: $(LIBOBJS
) libcups_s.exp
379 $(DSO
) $(DSOFLAGS
) -Wl
,-bexport
:libcups_s.exp
-o libcups_s.o \
380 $(LIBOBJS
) $(LIBGSSAPI
) $(SSLLIBS
) $(DNSSDLIBS
) \
381 $(COMMONLIBS
) $(LIBZ
) -lm
383 $(AR
) $(ARFLAGS
) $@ libcups_s.o
390 libcups.la
: $(LIBOBJS
)
392 $(CC
) $(ARCHFLAGS
) $(DSOFLAGS
) -o
$@
$(LIBOBJS
:.o
=.lo
) \
393 -rpath
$(LIBDIR
) -version-info
2:8 $(LIBGSSAPI
) $(SSLLIBS
) \
394 $(DNSSDLIBS
) $(COMMONLIBS
) $(LIBZ
)
401 libcups.a
: $(LIBOBJS
)
404 $(AR
) $(ARFLAGS
) $@
$(LIBOBJS
)
409 # testadmin (dependency on static CUPS library is intentional)
412 testadmin
: testadmin.o
$(LIBCUPSSTATIC
)
414 $(CC
) $(LDFLAGS
) -o
$@ testadmin.o
$(LIBCUPSSTATIC
) \
415 $(LIBGSSAPI
) $(SSLLIBS
) $(DNSSDLIBS
) $(COMMONLIBS
) $(LIBZ
)
419 # testarray (dependency on static CUPS library is intentional)
422 testarray
: testarray.o
$(LIBCUPSSTATIC
)
424 $(CC
) $(ARCHFLAGS
) $(LDFLAGS
) -o
$@ testarray.o
$(LIBCUPSSTATIC
) \
425 $(LIBGSSAPI
) $(SSLLIBS
) $(DNSSDLIBS
) $(COMMONLIBS
) $(LIBZ
)
426 echo Running array API tests...
431 # testconflicts (dependency on static CUPS library is intentional)
434 testconflicts
: testconflicts.o
$(LIBCUPSSTATIC
)
436 $(CC
) $(LDFLAGS
) -o
$@ testconflicts.o
$(LIBCUPSSTATIC
) \
437 $(LIBGSSAPI
) $(SSLLIBS
) $(DNSSDLIBS
) $(COMMONLIBS
) $(LIBZ
)
441 # testcups (dependency on static CUPS library is intentional)
444 testcups
: testcups.o
$(LIBCUPSSTATIC
)
446 $(CC
) $(LDFLAGS
) -o
$@ testcups.o
$(LIBCUPSSTATIC
) \
447 $(LIBGSSAPI
) $(SSLLIBS
) $(DNSSDLIBS
) $(COMMONLIBS
) $(LIBZ
)
451 # testfile (dependency on static CUPS library is intentional)
454 testfile
: testfile.o
$(LIBCUPSSTATIC
)
456 $(CC
) $(ARCHFLAGS
) $(LDFLAGS
) -o
$@ testfile.o
$(LIBCUPSSTATIC
) \
457 $(LIBGSSAPI
) $(SSLLIBS
) $(DNSSDLIBS
) $(COMMONLIBS
) $(LIBZ
)
458 echo Running file API tests...
463 # testhttp (dependency on static CUPS library is intentional)
466 testhttp
: testhttp.o
$(LIBCUPSSTATIC
)
468 $(CC
) $(ARCHFLAGS
) $(LDFLAGS
) -o
$@ testhttp.o
$(LIBCUPSSTATIC
) \
469 $(LIBGSSAPI
) $(SSLLIBS
) $(DNSSDLIBS
) $(COMMONLIBS
) $(LIBZ
)
470 echo Running HTTP API tests...
475 # testipp (dependency on static CUPS library is intentional)
478 testipp
: testipp.o
$(LIBCUPSSTATIC
)
480 $(CC
) $(ARCHFLAGS
) $(LDFLAGS
) -o
$@ testipp.o
$(LIBCUPSSTATIC
) \
481 $(LIBGSSAPI
) $(SSLLIBS
) $(DNSSDLIBS
) $(COMMONLIBS
) $(LIBZ
)
482 echo Running IPP API tests...
487 # testi18n (dependency on static CUPS library is intentional)
490 testi18n
: testi18n.o
$(LIBCUPSSTATIC
)
492 $(CC
) $(ARCHFLAGS
) $(LDFLAGS
) -o
$@ testi18n.o
$(LIBCUPSSTATIC
) \
493 $(LIBGSSAPI
) $(SSLLIBS
) $(DNSSDLIBS
) $(COMMONLIBS
) $(LIBZ
)
494 echo Running internationalization API tests...
499 # testlang (dependency on static CUPS library is intentional)
502 testlang
: testlang.o
$(LIBCUPSSTATIC
)
504 $(CC
) $(ARCHFLAGS
) $(LDFLAGS
) -o
$@ testlang.o
$(LIBCUPSSTATIC
) \
505 $(LIBGSSAPI
) $(SSLLIBS
) $(DNSSDLIBS
) $(COMMONLIBS
) $(LIBZ
)
506 echo Running language API tests...
511 # testoptions (dependency on static CUPS library is intentional)
514 testoptions
: testoptions.o
$(LIBCUPSSTATIC
)
516 $(CC
) $(ARCHFLAGS
) $(LDFLAGS
) -o
$@ testoptions.o
$(LIBCUPSSTATIC
) \
517 $(LIBGSSAPI
) $(SSLLIBS
) $(DNSSDLIBS
) $(COMMONLIBS
) $(LIBZ
)
518 echo Running option API tests...
523 # testppd (dependency on static CUPS library is intentional)
526 testppd
: testppd.o
$(LIBCUPSSTATIC
) test.ppd test2.ppd
528 $(CC
) $(ARCHFLAGS
) $(LDFLAGS
) -o
$@ testppd.o
$(LIBCUPSSTATIC
) \
529 $(LIBGSSAPI
) $(SSLLIBS
) $(DNSSDLIBS
) $(COMMONLIBS
) $(LIBZ
)
530 echo Running PPD API tests...
535 # testpwg (dependency on static CUPS library is intentional)
538 testpwg
: testpwg.o
$(LIBCUPSSTATIC
) test.ppd
540 $(CC
) $(ARCHFLAGS
) $(LDFLAGS
) -o
$@ testpwg.o
$(LIBCUPSSTATIC
) \
541 $(LIBGSSAPI
) $(SSLLIBS
) $(DNSSDLIBS
) $(COMMONLIBS
) $(LIBZ
)
542 echo Running PWG API tests...
547 # testsnmp (dependency on static CUPS library is intentional)
550 testsnmp
: testsnmp.o
$(LIBCUPSSTATIC
)
552 $(CC
) $(LDFLAGS
) -o
$@ testsnmp.o
$(LIBCUPSSTATIC
) \
553 $(LIBGSSAPI
) $(SSLLIBS
) $(DNSSDLIBS
) $(COMMONLIBS
) $(LIBZ
)
557 # Automatic API help files...
561 echo Generating CUPS API help files...
562 mxmldoc
--section
"Programming" \
563 --title
"Introduction to CUPS Programming" \
564 --css ..
/doc
/cups-printable.css \
565 --header api-overview.header
--intro api-overview.shtml \
566 >..
/doc
/help
/api-overview.html
567 mxmldoc
--section
"Programming" --title
"Array API" \
568 --css ..
/doc
/cups-printable.css \
569 --header api-array.header
--intro api-array.shtml \
571 array.h array.c
>..
/doc
/help
/api-array.html
572 mxmldoc
--tokens help
/api-array.html api-array.xml
>..
/doc
/help
/api-array.tokens
574 mxmldoc
--section
"Programming" --title
"CUPS API" \
575 --css ..
/doc
/cups-printable.css \
576 --header api-cups.header
--intro api-cups.shtml \
578 cups.h adminutil.c dest.c language.c notify.c \
579 options.c tempfile.c usersys.c \
580 util.c
>..
/doc
/help
/api-cups.html
581 mxmldoc
--tokens help
/api-cups.html api-cups.xml
>..
/doc
/help
/api-cups.tokens
583 mxmldoc
--section
"Programming" --title
"File and Directory APIs" \
584 --css ..
/doc
/cups-printable.css \
585 --header api-filedir.header
--intro api-filedir.shtml \
587 file.h file.c
dir.h
dir.c
>..
/doc
/help
/api-filedir.html
588 mxmldoc
--tokens api-filedir.xml
>..
/doc
/help
/api-filedir.tokens
589 $(RM
) api-filedir.xml
590 mxmldoc
--section
"Programming" --title
"PPD API" \
591 --css ..
/doc
/cups-printable.css \
592 --header api-ppd.header
--intro api-ppd.shtml \
594 ppd.h attr.c conflicts.c custom.c emit.c localize.c mark.c page.c \
595 ppd.c
>..
/doc
/help
/api-ppd.html
596 mxmldoc
--tokens help
/api-ppd.html api-ppd.xml
>..
/doc
/help
/api-ppd.tokens
598 mxmldoc
--section
"Programming" --title
"HTTP and IPP APIs" \
599 --css ..
/doc
/cups-printable.css \
600 --header api-httpipp.header
--intro api-httpipp.shtml \
602 http.h ipp.h auth.c getdevices.c getputfile.c encode.c \
603 http.c http-addr.c http-support.c ipp.c ipp-support.c \
604 md5passwd.c request.c
>..
/doc
/help
/api-httpipp.html
605 mxmldoc
--tokens help
/api-httpipp.html api-httpipp.xml
>..
/doc
/help
/api-httpipp.tokens
606 $(RM
) api-httpipp.xml
607 mxmldoc
--section
"Programming" \
608 --title
"Filter and Backend Programming" \
609 --css ..
/doc
/cups-printable.css \
610 --header api-filter.header
--intro api-filter.shtml \
612 backchannel.c backend.h backend.c sidechannel.c sidechannel.h \
613 >..
/doc
/help
/api-filter.html
614 mxmldoc
--tokens help
/api-filter.html api-filter.xml
>..
/doc
/help
/api-filter.tokens
618 echo Generating CUPS API help files...
619 mxmldoc
--framed api-overview \
620 --section
"Programming" \
621 --title
"Introduction to CUPS Programming" \
622 --css ..
/doc
/cups-printable.css \
623 --header api-overview.header
--intro api-overview.shtml
624 mxmldoc
--framed api-array \
625 --section
"Programming" --title
"Array API" \
626 --css ..
/doc
/cups-printable.css \
627 --header api-array.header
--intro api-array.shtml \
629 mxmldoc
--framed api-cups \
630 --section
"Programming" --title
"CUPS API" \
631 --css ..
/doc
/cups-printable.css \
632 --header api-cups.header
--intro api-cups.shtml \
633 cups.h adminutil.c dest.c language.c notify.c \
634 options.c tempfile.c usersys.c \
636 mxmldoc
--framed api-filedir \
637 --section
"Programming" --title
"File and Directory APIs" \
638 --css ..
/doc
/cups-printable.css \
639 --header api-filedir.header
--intro api-filedir.shtml \
640 file.h file.c
dir.h
dir.c
641 mxmldoc
--framed api-ppd \
642 --section
"Programming" --title
"PPD API" \
643 --css ..
/doc
/cups-printable.css \
644 --header api-ppd.header
--intro api-ppd.shtml \
645 ppd.h attr.c conflicts.c custom.c emit.c localize.c mark.c \
647 mxmldoc
--framed api-httpipp \
648 --section
"Programming" --title
"HTTP and IPP APIs" \
649 --css ..
/doc
/cups-printable.css \
650 --header api-httpipp.header
--intro api-httpipp.shtml \
651 http.h ipp.h auth.c getdevices.c getputfile.c encode.c \
652 http.c http-addr.c http-support.c ipp.c ipp-support.c \
653 md5passwd.c request.c
654 mxmldoc
--framed api-filter \
655 --section
"Programming" \
656 --title
"Filter and Backend Programming" \
657 --css ..
/doc
/cups-printable.css \
658 --header api-filter.header
--intro api-filter.shtml \
659 backchannel.c backend.h backend.c sidechannel.c sidechannel.h
670 # End of "$Id: Makefile 7871 2008-08-27 21:12:43Z mike $".