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
); \
257 $(INSTALL_DIR
) -m
755 $(LIBDIR
)
258 $(INSTALL_LIB
) -m
755 $(LIBCUPSSTATIC
) $(LIBDIR
)
259 $(RANLIB
) $(LIBDIR
)/$(LIBCUPSSTATIC
)
260 $(CHMOD
) 555 $(LIBDIR
)/$(LIBCUPSSTATIC
)
264 # Uninstall object and target files...
268 $(RM
) $(LIBDIR
)/libcups
.2.dylib
269 $(RM
) $(LIBDIR
)/$(LIBCUPSSTATIC
)
270 $(RM
) $(LIBDIR
)/libcups.dylib
271 $(RM
) $(LIBDIR
)/libcups_s.a
272 $(RM
) $(LIBDIR
)/libcups.sl
273 $(RM
) $(LIBDIR
)/libcups.sl
.2
274 $(RM
) $(LIBDIR
)/libcups.so
275 $(RM
) $(LIBDIR
)/libcups.so
.2
277 for file in
$(HEADERS
); do \
278 $(RM
) $(INCLUDEDIR
)/cups
/$$file; \
280 -$(RMDIR
) $(INCLUDEDIR
)/cups
284 # libcups.so.2, libcups.sl.2
287 libcups.so
.2 libcups.sl
.2: $(LIBOBJS
)
289 $(DSO
) $(ARCHFLAGS
) $(DSOFLAGS
) -o
$@
$(LIBOBJS
) $(LIBGSSAPI
) \
290 $(SSLLIBS
) $(DNSSDLIBS
) $(COMMONLIBS
) $(LIBZ
)
291 $(RM
) `basename $@ .2`
292 $(LN
) $@
`basename $@ .2`
299 libcups
.2.dylib
: $(LIBOBJS
) $(LIBCUPSORDER
)
300 echo Creating
export list for
$@...
301 nm
$(LIBOBJS
) 2>/dev
/null | grep
"T _" | awk
'{print $$3}' | \
302 grep
-v
-e
'^(_cupsConnect|_cupsCharset|_cupsEncodingName|_cupsSetDefaults|_cupsSetHTTPError|_cupsUserDefault|_httpWait)$$' | \
305 $(DSO
) $(ARCHFLAGS
) $(DSOFLAGS
) -o
$@ \
306 -install_name
$(libdir)/$@ \
307 -current_version
2.10.0 \
308 -compatibility_version
2.0.0 \
309 -exported_symbols_list t.exp \
310 $(LIBOBJS
) $(LIBGSSAPI
) $(SSLLIBS
) $(DNSSDLIBS
) \
311 $(COMMONLIBS
) $(LIBZ
)
312 $(RM
) libcups.dylib t.exp
313 $(LN
) $@ libcups.dylib
320 libcups_s.a
: $(LIBOBJS
) libcups_s.exp
322 $(DSO
) $(DSOFLAGS
) -Wl
,-bexport
:libcups_s.exp
-o libcups_s.o \
323 $(LIBOBJS
) $(LIBGSSAPI
) $(SSLLIBS
) $(DNSSDLIBS
) \
324 $(COMMONLIBS
) $(LIBZ
)
326 $(AR
) $(ARFLAGS
) $@ libcups_s.o
333 libcups.la
: $(LIBOBJS
)
335 $(CC
) $(ARCHFLAGS
) $(DSOFLAGS
) -o
$@
$(LIBOBJS
:.o
=.lo
) \
336 -rpath
$(LIBDIR
) -version-info
2:10 $(LIBGSSAPI
) $(SSLLIBS
) \
337 $(DNSSDLIBS
) $(COMMONLIBS
) $(LIBZ
)
344 libcups.a
: $(LIBOBJS
)
347 $(AR
) $(ARFLAGS
) $@
$(LIBOBJS
)
352 # testadmin (dependency on static CUPS library is intentional)
355 testadmin
: testadmin.o
$(LIBCUPSSTATIC
)
357 $(CC
) $(LDFLAGS
) -o
$@ testadmin.o
$(LIBCUPSSTATIC
) \
358 $(LIBGSSAPI
) $(SSLLIBS
) $(DNSSDLIBS
) $(COMMONLIBS
) $(LIBZ
)
362 # testarray (dependency on static CUPS library is intentional)
365 testarray
: testarray.o
$(LIBCUPSSTATIC
)
367 $(CC
) $(ARCHFLAGS
) $(LDFLAGS
) -o
$@ testarray.o
$(LIBCUPSSTATIC
) \
368 $(LIBGSSAPI
) $(SSLLIBS
) $(DNSSDLIBS
) $(COMMONLIBS
) $(LIBZ
)
369 echo Running array API tests...
374 # testconflicts (dependency on static CUPS library is intentional)
377 testconflicts
: testconflicts.o
$(LIBCUPSSTATIC
)
379 $(CC
) $(LDFLAGS
) -o
$@ testconflicts.o
$(LIBCUPSSTATIC
) \
380 $(LIBGSSAPI
) $(SSLLIBS
) $(DNSSDLIBS
) $(COMMONLIBS
) $(LIBZ
)
384 # testcups (dependency on static CUPS library is intentional)
387 testcups
: testcups.o
$(LIBCUPSSTATIC
)
389 $(CC
) $(LDFLAGS
) -o
$@ testcups.o
$(LIBCUPSSTATIC
) \
390 $(LIBGSSAPI
) $(SSLLIBS
) $(DNSSDLIBS
) $(COMMONLIBS
) $(LIBZ
)
394 # testfile (dependency on static CUPS library is intentional)
397 testfile
: testfile.o
$(LIBCUPSSTATIC
)
399 $(CC
) $(ARCHFLAGS
) $(LDFLAGS
) -o
$@ testfile.o
$(LIBCUPSSTATIC
) \
400 $(LIBGSSAPI
) $(SSLLIBS
) $(DNSSDLIBS
) $(COMMONLIBS
) $(LIBZ
)
401 echo Running file API tests...
406 # testhttp (dependency on static CUPS library is intentional)
409 testhttp
: testhttp.o
$(LIBCUPSSTATIC
)
411 $(CC
) $(ARCHFLAGS
) $(LDFLAGS
) -o
$@ testhttp.o
$(LIBCUPSSTATIC
) \
412 $(LIBGSSAPI
) $(SSLLIBS
) $(DNSSDLIBS
) $(COMMONLIBS
) $(LIBZ
)
413 echo Running HTTP API tests...
418 # testipp (dependency on static CUPS library is intentional)
421 testipp
: testipp.o
$(LIBCUPSSTATIC
)
423 $(CC
) $(ARCHFLAGS
) $(LDFLAGS
) -o
$@ testipp.o
$(LIBCUPSSTATIC
) \
424 $(LIBGSSAPI
) $(SSLLIBS
) $(DNSSDLIBS
) $(COMMONLIBS
) $(LIBZ
)
425 echo Running IPP API tests...
430 # testi18n (dependency on static CUPS library is intentional)
433 testi18n
: testi18n.o
$(LIBCUPSSTATIC
)
435 $(CC
) $(ARCHFLAGS
) $(LDFLAGS
) -o
$@ testi18n.o
$(LIBCUPSSTATIC
) \
436 $(LIBGSSAPI
) $(SSLLIBS
) $(DNSSDLIBS
) $(COMMONLIBS
) $(LIBZ
)
437 echo Running internationalization API tests...
442 # testlang (dependency on static CUPS library is intentional)
445 testlang
: testlang.o
$(LIBCUPSSTATIC
)
447 $(CC
) $(ARCHFLAGS
) $(LDFLAGS
) -o
$@ testlang.o
$(LIBCUPSSTATIC
) \
448 $(LIBGSSAPI
) $(SSLLIBS
) $(DNSSDLIBS
) $(COMMONLIBS
) $(LIBZ
)
449 echo Running language API tests...
454 # testoptions (dependency on static CUPS library is intentional)
457 testoptions
: testoptions.o
$(LIBCUPSSTATIC
)
459 $(CC
) $(ARCHFLAGS
) $(LDFLAGS
) -o
$@ testoptions.o
$(LIBCUPSSTATIC
) \
460 $(LIBGSSAPI
) $(SSLLIBS
) $(DNSSDLIBS
) $(COMMONLIBS
) $(LIBZ
)
461 echo Running option API tests...
466 # testppd (dependency on static CUPS library is intentional)
469 testppd
: testppd.o
$(LIBCUPSSTATIC
) test.ppd test2.ppd
471 $(CC
) $(ARCHFLAGS
) $(LDFLAGS
) -o
$@ testppd.o
$(LIBCUPSSTATIC
) \
472 $(LIBGSSAPI
) $(SSLLIBS
) $(DNSSDLIBS
) $(COMMONLIBS
) $(LIBZ
)
473 echo Running PPD API tests...
478 # testpwg (dependency on static CUPS library is intentional)
481 testpwg
: testpwg.o
$(LIBCUPSSTATIC
) test.ppd
483 $(CC
) $(ARCHFLAGS
) $(LDFLAGS
) -o
$@ testpwg.o
$(LIBCUPSSTATIC
) \
484 $(LIBGSSAPI
) $(SSLLIBS
) $(DNSSDLIBS
) $(COMMONLIBS
) $(LIBZ
)
485 echo Running PWG API tests...
490 # testsnmp (dependency on static CUPS library is intentional)
493 testsnmp
: testsnmp.o
$(LIBCUPSSTATIC
)
495 $(CC
) $(LDFLAGS
) -o
$@ testsnmp.o
$(LIBCUPSSTATIC
) \
496 $(LIBGSSAPI
) $(SSLLIBS
) $(DNSSDLIBS
) $(COMMONLIBS
) $(LIBZ
)
500 # Automatic API help files...
504 echo Generating CUPS API help files...
505 mxmldoc
--section
"Programming" \
506 --title
"Introduction to CUPS Programming" \
507 --css ..
/doc
/cups-printable.css \
508 --header api-overview.header
--intro api-overview.shtml \
509 >..
/doc
/help
/api-overview.html
510 mxmldoc
--section
"Programming" --title
"Array API" \
511 --css ..
/doc
/cups-printable.css \
512 --header api-array.header
--intro api-array.shtml \
514 array.h array.c
>..
/doc
/help
/api-array.html
515 mxmldoc
--tokens help
/api-array.html api-array.xml
>..
/doc
/help
/api-array.tokens
517 mxmldoc
--section
"Programming" --title
"CUPS API" \
518 --css ..
/doc
/cups-printable.css \
519 --header api-cups.header
--intro api-cups.shtml \
521 cups.h adminutil.c dest
*.c language.c notify.c \
522 options.c tempfile.c usersys.c \
523 util.c
>..
/doc
/help
/api-cups.html
524 mxmldoc
--tokens help
/api-cups.html api-cups.xml
>..
/doc
/help
/api-cups.tokens
526 mxmldoc
--section
"Programming" --title
"File and Directory APIs" \
527 --css ..
/doc
/cups-printable.css \
528 --header api-filedir.header
--intro api-filedir.shtml \
530 file.h file.c
dir.h
dir.c
>..
/doc
/help
/api-filedir.html
531 mxmldoc
--tokens api-filedir.xml
>..
/doc
/help
/api-filedir.tokens
532 $(RM
) api-filedir.xml
533 mxmldoc
--section
"Programming" --title
"PPD API (DEPRECATED)" \
534 --css ..
/doc
/cups-printable.css \
535 --header api-ppd.header
--intro api-ppd.shtml \
537 ppd.h attr.c conflicts.c custom.c emit.c localize.c mark.c page.c \
538 ppd.c
>..
/doc
/help
/api-ppd.html
539 mxmldoc
--tokens help
/api-ppd.html api-ppd.xml
>..
/doc
/help
/api-ppd.tokens
541 mxmldoc
--section
"Programming" --title
"HTTP and IPP APIs" \
542 --css ..
/doc
/cups-printable.css \
543 --header api-httpipp.header
--intro api-httpipp.shtml \
545 http.h ipp.h auth.c getdevices.c getputfile.c encode.c \
546 http.c http-addr.c http-support.c ipp.c ipp-support.c \
547 md5passwd.c request.c
>..
/doc
/help
/api-httpipp.html
548 mxmldoc
--tokens help
/api-httpipp.html api-httpipp.xml
>..
/doc
/help
/api-httpipp.tokens
549 $(RM
) api-httpipp.xml
550 mxmldoc
--section
"Programming" \
551 --title
"Filter and Backend Programming" \
552 --css ..
/doc
/cups-printable.css \
553 --header api-filter.header
--intro api-filter.shtml \
555 backchannel.c backend.h backend.c sidechannel.c sidechannel.h \
556 >..
/doc
/help
/api-filter.html
557 mxmldoc
--tokens help
/api-filter.html api-filter.xml
>..
/doc
/help
/api-filter.tokens
561 echo Generating CUPS API help files...
562 mxmldoc
--framed api-overview \
563 --section
"Programming" \
564 --title
"Introduction to CUPS Programming" \
565 --css ..
/doc
/cups-printable.css \
566 --header api-overview.header
--intro api-overview.shtml
567 mxmldoc
--framed api-array \
568 --section
"Programming" --title
"Array API" \
569 --css ..
/doc
/cups-printable.css \
570 --header api-array.header
--intro api-array.shtml \
572 mxmldoc
--framed api-cups \
573 --section
"Programming" --title
"CUPS API" \
574 --css ..
/doc
/cups-printable.css \
575 --header api-cups.header
--intro api-cups.shtml \
576 cups.h adminutil.c dest
*.c language.c notify.c \
577 options.c tempfile.c usersys.c \
579 mxmldoc
--framed api-filedir \
580 --section
"Programming" --title
"File and Directory APIs" \
581 --css ..
/doc
/cups-printable.css \
582 --header api-filedir.header
--intro api-filedir.shtml \
583 file.h file.c
dir.h
dir.c
584 mxmldoc
--framed api-ppd \
585 --section
"Programming" --title
"PPD API (DEPRECATED)" \
586 --css ..
/doc
/cups-printable.css \
587 --header api-ppd.header
--intro api-ppd.shtml \
588 ppd.h attr.c conflicts.c custom.c emit.c localize.c mark.c \
590 mxmldoc
--framed api-httpipp \
591 --section
"Programming" --title
"HTTP and IPP APIs" \
592 --css ..
/doc
/cups-printable.css \
593 --header api-httpipp.header
--intro api-httpipp.shtml \
594 http.h ipp.h auth.c getdevices.c getputfile.c encode.c \
595 http.c http-addr.c http-support.c ipp.c ipp-support.c \
596 md5passwd.c request.c
597 mxmldoc
--framed api-filter \
598 --section
"Programming" \
599 --title
"Filter and Backend Programming" \
600 --css ..
/doc
/cups-printable.css \
601 --header api-filter.header
--intro api-filter.shtml \
602 backchannel.c backend.h backend.c sidechannel.c sidechannel.h
606 # Lines of code computation...
610 echo
"libcupslite: \c"
611 sloccount
$(LITEOBJS
:.o
=.c
) 2>/dev
/null | grep
"Total Physical" | awk
'{print $$9}'
613 sloccount
$(LIBOBJS
:.o
=.c
) 2>/dev
/null | grep
"Total Physical" | awk
'{print $$9}'
624 # End of "$Id: Makefile 7871 2008-08-27 21:12:43Z mike $".