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.
71 LIB32OBJS
= $(LIBOBJS
:.o
=.32.o
)
72 LIB64OBJS
= $(LIBOBJS
:.o
=.64.o
)
94 # Header files to install...
115 # Targets in this directory...
144 # Make all targets...
151 # Make library targets...
161 unittests
: $(UNITTARGETS
)
165 # Remove object and target files...
169 $(RM
) $(OBJS
) $(TARGETS
) $(UNITTARGETS
)
170 $(RM
) libcups.so libcups.sl libcups.dylib
175 # Update dependencies (without system header dependencies...)
179 touch Dependencies.tmp
180 makedepend
-Y
-I..
-fDependencies.tmp
$(OBJS
:.o
=.c
) >/dev
/null
2>&1
182 cp Dependencies.tmp Dependencies
183 sed
-E
-e
'1,$$s/^([^.]+)\.o:/\1\.32.o: \1\.c /' Dependencies.tmp
>>Dependencies
184 sed
-E
-e
'1,$$s/^([^.]+)\.o:/\1\.64.o: \1\.c /' Dependencies.tmp
>>Dependencies
185 $(RM
) Dependencies.tmp
189 # Install all targets...
192 install: all install-data install-headers install-libs install-exec
196 # Install data files...
203 # Install programs...
214 echo Installing header files into
$(INCLUDEDIR
)/cups...
215 $(INSTALL_DIR
) -m
755 $(INCLUDEDIR
)/cups
216 for file in
$(HEADERS
); do \
217 $(INSTALL_DATA
) $$file $(INCLUDEDIR
)/cups
; \
222 # Install libraries...
225 install-libs
: $(INSTALLSTATIC
) $(INSTALL32
) $(INSTALL64
)
226 echo Installing libraries in
$(LIBDIR
)...
227 $(INSTALL_DIR
) -m
755 $(LIBDIR
)
228 $(INSTALL_LIB
) $(LIBCUPS
) $(LIBDIR
)
229 if
test $(LIBCUPS
) = "libcups.so.2" -o
$(LIBCUPS
) = "libcups.sl.2"; then \
230 $(RM
) $(LIBDIR
)/`basename $(LIBCUPS) .2`; \
231 $(LN
) $(LIBCUPS
) $(LIBDIR
)/`basename $(LIBCUPS) .2`; \
233 if
test $(LIBCUPS
) = "libcups.2.dylib"; then \
234 $(RM
) $(LIBDIR
)/libcups.dylib
; \
235 $(LN
) $(LIBCUPS
) $(LIBDIR
)/libcups.dylib
; \
237 if
test "x$(SYMROOT)" != "x"; then \
238 $(INSTALL_DIR
) $(SYMROOT
); \
239 cp
$(LIBCUPS
) $(SYMROOT
); \
243 $(INSTALL_DIR
) -m
755 $(LIBDIR
)
244 $(INSTALL_LIB
) -m
755 $(LIBCUPSSTATIC
) $(LIBDIR
)
245 $(RANLIB
) $(LIBDIR
)/$(LIBCUPSSTATIC
)
246 $(CHMOD
) 555 $(LIBDIR
)/$(LIBCUPSSTATIC
)
249 echo Installing libraries in
$(LIB32DIR
)...
250 $(INSTALL_DIR
) -m
755 $(LIB32DIR
)
251 $(INSTALL_LIB
) 32bit
/libcups.so
.2 $(LIB32DIR
)/libcups.so
.2
252 $(LN
) libcups.so
.2 $(LIB32DIR
)/libcups.so
255 echo Installing libraries in
$(LIB64DIR
)...
256 $(INSTALL_DIR
) -m
755 $(LIB64DIR
)
257 $(INSTALL_LIB
) 64bit
/libcups.so
.2 $(LIB64DIR
)/libcups.so
.2
258 $(LN
) libcups.so
.2 $(LIB64DIR
)/libcups.so
262 # Uninstall object and target files...
265 uninstall: $(UNINSTALL32
) $(UNINSTALL64
)
266 $(RM
) $(LIBDIR
)/libcups
.2.dylib
267 $(RM
) $(LIBDIR
)/libcups.a
268 $(RM
) $(LIBDIR
)/libcups.dylib
269 $(RM
) $(LIBDIR
)/libcups_s.a
270 $(RM
) $(LIBDIR
)/libcups.sl
271 $(RM
) $(LIBDIR
)/libcups.sl
.2
272 $(RM
) $(LIBDIR
)/libcups.so
273 $(RM
) $(LIBDIR
)/libcups.so
.2
275 for file in
$(HEADERS
); do \
276 $(RM
) $(INCLUDEDIR
)/cups
/$$file; \
278 -$(RMDIR
) $(INCLUDEDIR
)/cups
281 $(RM
) $(LIB32DIR
)/libcups.so
282 $(RM
) $(LIB32DIR
)/libcups.so
.2
283 -$(RMDIR
) $(LIB32DIR
)
286 $(RM
) $(LIB64DIR
)/libcups.so
287 $(RM
) $(LIB64DIR
)/libcups.so
.2
288 -$(RMDIR
) $(LIB64DIR
)
292 # libcups.so.2, libcups.sl.2
295 libcups.so
.2 libcups.sl
.2: $(LIBOBJS
)
297 $(DSO
) $(ARCHFLAGS
) $(DSOFLAGS
) -o
$@
$(LIBOBJS
) $(LIBGSSAPI
) \
298 $(SSLLIBS
) $(DNSSDLIBS
) $(COMMONLIBS
) $(LIBZ
)
299 $(RM
) `basename $@ .2`
300 $(LN
) $@
`basename $@ .2`
307 32bit
/libcups.so
.2: $(LIB32OBJS
)
308 echo Linking
32-bit
$@...
310 $(DSO
) $(ARCH32FLAGS
) $(DSO32FLAGS
) -o
$@
$(LIB32OBJS
) $(LIBGSSAPI
) \
311 $(DNSSDLIBS
) $(SSLLIBS
) $(COMMONLIBS
) $(LIBZ
)
312 $(RM
) 32bit
/libcups.so
313 $(LN
) libcups.so
.2 32bit
/libcups.so
320 64bit
/libcups.so
.2: $(LIB64OBJS
)
321 echo Linking
64-bit
$@...
323 $(DSO
) $(ARCH64FLAGS
) $(DSO64FLAGS
) -o
$@
$(LIB64OBJS
) $(LIBGSSAPI
) \
324 $(DNSSDLIBS
) $(SSLLIBS
) $(COMMONLIBS
) $(LIBZ
)
325 $(RM
) 64bit
/libcups.so
326 $(LN
) libcups.so
.2 64bit
/libcups.so
333 libcups
.2.dylib
: $(LIBOBJS
) $(LIBCUPSORDER
)
334 echo Creating
export list for
$@...
335 nm
$(LIBOBJS
) 2>/dev
/null | grep
"T _" | awk
'{print $$3}' | \
336 grep
-v
-e
'^(_cupsConnect|_cupsSetDefaults|_cupsSetHTTPError|_cupsUserDefault|_httpWait)$$' | \
339 $(DSO
) $(ARCHFLAGS
) $(DSOFLAGS
) -o
$@ \
340 -install_name
$(libdir)/$@ \
341 -current_version
2.8.0 \
342 -compatibility_version
2.0.0 \
343 -exported_symbols_list t.exp \
344 -sectorder __TEXT __text
$(LIBCUPSORDER
) \
345 $(LIBOBJS
) $(LIBGSSAPI
) $(SSLLIBS
) $(DNSSDLIBS
) \
346 $(COMMONLIBS
) $(LIBZ
)
347 $(RM
) libcups.dylib t.exp
348 $(LN
) $@ libcups.dylib
355 libcups_s.a
: $(LIBOBJS
) libcups_s.exp
357 $(DSO
) $(DSOFLAGS
) -Wl
,-bexport
:libcups_s.exp
-o libcups_s.o \
358 $(LIBOBJS
) $(LIBGSSAPI
) $(SSLLIBS
) $(DNSSDLIBS
) \
359 $(COMMONLIBS
) $(LIBZ
) -lm
361 $(AR
) $(ARFLAGS
) $@ libcups_s.o
368 libcups.la
: $(LIBOBJS
)
370 $(CC
) $(ARCHFLAGS
) $(DSOFLAGS
) -o
$@
$(LIBOBJS
:.o
=.lo
) \
371 -rpath
$(LIBDIR
) -version-info
2:8 $(LIBGSSAPI
) $(SSLLIBS
) \
372 $(DNSSDLIBS
) $(COMMONLIBS
) $(LIBZ
)
379 libcups.a
: $(LIBOBJS
)
382 $(AR
) $(ARFLAGS
) $@
$(LIBOBJS
)
387 # testadmin (dependency on static CUPS library is intentional)
390 testadmin
: testadmin.o
$(LIBCUPSSTATIC
)
392 $(CC
) $(LDFLAGS
) -o
$@ testadmin.o
$(LIBCUPSSTATIC
) \
393 $(LIBGSSAPI
) $(SSLLIBS
) $(DNSSDLIBS
) $(COMMONLIBS
) $(LIBZ
)
397 # testarray (dependency on static CUPS library is intentional)
400 testarray
: testarray.o
$(LIBCUPSSTATIC
)
402 $(CC
) $(ARCHFLAGS
) $(LDFLAGS
) -o
$@ testarray.o
$(LIBCUPSSTATIC
) \
403 $(LIBGSSAPI
) $(SSLLIBS
) $(DNSSDLIBS
) $(COMMONLIBS
) $(LIBZ
)
404 echo Running array API tests...
409 # testconflicts (dependency on static CUPS library is intentional)
412 testconflicts
: testconflicts.o
$(LIBCUPSSTATIC
)
414 $(CC
) $(LDFLAGS
) -o
$@ testconflicts.o
$(LIBCUPSSTATIC
) \
415 $(LIBGSSAPI
) $(SSLLIBS
) $(DNSSDLIBS
) $(COMMONLIBS
) $(LIBZ
)
419 # testcups (dependency on static CUPS library is intentional)
422 testcups
: testcups.o
$(LIBCUPSSTATIC
)
424 $(CC
) $(LDFLAGS
) -o
$@ testcups.o
$(LIBCUPSSTATIC
) \
425 $(LIBGSSAPI
) $(SSLLIBS
) $(DNSSDLIBS
) $(COMMONLIBS
) $(LIBZ
)
429 # testfile (dependency on static CUPS library is intentional)
432 testfile
: testfile.o
$(LIBCUPSSTATIC
)
434 $(CC
) $(ARCHFLAGS
) $(LDFLAGS
) -o
$@ testfile.o
$(LIBCUPSSTATIC
) \
435 $(LIBGSSAPI
) $(SSLLIBS
) $(DNSSDLIBS
) $(COMMONLIBS
) $(LIBZ
)
436 echo Running file API tests...
441 # testhttp (dependency on static CUPS library is intentional)
444 testhttp
: testhttp.o
$(LIBCUPSSTATIC
)
446 $(CC
) $(ARCHFLAGS
) $(LDFLAGS
) -o
$@ testhttp.o
$(LIBCUPSSTATIC
) \
447 $(LIBGSSAPI
) $(SSLLIBS
) $(DNSSDLIBS
) $(COMMONLIBS
) $(LIBZ
)
448 echo Running HTTP API tests...
453 # testipp (dependency on static CUPS library is intentional)
456 testipp
: testipp.o
$(LIBCUPSSTATIC
)
458 $(CC
) $(ARCHFLAGS
) $(LDFLAGS
) -o
$@ testipp.o
$(LIBCUPSSTATIC
) \
459 $(LIBGSSAPI
) $(SSLLIBS
) $(DNSSDLIBS
) $(COMMONLIBS
) $(LIBZ
)
460 echo Running IPP API tests...
465 # testi18n (dependency on static CUPS library is intentional)
468 testi18n
: testi18n.o
$(LIBCUPSSTATIC
)
470 $(CC
) $(ARCHFLAGS
) $(LDFLAGS
) -o
$@ testi18n.o
$(LIBCUPSSTATIC
) \
471 $(LIBGSSAPI
) $(SSLLIBS
) $(DNSSDLIBS
) $(COMMONLIBS
) $(LIBZ
)
472 echo Running internationalization API tests...
477 # testlang (dependency on static CUPS library is intentional)
480 testlang
: testlang.o
$(LIBCUPSSTATIC
)
482 $(CC
) $(ARCHFLAGS
) $(LDFLAGS
) -o
$@ testlang.o
$(LIBCUPSSTATIC
) \
483 $(LIBGSSAPI
) $(SSLLIBS
) $(DNSSDLIBS
) $(COMMONLIBS
) $(LIBZ
)
484 echo Running language API tests...
489 # testoptions (dependency on static CUPS library is intentional)
492 testoptions
: testoptions.o
$(LIBCUPSSTATIC
)
494 $(CC
) $(ARCHFLAGS
) $(LDFLAGS
) -o
$@ testoptions.o
$(LIBCUPSSTATIC
) \
495 $(LIBGSSAPI
) $(SSLLIBS
) $(DNSSDLIBS
) $(COMMONLIBS
) $(LIBZ
)
496 echo Running option API tests...
501 # testppd (dependency on static CUPS library is intentional)
504 testppd
: testppd.o
$(LIBCUPSSTATIC
) test.ppd test2.ppd
506 $(CC
) $(ARCHFLAGS
) $(LDFLAGS
) -o
$@ testppd.o
$(LIBCUPSSTATIC
) \
507 $(LIBGSSAPI
) $(SSLLIBS
) $(DNSSDLIBS
) $(COMMONLIBS
) $(LIBZ
)
508 echo Running PPD API tests...
513 # testpwg (dependency on static CUPS library is intentional)
516 testpwg
: testpwg.o
$(LIBCUPSSTATIC
) test.ppd
518 $(CC
) $(ARCHFLAGS
) $(LDFLAGS
) -o
$@ testpwg.o
$(LIBCUPSSTATIC
) \
519 $(LIBGSSAPI
) $(SSLLIBS
) $(DNSSDLIBS
) $(COMMONLIBS
) $(LIBZ
)
520 echo Running PWG API tests...
525 # testsnmp (dependency on static CUPS library is intentional)
528 testsnmp
: testsnmp.o
$(LIBCUPSSTATIC
)
530 $(CC
) $(LDFLAGS
) -o
$@ testsnmp.o
$(LIBCUPSSTATIC
) \
531 $(LIBGSSAPI
) $(SSLLIBS
) $(DNSSDLIBS
) $(COMMONLIBS
) $(LIBZ
)
535 # Automatic API help files...
539 echo Generating CUPS API help files...
540 mxmldoc
--section
"Programming" \
541 --title
"Introduction to CUPS Programming" \
542 --css ..
/doc
/cups-printable.css \
543 --header api-overview.header
--intro api-overview.shtml \
544 >..
/doc
/help
/api-overview.html
545 mxmldoc
--section
"Programming" --title
"Array API" \
546 --css ..
/doc
/cups-printable.css \
547 --header api-array.header
--intro api-array.shtml \
549 array.h array.c
>..
/doc
/help
/api-array.html
550 mxmldoc
--tokens help
/api-array.html api-array.xml
>..
/doc
/help
/api-array.tokens
552 mxmldoc
--section
"Programming" --title
"CUPS API" \
553 --css ..
/doc
/cups-printable.css \
554 --header api-cups.header
--intro api-cups.shtml \
556 cups.h adminutil.c dest.c language.c notify.c \
557 options.c tempfile.c usersys.c \
558 util.c
>..
/doc
/help
/api-cups.html
559 mxmldoc
--tokens help
/api-cups.html api-cups.xml
>..
/doc
/help
/api-cups.tokens
561 mxmldoc
--section
"Programming" --title
"File and Directory APIs" \
562 --css ..
/doc
/cups-printable.css \
563 --header api-filedir.header
--intro api-filedir.shtml \
565 file.h file.c
dir.h
dir.c
>..
/doc
/help
/api-filedir.html
566 mxmldoc
--tokens api-filedir.xml
>..
/doc
/help
/api-filedir.tokens
567 $(RM
) api-filedir.xml
568 mxmldoc
--section
"Programming" --title
"PPD API" \
569 --css ..
/doc
/cups-printable.css \
570 --header api-ppd.header
--intro api-ppd.shtml \
572 ppd.h attr.c conflicts.c custom.c emit.c localize.c mark.c page.c \
573 ppd.c
>..
/doc
/help
/api-ppd.html
574 mxmldoc
--tokens help
/api-ppd.html api-ppd.xml
>..
/doc
/help
/api-ppd.tokens
576 mxmldoc
--section
"Programming" --title
"HTTP and IPP APIs" \
577 --css ..
/doc
/cups-printable.css \
578 --header api-httpipp.header
--intro api-httpipp.shtml \
580 http.h ipp.h auth.c getdevices.c getputfile.c encode.c \
581 http.c http-addr.c http-support.c ipp.c ipp-support.c \
582 md5passwd.c request.c
>..
/doc
/help
/api-httpipp.html
583 mxmldoc
--tokens help
/api-httpipp.html api-httpipp.xml
>..
/doc
/help
/api-httpipp.tokens
584 $(RM
) api-httpipp.xml
585 mxmldoc
--section
"Programming" \
586 --title
"Filter and Backend Programming" \
587 --css ..
/doc
/cups-printable.css \
588 --header api-filter.header
--intro api-filter.shtml \
590 backchannel.c backend.h backend.c sidechannel.c sidechannel.h \
591 >..
/doc
/help
/api-filter.html
592 mxmldoc
--tokens help
/api-filter.html api-filter.xml
>..
/doc
/help
/api-filter.tokens
596 echo Generating CUPS API help files...
597 mxmldoc
--framed api-overview \
598 --section
"Programming" \
599 --title
"Introduction to CUPS Programming" \
600 --css ..
/doc
/cups-printable.css \
601 --header api-overview.header
--intro api-overview.shtml
602 mxmldoc
--framed api-array \
603 --section
"Programming" --title
"Array API" \
604 --css ..
/doc
/cups-printable.css \
605 --header api-array.header
--intro api-array.shtml \
607 mxmldoc
--framed api-cups \
608 --section
"Programming" --title
"CUPS API" \
609 --css ..
/doc
/cups-printable.css \
610 --header api-cups.header
--intro api-cups.shtml \
611 cups.h adminutil.c dest.c language.c notify.c \
612 options.c tempfile.c usersys.c \
614 mxmldoc
--framed api-filedir \
615 --section
"Programming" --title
"File and Directory APIs" \
616 --css ..
/doc
/cups-printable.css \
617 --header api-filedir.header
--intro api-filedir.shtml \
618 file.h file.c
dir.h
dir.c
619 mxmldoc
--framed api-ppd \
620 --section
"Programming" --title
"PPD API" \
621 --css ..
/doc
/cups-printable.css \
622 --header api-ppd.header
--intro api-ppd.shtml \
623 ppd.h attr.c conflicts.c custom.c emit.c localize.c mark.c \
625 mxmldoc
--framed api-httpipp \
626 --section
"Programming" --title
"HTTP and IPP APIs" \
627 --css ..
/doc
/cups-printable.css \
628 --header api-httpipp.header
--intro api-httpipp.shtml \
629 http.h ipp.h auth.c getdevices.c getputfile.c encode.c \
630 http.c http-addr.c http-support.c ipp.c ipp-support.c \
631 md5passwd.c request.c
632 mxmldoc
--framed api-filter \
633 --section
"Programming" \
634 --title
"Filter and Backend Programming" \
635 --css ..
/doc
/cups-printable.css \
636 --header api-filter.header
--intro api-filter.shtml \
637 backchannel.c backend.h backend.c sidechannel.c sidechannel.h
648 # End of "$Id: Makefile 7871 2008-08-27 21:12:43Z mike $".