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.
94 # Header files to install...
131 # Targets in this directory...
158 # Make all targets...
165 # Make library targets...
175 unittests
: $(UNITTARGETS
)
179 # Remove object and target files...
183 $(RM
) $(OBJS
) $(TARGETS
) $(UNITTARGETS
)
184 $(RM
) libcups.so libcups.sl libcups.dylib
188 # Update dependencies (without system header dependencies...)
192 $(CC
) -MM
$(ALL_CFLAGS
) $(OBJS
:.o
=.c
) >Dependencies
196 # Install all targets...
199 install: all install-data install-headers install-libs install-exec
203 # Install data files...
210 # Install programs...
221 echo Installing header files into
$(INCLUDEDIR
)/cups...
222 $(INSTALL_DIR
) -m
755 $(INCLUDEDIR
)/cups
223 for file in
$(HEADERS
); do \
224 $(INSTALL_DATA
) $$file $(INCLUDEDIR
)/cups
; \
226 if
test "x$(privateinclude)" != x
; then \
227 echo Installing private header files into
$(PRIVATEINCLUDE
)...
; \
228 $(INSTALL_DIR
) -m
755 $(PRIVATEINCLUDE
); \
229 for file in
$(HEADERSPRIV
); do \
230 $(INSTALL_DATA
) $$file $(PRIVATEINCLUDE
)/$$file; \
236 # Install libraries...
239 install-libs
: $(INSTALLSTATIC
)
240 echo Installing libraries in
$(LIBDIR
)...
241 $(INSTALL_DIR
) -m
755 $(LIBDIR
)
242 $(INSTALL_LIB
) $(LIBCUPS
) $(LIBDIR
)
243 if
test $(LIBCUPS
) = "libcups.so.2" -o
$(LIBCUPS
) = "libcups.sl.2"; then \
244 $(RM
) $(LIBDIR
)/`basename $(LIBCUPS) .2`; \
245 $(LN
) $(LIBCUPS
) $(LIBDIR
)/`basename $(LIBCUPS) .2`; \
247 if
test $(LIBCUPS
) = "libcups.2.dylib"; then \
248 $(RM
) $(LIBDIR
)/libcups.dylib
; \
249 $(LN
) $(LIBCUPS
) $(LIBDIR
)/libcups.dylib
; \
251 if
test "x$(SYMROOT)" != "x"; then \
252 $(INSTALL_DIR
) $(SYMROOT
); \
253 cp
$(LIBCUPS
) $(SYMROOT
); \
254 dsymutil
$(SYMROOT
)/$(LIBCUPS
); \
258 $(INSTALL_DIR
) -m
755 $(LIBDIR
)
259 $(INSTALL_LIB
) -m
755 $(LIBCUPSSTATIC
) $(LIBDIR
)
260 $(RANLIB
) $(LIBDIR
)/$(LIBCUPSSTATIC
)
261 $(CHMOD
) 555 $(LIBDIR
)/$(LIBCUPSSTATIC
)
265 # Uninstall object and target files...
269 $(RM
) $(LIBDIR
)/libcups
.2.dylib
270 $(RM
) $(LIBDIR
)/$(LIBCUPSSTATIC
)
271 $(RM
) $(LIBDIR
)/libcups.dylib
272 $(RM
) $(LIBDIR
)/libcups_s.a
273 $(RM
) $(LIBDIR
)/libcups.sl
274 $(RM
) $(LIBDIR
)/libcups.sl
.2
275 $(RM
) $(LIBDIR
)/libcups.so
276 $(RM
) $(LIBDIR
)/libcups.so
.2
278 for file in
$(HEADERS
); do \
279 $(RM
) $(INCLUDEDIR
)/cups
/$$file; \
281 -$(RMDIR
) $(INCLUDEDIR
)/cups
285 # libcups.so.2, libcups.sl.2
288 libcups.so
.2 libcups.sl
.2: $(LIBOBJS
)
290 $(DSO
) $(ARCHFLAGS
) $(DSOFLAGS
) -o
$@
$(LIBOBJS
) $(LIBGSSAPI
) \
291 $(SSLLIBS
) $(DNSSDLIBS
) $(COMMONLIBS
) $(LIBZ
)
292 $(RM
) `basename $@ .2`
293 $(LN
) $@
`basename $@ .2`
300 libcups
.2.dylib
: $(LIBOBJS
) $(LIBCUPSORDER
)
301 echo Creating
export list for
$@...
302 nm
$(LIBOBJS
) 2>/dev
/null | grep
"T _" | awk
'{print $$3}' | \
303 grep
-v
-e
'^(_cupsConnect|_cupsCharset|_cupsEncodingName|_cupsSetDefaults|_cupsSetHTTPError|_cupsUserDefault|_httpWait)$$' | \
306 $(DSO
) $(ARCHFLAGS
) $(DSOFLAGS
) -o
$@ \
307 -install_name
$(libdir)/$@ \
308 -current_version
2.10.0 \
309 -compatibility_version
2.0.0 \
310 -exported_symbols_list t.exp \
311 $(LIBOBJS
) $(LIBGSSAPI
) $(SSLLIBS
) $(DNSSDLIBS
) \
312 $(COMMONLIBS
) $(LIBZ
)
313 $(RM
) libcups.dylib t.exp
314 $(LN
) $@ libcups.dylib
321 libcups_s.a
: $(LIBOBJS
) libcups_s.exp
323 $(DSO
) $(DSOFLAGS
) -Wl
,-bexport
:libcups_s.exp
-o libcups_s.o \
324 $(LIBOBJS
) $(LIBGSSAPI
) $(SSLLIBS
) $(DNSSDLIBS
) \
325 $(COMMONLIBS
) $(LIBZ
)
327 $(AR
) $(ARFLAGS
) $@ libcups_s.o
334 libcups.la
: $(LIBOBJS
)
336 $(CC
) $(ARCHFLAGS
) $(DSOFLAGS
) -o
$@
$(LIBOBJS
:.o
=.lo
) \
337 -rpath
$(LIBDIR
) -version-info
2:10 $(LIBGSSAPI
) $(SSLLIBS
) \
338 $(DNSSDLIBS
) $(COMMONLIBS
) $(LIBZ
)
345 libcups.a
: $(LIBOBJS
)
348 $(AR
) $(ARFLAGS
) $@
$(LIBOBJS
)
353 # testadmin (dependency on static CUPS library is intentional)
356 testadmin
: testadmin.o
$(LIBCUPSSTATIC
)
358 $(CC
) $(LDFLAGS
) -o
$@ testadmin.o
$(LIBCUPSSTATIC
) \
359 $(LIBGSSAPI
) $(SSLLIBS
) $(DNSSDLIBS
) $(COMMONLIBS
) $(LIBZ
)
363 # testarray (dependency on static CUPS library is intentional)
366 testarray
: testarray.o
$(LIBCUPSSTATIC
)
368 $(CC
) $(ARCHFLAGS
) $(LDFLAGS
) -o
$@ testarray.o
$(LIBCUPSSTATIC
) \
369 $(LIBGSSAPI
) $(SSLLIBS
) $(DNSSDLIBS
) $(COMMONLIBS
) $(LIBZ
)
370 echo Running array API tests...
375 # testconflicts (dependency on static CUPS library is intentional)
378 testconflicts
: testconflicts.o
$(LIBCUPSSTATIC
)
380 $(CC
) $(LDFLAGS
) -o
$@ testconflicts.o
$(LIBCUPSSTATIC
) \
381 $(LIBGSSAPI
) $(SSLLIBS
) $(DNSSDLIBS
) $(COMMONLIBS
) $(LIBZ
)
385 # testcups (dependency on static CUPS library is intentional)
388 testcups
: testcups.o
$(LIBCUPSSTATIC
)
390 $(CC
) $(LDFLAGS
) -o
$@ testcups.o
$(LIBCUPSSTATIC
) \
391 $(LIBGSSAPI
) $(SSLLIBS
) $(DNSSDLIBS
) $(COMMONLIBS
) $(LIBZ
)
395 # testfile (dependency on static CUPS library is intentional)
398 testfile
: testfile.o
$(LIBCUPSSTATIC
)
400 $(CC
) $(ARCHFLAGS
) $(LDFLAGS
) -o
$@ testfile.o
$(LIBCUPSSTATIC
) \
401 $(LIBGSSAPI
) $(SSLLIBS
) $(DNSSDLIBS
) $(COMMONLIBS
) $(LIBZ
)
402 echo Running file API tests...
407 # testhttp (dependency on static CUPS library is intentional)
410 testhttp
: testhttp.o
$(LIBCUPSSTATIC
)
412 $(CC
) $(ARCHFLAGS
) $(LDFLAGS
) -o
$@ testhttp.o
$(LIBCUPSSTATIC
) \
413 $(LIBGSSAPI
) $(SSLLIBS
) $(DNSSDLIBS
) $(COMMONLIBS
) $(LIBZ
)
414 echo Running HTTP API tests...
419 # testipp (dependency on static CUPS library is intentional)
422 testipp
: testipp.o
$(LIBCUPSSTATIC
)
424 $(CC
) $(ARCHFLAGS
) $(LDFLAGS
) -o
$@ testipp.o
$(LIBCUPSSTATIC
) \
425 $(LIBGSSAPI
) $(SSLLIBS
) $(DNSSDLIBS
) $(COMMONLIBS
) $(LIBZ
)
426 echo Running IPP API tests...
431 # testi18n (dependency on static CUPS library is intentional)
434 testi18n
: testi18n.o
$(LIBCUPSSTATIC
)
436 $(CC
) $(ARCHFLAGS
) $(LDFLAGS
) -o
$@ testi18n.o
$(LIBCUPSSTATIC
) \
437 $(LIBGSSAPI
) $(SSLLIBS
) $(DNSSDLIBS
) $(COMMONLIBS
) $(LIBZ
)
438 echo Running internationalization API tests...
443 # testlang (dependency on static CUPS library is intentional)
446 testlang
: testlang.o
$(LIBCUPSSTATIC
)
448 $(CC
) $(ARCHFLAGS
) $(LDFLAGS
) -o
$@ testlang.o
$(LIBCUPSSTATIC
) \
449 $(LIBGSSAPI
) $(SSLLIBS
) $(DNSSDLIBS
) $(COMMONLIBS
) $(LIBZ
)
450 echo Running language API tests...
455 # testoptions (dependency on static CUPS library is intentional)
458 testoptions
: testoptions.o
$(LIBCUPSSTATIC
)
460 $(CC
) $(ARCHFLAGS
) $(LDFLAGS
) -o
$@ testoptions.o
$(LIBCUPSSTATIC
) \
461 $(LIBGSSAPI
) $(SSLLIBS
) $(DNSSDLIBS
) $(COMMONLIBS
) $(LIBZ
)
462 echo Running option API tests...
467 # testppd (dependency on static CUPS library is intentional)
470 testppd
: testppd.o
$(LIBCUPSSTATIC
) test.ppd test2.ppd
472 $(CC
) $(ARCHFLAGS
) $(LDFLAGS
) -o
$@ testppd.o
$(LIBCUPSSTATIC
) \
473 $(LIBGSSAPI
) $(SSLLIBS
) $(DNSSDLIBS
) $(COMMONLIBS
) $(LIBZ
)
474 echo Running PPD API tests...
479 # testpwg (dependency on static CUPS library is intentional)
482 testpwg
: testpwg.o
$(LIBCUPSSTATIC
) test.ppd
484 $(CC
) $(ARCHFLAGS
) $(LDFLAGS
) -o
$@ testpwg.o
$(LIBCUPSSTATIC
) \
485 $(LIBGSSAPI
) $(SSLLIBS
) $(DNSSDLIBS
) $(COMMONLIBS
) $(LIBZ
)
486 echo Running PWG API tests...
491 # testsnmp (dependency on static CUPS library is intentional)
494 testsnmp
: testsnmp.o
$(LIBCUPSSTATIC
)
496 $(CC
) $(LDFLAGS
) -o
$@ testsnmp.o
$(LIBCUPSSTATIC
) \
497 $(LIBGSSAPI
) $(SSLLIBS
) $(DNSSDLIBS
) $(COMMONLIBS
) $(LIBZ
)
501 # Automatic API help files...
505 echo Generating CUPS API help files...
506 mxmldoc
--section
"Programming" \
507 --title
"Introduction to CUPS Programming" \
508 --css ..
/doc
/cups-printable.css \
509 --header api-overview.header
--intro api-overview.shtml \
510 >..
/doc
/help
/api-overview.html
511 mxmldoc
--section
"Programming" --title
"Array API" \
512 --css ..
/doc
/cups-printable.css \
513 --header api-array.header
--intro api-array.shtml \
515 array.h array.c
>..
/doc
/help
/api-array.html
516 mxmldoc
--tokens help
/api-array.html api-array.xml
>..
/doc
/help
/api-array.tokens
518 mxmldoc
--section
"Programming" --title
"CUPS API" \
519 --css ..
/doc
/cups-printable.css \
520 --header api-cups.header
--intro api-cups.shtml \
522 cups.h adminutil.c dest
*.c language.c notify.c \
523 options.c tempfile.c usersys.c \
524 util.c
>..
/doc
/help
/api-cups.html
525 mxmldoc
--tokens help
/api-cups.html api-cups.xml
>..
/doc
/help
/api-cups.tokens
527 mxmldoc
--section
"Programming" --title
"File and Directory APIs" \
528 --css ..
/doc
/cups-printable.css \
529 --header api-filedir.header
--intro api-filedir.shtml \
531 file.h file.c
dir.h
dir.c
>..
/doc
/help
/api-filedir.html
532 mxmldoc
--tokens api-filedir.xml
>..
/doc
/help
/api-filedir.tokens
533 $(RM
) api-filedir.xml
534 mxmldoc
--section
"Programming" --title
"PPD API (DEPRECATED)" \
535 --css ..
/doc
/cups-printable.css \
536 --header api-ppd.header
--intro api-ppd.shtml \
538 ppd.h attr.c conflicts.c custom.c emit.c localize.c mark.c page.c \
539 ppd.c
>..
/doc
/help
/api-ppd.html
540 mxmldoc
--tokens help
/api-ppd.html api-ppd.xml
>..
/doc
/help
/api-ppd.tokens
542 mxmldoc
--section
"Programming" --title
"HTTP and IPP APIs" \
543 --css ..
/doc
/cups-printable.css \
544 --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
>..
/doc
/help
/api-httpipp.html
549 mxmldoc
--tokens help
/api-httpipp.html api-httpipp.xml
>..
/doc
/help
/api-httpipp.tokens
550 $(RM
) api-httpipp.xml
551 mxmldoc
--section
"Programming" \
552 --title
"Filter and Backend Programming" \
553 --css ..
/doc
/cups-printable.css \
554 --header api-filter.header
--intro api-filter.shtml \
556 backchannel.c backend.h backend.c sidechannel.c sidechannel.h \
557 >..
/doc
/help
/api-filter.html
558 mxmldoc
--tokens help
/api-filter.html api-filter.xml
>..
/doc
/help
/api-filter.tokens
562 echo Generating CUPS API help files...
563 mxmldoc
--framed api-overview \
564 --section
"Programming" \
565 --title
"Introduction to CUPS Programming" \
566 --css ..
/doc
/cups-printable.css \
567 --header api-overview.header
--intro api-overview.shtml
568 mxmldoc
--framed api-array \
569 --section
"Programming" --title
"Array API" \
570 --css ..
/doc
/cups-printable.css \
571 --header api-array.header
--intro api-array.shtml \
573 mxmldoc
--framed api-cups \
574 --section
"Programming" --title
"CUPS API" \
575 --css ..
/doc
/cups-printable.css \
576 --header api-cups.header
--intro api-cups.shtml \
577 cups.h adminutil.c dest
*.c language.c notify.c \
578 options.c tempfile.c usersys.c \
580 mxmldoc
--framed api-filedir \
581 --section
"Programming" --title
"File and Directory APIs" \
582 --css ..
/doc
/cups-printable.css \
583 --header api-filedir.header
--intro api-filedir.shtml \
584 file.h file.c
dir.h
dir.c
585 mxmldoc
--framed api-ppd \
586 --section
"Programming" --title
"PPD API (DEPRECATED)" \
587 --css ..
/doc
/cups-printable.css \
588 --header api-ppd.header
--intro api-ppd.shtml \
589 ppd.h attr.c conflicts.c custom.c emit.c localize.c mark.c \
591 mxmldoc
--framed api-httpipp \
592 --section
"Programming" --title
"HTTP and IPP APIs" \
593 --css ..
/doc
/cups-printable.css \
594 --header api-httpipp.header
--intro api-httpipp.shtml \
595 http.h ipp.h auth.c getdevices.c getputfile.c encode.c \
596 http.c http-addr.c http-support.c ipp.c ipp-support.c \
597 md5passwd.c request.c
598 mxmldoc
--framed api-filter \
599 --section
"Programming" \
600 --title
"Filter and Backend Programming" \
601 --css ..
/doc
/cups-printable.css \
602 --header api-filter.header
--intro api-filter.shtml \
603 backchannel.c backend.h backend.c sidechannel.c sidechannel.h
607 # Lines of code computation...
611 echo
"libcupslite: \c"
612 sloccount
$(LITEOBJS
:.o
=.c
) 2>/dev
/null | grep
"Total Physical" | awk
'{print $$9}'
614 sloccount
$(LIBOBJS
:.o
=.c
) 2>/dev
/null | grep
"Total Physical" | awk
'{print $$9}'
625 # End of "$Id: Makefile 7871 2008-08-27 21:12:43Z mike $".