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.
69 LIB32OBJS
= $(LIBOBJS
:.o
=.32.o
)
70 LIB64OBJS
= $(LIBOBJS
:.o
=.64.o
)
91 # Header files to install...
112 # Targets in this directory...
140 # Make all targets...
147 # Make library targets...
157 unittests
: $(UNITTARGETS
)
161 # Remove object and target files...
165 $(RM
) $(OBJS
) $(TARGETS
) $(UNITTARGETS
)
166 $(RM
) libcups.so libcups.sl libcups.dylib
171 # Update dependencies (without system header dependencies...)
175 touch Dependencies.tmp
176 makedepend
-Y
-I..
-fDependencies.tmp
$(OBJS
:.o
=.c
) >/dev
/null
2>&1
178 cp Dependencies.tmp Dependencies
179 sed
-E
-e
'1,$$s/^([^.]+)\.o:/\1\.32.o: \1\.c /' Dependencies.tmp
>>Dependencies
180 sed
-E
-e
'1,$$s/^([^.]+)\.o:/\1\.64.o: \1\.c /' Dependencies.tmp
>>Dependencies
181 $(RM
) Dependencies.tmp
185 # Install all targets...
188 install: all install-data install-headers install-libs install-exec
192 # Install data files...
199 # Install programs...
210 echo Installing header files into
$(INCLUDEDIR
)/cups...
211 $(INSTALL_DIR
) -m
755 $(INCLUDEDIR
)/cups
212 for file in
$(HEADERS
); do \
213 $(INSTALL_DATA
) $$file $(INCLUDEDIR
)/cups
; \
218 # Install libraries...
221 install-libs
: $(INSTALLSTATIC
) $(INSTALL32
) $(INSTALL64
)
222 echo Installing libraries in
$(LIBDIR
)...
223 $(INSTALL_DIR
) -m
755 $(LIBDIR
)
224 $(INSTALL_LIB
) $(LIBCUPS
) $(LIBDIR
)
225 if
test $(LIBCUPS
) = "libcups.so.2" -o
$(LIBCUPS
) = "libcups.sl.2"; then \
226 $(RM
) $(LIBDIR
)/`basename $(LIBCUPS) .2`; \
227 $(LN
) $(LIBCUPS
) $(LIBDIR
)/`basename $(LIBCUPS) .2`; \
229 if
test $(LIBCUPS
) = "libcups.2.dylib"; then \
230 $(RM
) $(LIBDIR
)/libcups.dylib
; \
231 $(LN
) $(LIBCUPS
) $(LIBDIR
)/libcups.dylib
; \
233 if
test "x$(SYMROOT)" != "x"; then \
234 $(INSTALL_DIR
) $(SYMROOT
); \
235 cp
$(LIBCUPS
) $(SYMROOT
); \
239 $(INSTALL_DIR
) -m
755 $(LIBDIR
)
240 $(INSTALL_LIB
) -m
755 $(LIBCUPSSTATIC
) $(LIBDIR
)
241 $(RANLIB
) $(LIBDIR
)/$(LIBCUPSSTATIC
)
242 $(CHMOD
) 555 $(LIBDIR
)/$(LIBCUPSSTATIC
)
245 echo Installing libraries in
$(LIB32DIR
)...
246 $(INSTALL_DIR
) -m
755 $(LIB32DIR
)
247 $(INSTALL_LIB
) 32bit
/libcups.so
.2 $(LIB32DIR
)/libcups.so
.2
248 $(LN
) libcups.so
.2 $(LIB32DIR
)/libcups.so
251 echo Installing libraries in
$(LIB64DIR
)...
252 $(INSTALL_DIR
) -m
755 $(LIB64DIR
)
253 $(INSTALL_LIB
) 64bit
/libcups.so
.2 $(LIB64DIR
)/libcups.so
.2
254 $(LN
) libcups.so
.2 $(LIB64DIR
)/libcups.so
258 # Uninstall object and target files...
261 uninstall: $(UNINSTALL32
) $(UNINSTALL64
)
262 $(RM
) $(LIBDIR
)/libcups
.2.dylib
263 $(RM
) $(LIBDIR
)/libcups.a
264 $(RM
) $(LIBDIR
)/libcups.dylib
265 $(RM
) $(LIBDIR
)/libcups_s.a
266 $(RM
) $(LIBDIR
)/libcups.sl
267 $(RM
) $(LIBDIR
)/libcups.sl
.2
268 $(RM
) $(LIBDIR
)/libcups.so
269 $(RM
) $(LIBDIR
)/libcups.so
.2
271 for file in
$(HEADERS
); do \
272 $(RM
) $(INCLUDEDIR
)/cups
/$$file; \
274 -$(RMDIR
) $(INCLUDEDIR
)/cups
277 $(RM
) $(LIB32DIR
)/libcups.so
278 $(RM
) $(LIB32DIR
)/libcups.so
.2
279 -$(RMDIR
) $(LIB32DIR
)
282 $(RM
) $(LIB64DIR
)/libcups.so
283 $(RM
) $(LIB64DIR
)/libcups.so
.2
284 -$(RMDIR
) $(LIB64DIR
)
288 # libcups.so.2, libcups.sl.2
291 libcups.so
.2 libcups.sl
.2: $(LIBOBJS
)
293 $(DSO
) $(ARCHFLAGS
) $(DSOFLAGS
) -o
$@
$(LIBOBJS
) $(LIBGSSAPI
) \
294 $(SSLLIBS
) $(DNSSDLIBS
) $(COMMONLIBS
) $(LIBZ
)
295 $(RM
) `basename $@ .2`
296 $(LN
) $@
`basename $@ .2`
303 32bit
/libcups.so
.2: $(LIB32OBJS
)
304 echo Linking
32-bit
$@...
306 $(DSO
) $(ARCH32FLAGS
) $(DSO32FLAGS
) -o
$@
$(LIB32OBJS
) $(LIBGSSAPI
) \
307 $(DNSSDLIBS
) $(SSLLIBS
) $(COMMONLIBS
) $(LIBZ
)
308 $(RM
) 32bit
/libcups.so
309 $(LN
) libcups.so
.2 32bit
/libcups.so
316 64bit
/libcups.so
.2: $(LIB64OBJS
)
317 echo Linking
64-bit
$@...
319 $(DSO
) $(ARCH64FLAGS
) $(DSO64FLAGS
) -o
$@
$(LIB64OBJS
) $(LIBGSSAPI
) \
320 $(DNSSDLIBS
) $(SSLLIBS
) $(COMMONLIBS
) $(LIBZ
)
321 $(RM
) 64bit
/libcups.so
322 $(LN
) libcups.so
.2 64bit
/libcups.so
329 libcups
.2.dylib
: $(LIBOBJS
) $(LIBCUPSORDER
)
330 echo Creating
export list for
$@...
331 nm
$(LIBOBJS
) 2>/dev
/null | grep
"T _" | awk
'{print $$3}' | \
332 grep
-v
-e
'^(_cupsConnect|_cupsSetDefaults|_cupsSetHTTPError|_cupsUserDefault|_httpWait)$$' | \
335 $(DSO
) $(ARCHFLAGS
) $(DSOFLAGS
) -o
$@ \
336 -install_name
$(libdir)/$@ \
337 -current_version
2.8.0 \
338 -compatibility_version
2.0.0 \
339 -exported_symbols_list t.exp \
340 -sectorder __TEXT __text
$(LIBCUPSORDER
) \
341 $(LIBOBJS
) $(LIBGSSAPI
) $(SSLLIBS
) $(DNSSDLIBS
) \
342 $(COMMONLIBS
) $(LIBZ
)
343 $(RM
) libcups.dylib t.exp
344 $(LN
) $@ libcups.dylib
351 libcups_s.a
: $(LIBOBJS
) libcups_s.exp
353 $(DSO
) $(DSOFLAGS
) -Wl
,-bexport
:libcups_s.exp
-o libcups_s.o \
354 $(LIBOBJS
) $(LIBGSSAPI
) $(SSLLIBS
) $(DNSSDLIBS
) \
355 $(COMMONLIBS
) $(LIBZ
) -lm
357 $(AR
) $(ARFLAGS
) $@ libcups_s.o
364 libcups.la
: $(LIBOBJS
)
366 $(CC
) $(ARCHFLAGS
) $(DSOFLAGS
) -o
$@
$(LIBOBJS
:.o
=.lo
) \
367 -rpath
$(LIBDIR
) -version-info
2:8 $(LIBGSSAPI
) $(SSLLIBS
) \
368 $(DNSSDLIBS
) $(COMMONLIBS
) $(LIBZ
)
375 libcups.a
: $(LIBOBJS
)
378 $(AR
) $(ARFLAGS
) $@
$(LIBOBJS
)
383 # testadmin (dependency on static CUPS library is intentional)
386 testadmin
: testadmin.o
$(LIBCUPSSTATIC
)
388 $(CC
) $(LDFLAGS
) -o
$@ testadmin.o
$(LIBCUPSSTATIC
) \
389 $(LIBGSSAPI
) $(SSLLIBS
) $(DNSSDLIBS
) $(COMMONLIBS
) $(LIBZ
)
393 # testarray (dependency on static CUPS library is intentional)
396 testarray
: testarray.o
$(LIBCUPSSTATIC
)
398 $(CC
) $(ARCHFLAGS
) $(LDFLAGS
) -o
$@ testarray.o
$(LIBCUPSSTATIC
) \
399 $(LIBGSSAPI
) $(SSLLIBS
) $(DNSSDLIBS
) $(COMMONLIBS
) $(LIBZ
)
400 echo Running array API tests...
405 # testconflicts (dependency on static CUPS library is intentional)
408 testconflicts
: testconflicts.o
$(LIBCUPSSTATIC
)
410 $(CC
) $(LDFLAGS
) -o
$@ testconflicts.o
$(LIBCUPSSTATIC
) \
411 $(LIBGSSAPI
) $(SSLLIBS
) $(DNSSDLIBS
) $(COMMONLIBS
) $(LIBZ
)
415 # testcups (dependency on static CUPS library is intentional)
418 testcups
: testcups.o
$(LIBCUPSSTATIC
)
420 $(CC
) $(LDFLAGS
) -o
$@ testcups.o
$(LIBCUPSSTATIC
) \
421 $(LIBGSSAPI
) $(SSLLIBS
) $(DNSSDLIBS
) $(COMMONLIBS
) $(LIBZ
)
425 # testfile (dependency on static CUPS library is intentional)
428 testfile
: testfile.o
$(LIBCUPSSTATIC
)
430 $(CC
) $(ARCHFLAGS
) $(LDFLAGS
) -o
$@ testfile.o
$(LIBCUPSSTATIC
) \
431 $(LIBGSSAPI
) $(SSLLIBS
) $(DNSSDLIBS
) $(COMMONLIBS
) $(LIBZ
)
432 echo Running file API tests...
437 # testhttp (dependency on static CUPS library is intentional)
440 testhttp
: testhttp.o
$(LIBCUPSSTATIC
)
442 $(CC
) $(ARCHFLAGS
) $(LDFLAGS
) -o
$@ testhttp.o
$(LIBCUPSSTATIC
) \
443 $(LIBGSSAPI
) $(SSLLIBS
) $(DNSSDLIBS
) $(COMMONLIBS
) $(LIBZ
)
444 echo Running HTTP API tests...
449 # testipp (dependency on static CUPS library is intentional)
452 testipp
: testipp.o
$(LIBCUPSSTATIC
)
454 $(CC
) $(ARCHFLAGS
) $(LDFLAGS
) -o
$@ testipp.o
$(LIBCUPSSTATIC
) \
455 $(LIBGSSAPI
) $(SSLLIBS
) $(DNSSDLIBS
) $(COMMONLIBS
) $(LIBZ
)
456 echo Running IPP API tests...
461 # testi18n (dependency on static CUPS library is intentional)
464 testi18n
: testi18n.o
$(LIBCUPSSTATIC
)
466 $(CC
) $(ARCHFLAGS
) $(LDFLAGS
) -o
$@ testi18n.o
$(LIBCUPSSTATIC
) \
467 $(LIBGSSAPI
) $(SSLLIBS
) $(DNSSDLIBS
) $(COMMONLIBS
) $(LIBZ
)
468 echo Running internationalization API tests...
473 # testlang (dependency on static CUPS library is intentional)
476 testlang
: testlang.o
$(LIBCUPSSTATIC
)
478 $(CC
) $(ARCHFLAGS
) $(LDFLAGS
) -o
$@ testlang.o
$(LIBCUPSSTATIC
) \
479 $(LIBGSSAPI
) $(SSLLIBS
) $(DNSSDLIBS
) $(COMMONLIBS
) $(LIBZ
)
480 echo Running language API tests...
485 # testoptions (dependency on static CUPS library is intentional)
488 testoptions
: testoptions.o
$(LIBCUPSSTATIC
)
490 $(CC
) $(ARCHFLAGS
) $(LDFLAGS
) -o
$@ testoptions.o
$(LIBCUPSSTATIC
) \
491 $(LIBGSSAPI
) $(SSLLIBS
) $(DNSSDLIBS
) $(COMMONLIBS
) $(LIBZ
)
492 echo Running option API tests...
497 # testppd (dependency on static CUPS library is intentional)
500 testppd
: testppd.o
$(LIBCUPSSTATIC
) test.ppd test2.ppd
502 $(CC
) $(ARCHFLAGS
) $(LDFLAGS
) -o
$@ testppd.o
$(LIBCUPSSTATIC
) \
503 $(LIBGSSAPI
) $(SSLLIBS
) $(DNSSDLIBS
) $(COMMONLIBS
) $(LIBZ
)
504 echo Running PPD API tests...
509 # testsnmp (dependency on static CUPS library is intentional)
512 testsnmp
: testsnmp.o
$(LIBCUPSSTATIC
)
514 $(CC
) $(LDFLAGS
) -o
$@ testsnmp.o
$(LIBCUPSSTATIC
) \
515 $(LIBGSSAPI
) $(SSLLIBS
) $(DNSSDLIBS
) $(COMMONLIBS
) $(LIBZ
)
519 # Automatic API help files...
523 echo Generating CUPS API help files...
524 mxmldoc
--section
"Programming" \
525 --title
"Introduction to CUPS Programming" \
526 --css ..
/doc
/cups-printable.css \
527 --header api-overview.header
--intro api-overview.shtml \
528 >..
/doc
/help
/api-overview.html
529 mxmldoc
--section
"Programming" --title
"Array API" \
530 --css ..
/doc
/cups-printable.css \
531 --header api-array.header
--intro api-array.shtml \
533 array.h array.c
>..
/doc
/help
/api-array.html
534 mxmldoc
--tokens help
/api-array.html api-array.xml
>..
/doc
/help
/api-array.tokens
536 mxmldoc
--section
"Programming" --title
"CUPS API" \
537 --css ..
/doc
/cups-printable.css \
538 --header api-cups.header
--intro api-cups.shtml \
540 cups.h adminutil.c dest.c language.c notify.c \
541 options.c tempfile.c usersys.c \
542 util.c
>..
/doc
/help
/api-cups.html
543 mxmldoc
--tokens help
/api-cups.html api-cups.xml
>..
/doc
/help
/api-cups.tokens
545 mxmldoc
--section
"Programming" --title
"File and Directory APIs" \
546 --css ..
/doc
/cups-printable.css \
547 --header api-filedir.header
--intro api-filedir.shtml \
549 file.h file.c
dir.h
dir.c
>..
/doc
/help
/api-filedir.html
550 mxmldoc
--tokens api-filedir.xml
>..
/doc
/help
/api-filedir.tokens
551 $(RM
) api-filedir.xml
552 mxmldoc
--section
"Programming" --title
"PPD API" \
553 --css ..
/doc
/cups-printable.css \
554 --header api-ppd.header
--intro api-ppd.shtml \
556 ppd.h attr.c conflicts.c custom.c emit.c localize.c mark.c page.c \
557 ppd.c
>..
/doc
/help
/api-ppd.html
558 mxmldoc
--tokens help
/api-ppd.html api-ppd.xml
>..
/doc
/help
/api-ppd.tokens
560 mxmldoc
--section
"Programming" --title
"HTTP and IPP APIs" \
561 --css ..
/doc
/cups-printable.css \
562 --header api-httpipp.header
--intro api-httpipp.shtml \
564 http.h ipp.h auth.c getdevices.c getputfile.c encode.c \
565 http.c http-addr.c http-support.c ipp.c ipp-support.c \
566 md5passwd.c request.c
>..
/doc
/help
/api-httpipp.html
567 mxmldoc
--tokens help
/api-httpipp.html api-httpipp.xml
>..
/doc
/help
/api-httpipp.tokens
568 $(RM
) api-httpipp.xml
569 mxmldoc
--section
"Programming" \
570 --title
"Filter and Backend Programming" \
571 --css ..
/doc
/cups-printable.css \
572 --header api-filter.header
--intro api-filter.shtml \
574 backchannel.c backend.h backend.c sidechannel.c sidechannel.h \
575 >..
/doc
/help
/api-filter.html
576 mxmldoc
--tokens help
/api-filter.html api-filter.xml
>..
/doc
/help
/api-filter.tokens
580 echo Generating CUPS API help files...
581 mxmldoc
--framed api-overview \
582 --section
"Programming" \
583 --title
"Introduction to CUPS Programming" \
584 --css ..
/doc
/cups-printable.css \
585 --header api-overview.header
--intro api-overview.shtml
586 mxmldoc
--framed api-array \
587 --section
"Programming" --title
"Array API" \
588 --css ..
/doc
/cups-printable.css \
589 --header api-array.header
--intro api-array.shtml \
591 mxmldoc
--framed api-cups \
592 --section
"Programming" --title
"CUPS API" \
593 --css ..
/doc
/cups-printable.css \
594 --header api-cups.header
--intro api-cups.shtml \
595 cups.h adminutil.c dest.c language.c notify.c \
596 options.c tempfile.c usersys.c \
598 mxmldoc
--framed api-filedir \
599 --section
"Programming" --title
"File and Directory APIs" \
600 --css ..
/doc
/cups-printable.css \
601 --header api-filedir.header
--intro api-filedir.shtml \
602 file.h file.c
dir.h
dir.c
603 mxmldoc
--framed api-ppd \
604 --section
"Programming" --title
"PPD API" \
605 --css ..
/doc
/cups-printable.css \
606 --header api-ppd.header
--intro api-ppd.shtml \
607 ppd.h attr.c conflicts.c custom.c emit.c localize.c mark.c \
609 mxmldoc
--framed api-httpipp \
610 --section
"Programming" --title
"HTTP and IPP APIs" \
611 --css ..
/doc
/cups-printable.css \
612 --header api-httpipp.header
--intro api-httpipp.shtml \
613 http.h ipp.h auth.c getdevices.c getputfile.c encode.c \
614 http.c http-addr.c http-support.c ipp.c ipp-support.c \
615 md5passwd.c request.c
616 mxmldoc
--framed api-filter \
617 --section
"Programming" \
618 --title
"Filter and Backend Programming" \
619 --css ..
/doc
/cups-printable.css \
620 --header api-filter.header
--intro api-filter.shtml \
621 backchannel.c backend.h backend.c sidechannel.c sidechannel.h
632 # End of "$Id: Makefile 7871 2008-08-27 21:12:43Z mike $".