2 # "$Id: Makefile 7871 2008-08-27 21:12:43Z mike $"
4 # API library Makefile for CUPS.
6 # Copyright 2007-2012 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.
89 LIB32OBJS
= $(LIBOBJS
:.o
=.32.o
)
90 LIB64OBJS
= $(LIBOBJS
:.o
=.64.o
)
99 # Header files to install...
136 # Targets in this directory...
165 # Make all targets...
172 # Make library targets...
182 unittests
: $(UNITTARGETS
)
186 # Remove object and target files...
190 $(RM
) $(OBJS
) $(TARGETS
) $(UNITTARGETS
)
191 $(RM
) libcups.so libcups.sl libcups.dylib
196 # Update dependencies (without system header dependencies...)
200 touch Dependencies.tmp
201 makedepend
-Y
-I..
-fDependencies.tmp
$(LIBOBJS
:.o
=.c
) $(TESTOBJS
:.o
=.c
) >/dev
/null
2>&1
203 cp Dependencies.tmp Dependencies
204 sed
-E
-e
'1,$$s/^([^.]+)\.o:/\1\.32.o: \1\.c /' Dependencies.tmp
>>Dependencies
205 sed
-E
-e
'1,$$s/^([^.]+)\.o:/\1\.64.o: \1\.c /' Dependencies.tmp
>>Dependencies
206 $(RM
) Dependencies.tmp
210 # Install all targets...
213 install: all install-data install-headers install-libs install-exec
217 # Install data files...
224 # Install programs...
235 echo Installing header files into
$(INCLUDEDIR
)/cups...
236 $(INSTALL_DIR
) -m
755 $(INCLUDEDIR
)/cups
237 for file in
$(HEADERS
); do \
238 $(INSTALL_DATA
) $$file $(INCLUDEDIR
)/cups
; \
240 if
test "x$(privateinclude)" != x
; then \
241 echo Installing private header files into
$(PRIVATEINCLUDE
)...
; \
242 $(INSTALL_DIR
) -m
755 $(PRIVATEINCLUDE
); \
243 for file in
$(HEADERSPRIV
); do \
244 $(INSTALL_DATA
) $$file $(PRIVATEINCLUDE
)/$$file; \
250 # Install libraries...
253 install-libs
: $(INSTALLSTATIC
) $(INSTALL32
) $(INSTALL64
)
254 echo Installing libraries in
$(LIBDIR
)...
255 $(INSTALL_DIR
) -m
755 $(LIBDIR
)
256 $(INSTALL_LIB
) $(LIBCUPS
) $(LIBDIR
)
257 if
test $(LIBCUPS
) = "libcups.so.2" -o
$(LIBCUPS
) = "libcups.sl.2"; then \
258 $(RM
) $(LIBDIR
)/`basename $(LIBCUPS) .2`; \
259 $(LN
) $(LIBCUPS
) $(LIBDIR
)/`basename $(LIBCUPS) .2`; \
261 if
test $(LIBCUPS
) = "libcups.2.dylib"; then \
262 $(RM
) $(LIBDIR
)/libcups.dylib
; \
263 $(LN
) $(LIBCUPS
) $(LIBDIR
)/libcups.dylib
; \
265 if
test "x$(SYMROOT)" != "x"; then \
266 $(INSTALL_DIR
) $(SYMROOT
); \
267 cp
$(LIBCUPS
) $(SYMROOT
); \
271 $(INSTALL_DIR
) -m
755 $(LIBDIR
)
272 $(INSTALL_LIB
) -m
755 $(LIBCUPSSTATIC
) $(LIBDIR
)
273 $(RANLIB
) $(LIBDIR
)/$(LIBCUPSSTATIC
)
274 $(CHMOD
) 555 $(LIBDIR
)/$(LIBCUPSSTATIC
)
277 echo Installing libraries in
$(LIB32DIR
)...
278 $(INSTALL_DIR
) -m
755 $(LIB32DIR
)
279 $(INSTALL_LIB
) 32bit
/libcups.so
.2 $(LIB32DIR
)/libcups.so
.2
280 $(LN
) libcups.so
.2 $(LIB32DIR
)/libcups.so
283 echo Installing libraries in
$(LIB64DIR
)...
284 $(INSTALL_DIR
) -m
755 $(LIB64DIR
)
285 $(INSTALL_LIB
) 64bit
/libcups.so
.2 $(LIB64DIR
)/libcups.so
.2
286 $(LN
) libcups.so
.2 $(LIB64DIR
)/libcups.so
290 # Uninstall object and target files...
293 uninstall: $(UNINSTALL32
) $(UNINSTALL64
)
294 $(RM
) $(LIBDIR
)/libcups
.2.dylib
295 $(RM
) $(LIBDIR
)/$(LIBCUPSSTATIC
)
296 $(RM
) $(LIBDIR
)/libcups.dylib
297 $(RM
) $(LIBDIR
)/libcups_s.a
298 $(RM
) $(LIBDIR
)/libcups.sl
299 $(RM
) $(LIBDIR
)/libcups.sl
.2
300 $(RM
) $(LIBDIR
)/libcups.so
301 $(RM
) $(LIBDIR
)/libcups.so
.2
303 for file in
$(HEADERS
); do \
304 $(RM
) $(INCLUDEDIR
)/cups
/$$file; \
306 -$(RMDIR
) $(INCLUDEDIR
)/cups
309 $(RM
) $(LIB32DIR
)/libcups.so
310 $(RM
) $(LIB32DIR
)/libcups.so
.2
311 -$(RMDIR
) $(LIB32DIR
)
314 $(RM
) $(LIB64DIR
)/libcups.so
315 $(RM
) $(LIB64DIR
)/libcups.so
.2
316 -$(RMDIR
) $(LIB64DIR
)
320 # libcups.so.2, libcups.sl.2
323 libcups.so
.2 libcups.sl
.2: $(LIBOBJS
)
325 $(DSO
) $(ARCHFLAGS
) $(DSOFLAGS
) -o
$@
$(LIBOBJS
) $(LIBGSSAPI
) \
326 $(SSLLIBS
) $(DNSSDLIBS
) $(COMMONLIBS
) $(LIBZ
)
327 $(RM
) `basename $@ .2`
328 $(LN
) $@
`basename $@ .2`
335 32bit
/libcups.so
.2: $(LIB32OBJS
)
336 echo Linking
32-bit
$@...
338 $(DSO
) $(ARCH32FLAGS
) $(DSO32FLAGS
) -o
$@
$(LIB32OBJS
) $(LIBGSSAPI
) \
339 $(DNSSDLIBS
) $(SSLLIBS
) $(COMMONLIBS
) $(LIBZ
)
340 $(RM
) 32bit
/libcups.so
341 $(LN
) libcups.so
.2 32bit
/libcups.so
348 64bit
/libcups.so
.2: $(LIB64OBJS
)
349 echo Linking
64-bit
$@...
351 $(DSO
) $(ARCH64FLAGS
) $(DSO64FLAGS
) -o
$@
$(LIB64OBJS
) $(LIBGSSAPI
) \
352 $(DNSSDLIBS
) $(SSLLIBS
) $(COMMONLIBS
) $(LIBZ
)
353 $(RM
) 64bit
/libcups.so
354 $(LN
) libcups.so
.2 64bit
/libcups.so
361 libcups
.2.dylib
: $(LIBOBJS
) $(LIBCUPSORDER
)
362 echo Creating
export list for
$@...
363 nm
$(LIBOBJS
) 2>/dev
/null | grep
"T _" | awk
'{print $$3}' | \
364 grep
-v
-e
'^(_cupsConnect|_cupsCharset|_cupsEncodingName|_cupsSetDefaults|_cupsSetHTTPError|_cupsUserDefault|_httpWait)$$' | \
367 $(DSO
) $(ARCHFLAGS
) $(DSOFLAGS
) -o
$@ \
368 -install_name
$(libdir)/$@ \
369 -current_version
2.9.0 \
370 -compatibility_version
2.0.0 \
371 -exported_symbols_list t.exp \
372 $(LIBOBJS
) $(LIBGSSAPI
) $(SSLLIBS
) $(DNSSDLIBS
) \
373 $(COMMONLIBS
) $(LIBZ
)
374 $(RM
) libcups.dylib t.exp
375 $(LN
) $@ libcups.dylib
382 libcups_s.a
: $(LIBOBJS
) libcups_s.exp
384 $(DSO
) $(DSOFLAGS
) -Wl
,-bexport
:libcups_s.exp
-o libcups_s.o \
385 $(LIBOBJS
) $(LIBGSSAPI
) $(SSLLIBS
) $(DNSSDLIBS
) \
386 $(COMMONLIBS
) $(LIBZ
)
388 $(AR
) $(ARFLAGS
) $@ libcups_s.o
395 libcups.la
: $(LIBOBJS
)
397 $(CC
) $(ARCHFLAGS
) $(DSOFLAGS
) -o
$@
$(LIBOBJS
:.o
=.lo
) \
398 -rpath
$(LIBDIR
) -version-info
2:9 $(LIBGSSAPI
) $(SSLLIBS
) \
399 $(DNSSDLIBS
) $(COMMONLIBS
) $(LIBZ
)
406 libcups.a
: $(LIBOBJS
)
409 $(AR
) $(ARFLAGS
) $@
$(LIBOBJS
)
414 # testadmin (dependency on static CUPS library is intentional)
417 testadmin
: testadmin.o
$(LIBCUPSSTATIC
)
419 $(CC
) $(LDFLAGS
) -o
$@ testadmin.o
$(LIBCUPSSTATIC
) \
420 $(LIBGSSAPI
) $(SSLLIBS
) $(DNSSDLIBS
) $(COMMONLIBS
) $(LIBZ
)
424 # testarray (dependency on static CUPS library is intentional)
427 testarray
: testarray.o
$(LIBCUPSSTATIC
)
429 $(CC
) $(ARCHFLAGS
) $(LDFLAGS
) -o
$@ testarray.o
$(LIBCUPSSTATIC
) \
430 $(LIBGSSAPI
) $(SSLLIBS
) $(DNSSDLIBS
) $(COMMONLIBS
) $(LIBZ
)
431 echo Running array API tests...
436 # testconflicts (dependency on static CUPS library is intentional)
439 testconflicts
: testconflicts.o
$(LIBCUPSSTATIC
)
441 $(CC
) $(LDFLAGS
) -o
$@ testconflicts.o
$(LIBCUPSSTATIC
) \
442 $(LIBGSSAPI
) $(SSLLIBS
) $(DNSSDLIBS
) $(COMMONLIBS
) $(LIBZ
)
446 # testcups (dependency on static CUPS library is intentional)
449 testcups
: testcups.o
$(LIBCUPSSTATIC
)
451 $(CC
) $(LDFLAGS
) -o
$@ testcups.o
$(LIBCUPSSTATIC
) \
452 $(LIBGSSAPI
) $(SSLLIBS
) $(DNSSDLIBS
) $(COMMONLIBS
) $(LIBZ
)
456 # testfile (dependency on static CUPS library is intentional)
459 testfile
: testfile.o
$(LIBCUPSSTATIC
)
461 $(CC
) $(ARCHFLAGS
) $(LDFLAGS
) -o
$@ testfile.o
$(LIBCUPSSTATIC
) \
462 $(LIBGSSAPI
) $(SSLLIBS
) $(DNSSDLIBS
) $(COMMONLIBS
) $(LIBZ
)
463 echo Running file API tests...
468 # testhttp (dependency on static CUPS library is intentional)
471 testhttp
: testhttp.o
$(LIBCUPSSTATIC
)
473 $(CC
) $(ARCHFLAGS
) $(LDFLAGS
) -o
$@ testhttp.o
$(LIBCUPSSTATIC
) \
474 $(LIBGSSAPI
) $(SSLLIBS
) $(DNSSDLIBS
) $(COMMONLIBS
) $(LIBZ
)
475 echo Running HTTP API tests...
480 # testipp (dependency on static CUPS library is intentional)
483 testipp
: testipp.o
$(LIBCUPSSTATIC
)
485 $(CC
) $(ARCHFLAGS
) $(LDFLAGS
) -o
$@ testipp.o
$(LIBCUPSSTATIC
) \
486 $(LIBGSSAPI
) $(SSLLIBS
) $(DNSSDLIBS
) $(COMMONLIBS
) $(LIBZ
)
487 echo Running IPP API tests...
492 # testi18n (dependency on static CUPS library is intentional)
495 testi18n
: testi18n.o
$(LIBCUPSSTATIC
)
497 $(CC
) $(ARCHFLAGS
) $(LDFLAGS
) -o
$@ testi18n.o
$(LIBCUPSSTATIC
) \
498 $(LIBGSSAPI
) $(SSLLIBS
) $(DNSSDLIBS
) $(COMMONLIBS
) $(LIBZ
)
499 echo Running internationalization API tests...
504 # testlang (dependency on static CUPS library is intentional)
507 testlang
: testlang.o
$(LIBCUPSSTATIC
)
509 $(CC
) $(ARCHFLAGS
) $(LDFLAGS
) -o
$@ testlang.o
$(LIBCUPSSTATIC
) \
510 $(LIBGSSAPI
) $(SSLLIBS
) $(DNSSDLIBS
) $(COMMONLIBS
) $(LIBZ
)
511 echo Running language API tests...
516 # testoptions (dependency on static CUPS library is intentional)
519 testoptions
: testoptions.o
$(LIBCUPSSTATIC
)
521 $(CC
) $(ARCHFLAGS
) $(LDFLAGS
) -o
$@ testoptions.o
$(LIBCUPSSTATIC
) \
522 $(LIBGSSAPI
) $(SSLLIBS
) $(DNSSDLIBS
) $(COMMONLIBS
) $(LIBZ
)
523 echo Running option API tests...
528 # testppd (dependency on static CUPS library is intentional)
531 testppd
: testppd.o
$(LIBCUPSSTATIC
) test.ppd test2.ppd
533 $(CC
) $(ARCHFLAGS
) $(LDFLAGS
) -o
$@ testppd.o
$(LIBCUPSSTATIC
) \
534 $(LIBGSSAPI
) $(SSLLIBS
) $(DNSSDLIBS
) $(COMMONLIBS
) $(LIBZ
)
535 echo Running PPD API tests...
540 # testpwg (dependency on static CUPS library is intentional)
543 testpwg
: testpwg.o
$(LIBCUPSSTATIC
) test.ppd
545 $(CC
) $(ARCHFLAGS
) $(LDFLAGS
) -o
$@ testpwg.o
$(LIBCUPSSTATIC
) \
546 $(LIBGSSAPI
) $(SSLLIBS
) $(DNSSDLIBS
) $(COMMONLIBS
) $(LIBZ
)
547 echo Running PWG API tests...
552 # testsnmp (dependency on static CUPS library is intentional)
555 testsnmp
: testsnmp.o
$(LIBCUPSSTATIC
)
557 $(CC
) $(LDFLAGS
) -o
$@ testsnmp.o
$(LIBCUPSSTATIC
) \
558 $(LIBGSSAPI
) $(SSLLIBS
) $(DNSSDLIBS
) $(COMMONLIBS
) $(LIBZ
)
562 # Automatic API help files...
566 echo Generating CUPS API help files...
567 mxmldoc
--section
"Programming" \
568 --title
"Introduction to CUPS Programming" \
569 --css ..
/doc
/cups-printable.css \
570 --header api-overview.header
--intro api-overview.shtml \
571 >..
/doc
/help
/api-overview.html
572 mxmldoc
--section
"Programming" --title
"Array API" \
573 --css ..
/doc
/cups-printable.css \
574 --header api-array.header
--intro api-array.shtml \
576 array.h array.c
>..
/doc
/help
/api-array.html
577 mxmldoc
--tokens help
/api-array.html api-array.xml
>..
/doc
/help
/api-array.tokens
579 mxmldoc
--section
"Programming" --title
"CUPS API" \
580 --css ..
/doc
/cups-printable.css \
581 --header api-cups.header
--intro api-cups.shtml \
583 cups.h adminutil.c dest.c language.c notify.c \
584 options.c tempfile.c usersys.c \
585 util.c
>..
/doc
/help
/api-cups.html
586 mxmldoc
--tokens help
/api-cups.html api-cups.xml
>..
/doc
/help
/api-cups.tokens
588 mxmldoc
--section
"Programming" --title
"File and Directory APIs" \
589 --css ..
/doc
/cups-printable.css \
590 --header api-filedir.header
--intro api-filedir.shtml \
592 file.h file.c
dir.h
dir.c
>..
/doc
/help
/api-filedir.html
593 mxmldoc
--tokens api-filedir.xml
>..
/doc
/help
/api-filedir.tokens
594 $(RM
) api-filedir.xml
595 mxmldoc
--section
"Programming" --title
"PPD API (DEPRECATED)" \
596 --css ..
/doc
/cups-printable.css \
597 --header api-ppd.header
--intro api-ppd.shtml \
599 ppd.h attr.c conflicts.c custom.c emit.c localize.c mark.c page.c \
600 ppd.c
>..
/doc
/help
/api-ppd.html
601 mxmldoc
--tokens help
/api-ppd.html api-ppd.xml
>..
/doc
/help
/api-ppd.tokens
603 mxmldoc
--section
"Programming" --title
"HTTP and IPP APIs" \
604 --css ..
/doc
/cups-printable.css \
605 --header api-httpipp.header
--intro api-httpipp.shtml \
607 http.h ipp.h auth.c getdevices.c getputfile.c encode.c \
608 http.c http-addr.c http-support.c ipp.c ipp-support.c \
609 md5passwd.c request.c
>..
/doc
/help
/api-httpipp.html
610 mxmldoc
--tokens help
/api-httpipp.html api-httpipp.xml
>..
/doc
/help
/api-httpipp.tokens
611 $(RM
) api-httpipp.xml
612 mxmldoc
--section
"Programming" \
613 --title
"Filter and Backend Programming" \
614 --css ..
/doc
/cups-printable.css \
615 --header api-filter.header
--intro api-filter.shtml \
617 backchannel.c backend.h backend.c sidechannel.c sidechannel.h \
618 >..
/doc
/help
/api-filter.html
619 mxmldoc
--tokens help
/api-filter.html api-filter.xml
>..
/doc
/help
/api-filter.tokens
623 echo Generating CUPS API help files...
624 mxmldoc
--framed api-overview \
625 --section
"Programming" \
626 --title
"Introduction to CUPS Programming" \
627 --css ..
/doc
/cups-printable.css \
628 --header api-overview.header
--intro api-overview.shtml
629 mxmldoc
--framed api-array \
630 --section
"Programming" --title
"Array API" \
631 --css ..
/doc
/cups-printable.css \
632 --header api-array.header
--intro api-array.shtml \
634 mxmldoc
--framed api-cups \
635 --section
"Programming" --title
"CUPS API" \
636 --css ..
/doc
/cups-printable.css \
637 --header api-cups.header
--intro api-cups.shtml \
638 cups.h adminutil.c dest.c language.c notify.c \
639 options.c tempfile.c usersys.c \
641 mxmldoc
--framed api-filedir \
642 --section
"Programming" --title
"File and Directory APIs" \
643 --css ..
/doc
/cups-printable.css \
644 --header api-filedir.header
--intro api-filedir.shtml \
645 file.h file.c
dir.h
dir.c
646 mxmldoc
--framed api-ppd \
647 --section
"Programming" --title
"PPD API (DEPRECATED)" \
648 --css ..
/doc
/cups-printable.css \
649 --header api-ppd.header
--intro api-ppd.shtml \
650 ppd.h attr.c conflicts.c custom.c emit.c localize.c mark.c \
652 mxmldoc
--framed api-httpipp \
653 --section
"Programming" --title
"HTTP and IPP APIs" \
654 --css ..
/doc
/cups-printable.css \
655 --header api-httpipp.header
--intro api-httpipp.shtml \
656 http.h ipp.h auth.c getdevices.c getputfile.c encode.c \
657 http.c http-addr.c http-support.c ipp.c ipp-support.c \
658 md5passwd.c request.c
659 mxmldoc
--framed api-filter \
660 --section
"Programming" \
661 --title
"Filter and Backend Programming" \
662 --css ..
/doc
/cups-printable.css \
663 --header api-filter.header
--intro api-filter.shtml \
664 backchannel.c backend.h backend.c sidechannel.c sidechannel.h
668 # Lines of code computation...
672 echo
"libcupslite: \c"
673 sloccount
$(LITEOBJS
:.o
=.c
) 2>/dev
/null | grep
"Total Physical" | awk
'{print $$9}'
675 sloccount
$(LIBOBJS
:.o
=.c
) 2>/dev
/null | grep
"Total Physical" | awk
'{print $$9}'
686 # End of "$Id: Makefile 7871 2008-08-27 21:12:43Z mike $".