2 # "$Id: Makefile 6649 2007-07-11 21:46:42Z mike $"
4 # API library Makefile for the Common UNIX Printing System (CUPS).
6 # Copyright 2007-2008 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.
65 LIB32OBJS
= $(LIBOBJS
:.o
=.32.o
)
66 LIB64OBJS
= $(LIBOBJS
:.o
=.64.o
)
85 # Header files to install...
108 # Targets in this directory...
129 # Make all targets...
136 # Remove object and target files...
140 $(RM
) $(OBJS
) $(TARGETS
)
141 $(RM
) libcups.so libcups.sl libcups.dylib
146 # Update dependencies (without system header dependencies...)
150 touch Dependencies.tmp
151 makedepend
-Y
-I..
-fDependencies.tmp
$(OBJS
:.o
=.c
) >/dev
/null
2>&1
153 cp Dependencies.tmp Dependencies
154 sed
-E
-e
'1,$$s/^([^.]+)\.o:/\1\.32.o: \1\.c /' Dependencies.tmp
>>Dependencies
155 sed
-E
-e
'1,$$s/^([^.]+)\.o:/\1\.64.o: \1\.c /' Dependencies.tmp
>>Dependencies
156 $(RM
) Dependencies.tmp
160 # Install object and target files...
163 install: all installhdrs
$(INSTALLSTATIC
) $(INSTALL32
) $(INSTALL64
)
164 $(INSTALL_DIR
) -m
755 $(LIBDIR
)
165 $(INSTALL_LIB
) $(LIBCUPS
) $(LIBDIR
)
166 if
test $(LIBCUPS
) = "libcups.so.2" -o
$(LIBCUPS
) = "libcups.sl.2"; then \
167 $(RM
) $(LIBDIR
)/`basename $(LIBCUPS) .2`; \
168 $(LN
) $(LIBCUPS
) $(LIBDIR
)/`basename $(LIBCUPS) .2`; \
170 if
test $(LIBCUPS
) = "libcups.2.dylib"; then \
171 $(STRIP
) -x
$(LIBDIR
)/$(LIBCUPS
); \
172 $(RM
) $(LIBDIR
)/libcups.dylib
; \
173 $(LN
) $(LIBCUPS
) $(LIBDIR
)/libcups.dylib
; \
175 if
test "x$(SYMROOT)" != "x"; then \
176 $(INSTALL_DIR
) $(SYMROOT
); \
177 for file in
$(TARGETS
); do \
178 cp
$$file $(SYMROOT
); \
183 $(INSTALL_DIR
) -m
755 $(LIBDIR
)
184 $(INSTALL_LIB
) libcups.a
$(LIBDIR
)
185 $(RANLIB
) $(LIBDIR
)/libcups.a
188 $(INSTALL_DIR
) -m
755 $(INCLUDEDIR
)/cups
189 for file in
$(HEADERS
); do \
190 $(INSTALL_DATA
) $$file $(INCLUDEDIR
)/cups
; \
194 $(INSTALL_DIR
) -m
755 $(LIB32DIR
)
195 $(INSTALL_LIB
) 32bit
/libcups.so
.2 $(LIB32DIR
)/libcups.so
.2
196 $(LN
) libcups.so
.2 $(LIB32DIR
)/libcups.so
199 $(INSTALL_DIR
) -m
755 $(LIB64DIR
)
200 $(INSTALL_LIB
) 64bit
/libcups.so
.2 $(LIB64DIR
)/libcups.so
.2
201 $(LN
) libcups.so
.2 $(LIB64DIR
)/libcups.so
205 # Uninstall object and target files...
208 uninstall: $(UNINSTALL32
) $(UNINSTALL64
)
209 $(RM
) $(LIBDIR
)/libcups
.2.dylib
210 $(RM
) $(LIBDIR
)/libcups.a
211 $(RM
) $(LIBDIR
)/libcups.dylib
212 $(RM
) $(LIBDIR
)/libcups_s.a
213 $(RM
) $(LIBDIR
)/libcups.sl
214 $(RM
) $(LIBDIR
)/libcups.sl
.2
215 $(RM
) $(LIBDIR
)/libcups.so
216 $(RM
) $(LIBDIR
)/libcups.so
.2
218 for file in
$(HEADERS
); do \
219 $(RM
) $(INCLUDEDIR
)/cups
/$$file; \
221 -$(RMDIR
) $(INCLUDEDIR
)/cups
224 $(RM
) $(LIB32DIR
)/libcups.so
225 $(RM
) $(LIB32DIR
)/libcups.so
.2
226 -$(RMDIR
) $(LIB32DIR
)
229 $(RM
) $(LIB64DIR
)/libcups.so
230 $(RM
) $(LIB64DIR
)/libcups.so
.2
231 -$(RMDIR
) $(LIB64DIR
)
235 # libcups.so.2, libcups.sl.2
238 libcups.so
.2 libcups.sl
.2: $(LIBOBJS
)
240 $(DSO
) $(ARCHFLAGS
) $(DSOFLAGS
) -o
$@
$(LIBOBJS
) $(LIBGSSAPI
) $(SSLLIBS
) $(COMMONLIBS
) $(LIBZ
)
241 $(RM
) `basename $@ .2`
242 $(LN
) $@
`basename $@ .2`
249 32bit
/libcups.so
.2: $(LIB32OBJS
)
250 echo Linking
32-bit
$@...
252 $(DSO
) $(ARCH32FLAGS
) $(DSO32FLAGS
) -o
$@
$(LIB32OBJS
) $(LIBGSSAPI
) $(SSLLIBS
) $(COMMONLIBS
) $(LIBZ
)
253 $(RM
) 32bit
/libcups.so
254 $(LN
) libcups.so
.2 32bit
/libcups.so
261 64bit
/libcups.so
.2: $(LIB64OBJS
)
262 echo Linking
64-bit
$@...
264 $(DSO
) $(ARCH64FLAGS
) $(DSO64FLAGS
) -o
$@
$(LIB64OBJS
) $(LIBGSSAPI
) $(SSLLIBS
) $(COMMONLIBS
) $(LIBZ
)
265 $(RM
) 64bit
/libcups.so
266 $(LN
) libcups.so
.2 64bit
/libcups.so
273 libcups
.2.dylib
: $(LIBOBJS
) $(LIBCUPSORDER
) libcups.exp
275 $(DSO
) $(ARCHFLAGS
) $(DSOFLAGS
) -o
$@ \
276 -install_name
$(libdir)/$@ \
277 -current_version
2.8.0 \
278 -compatibility_version
2.0.0 \
279 -exported_symbols_list libcups.exp \
280 -sectorder __TEXT __text
$(LIBCUPSORDER
) \
281 $(LIBOBJS
) $(LIBGSSAPI
) $(SSLLIBS
) $(COMMONLIBS
) $(LIBZ
)
283 $(LN
) $@ libcups.dylib
290 libcups_s.a
: $(LIBOBJS
) libcups_s.exp
292 $(DSO
) $(DSOFLAGS
) -Wl
,-bexport
:libcups_s.exp
-o libcups_s.o
$(LIBOBJS
) $(LIBGSSAPI
) $(SSLLIBS
) $(COMMONLIBS
) $(LIBZ
) -lm
294 $(AR
) $(ARFLAGS
) $@ libcups_s.o
301 libcups.la
: $(LIBOBJS
)
303 $(CC
) $(ARCHFLAGS
) $(DSOFLAGS
) -o
$@
$(LIBOBJS
:.o
=.lo
) -rpath
$(LIBDIR
) \
304 -version-info
2:8 $(LIBGSSAPI
) $(SSLLIBS
) $(COMMONLIBS
) $(LIBZ
)
311 libcups.a
: $(LIBOBJS
)
314 $(AR
) $(ARFLAGS
) $@
$(LIBOBJS
)
319 # CUPS language bindings for various scripting languages...
321 # NOTE: Not currently used or functional - see the scripting/php directory
322 # for the hand-written bindings...
325 phpcups.so
: $(LIBCUPS
) php_cups_wrap.o
327 if
test `uname` = Darwin
; then \
328 DSOFLAGS
="-bundle -flat_namespace -undefined suppress"; \
330 DSOFLAGS
="$(DSOFLAGS)"; \
332 $(DSO
) $$DSOFLAGS -o
$@ php_cups_wrap.o
$(LIBS
) `php-config --ldflags --libs`
334 php_cups_wrap.o
: php_cups_wrap.c
336 $(CC
) $(CFLAGS
) `php-config --includes` -c
$<
337 php_cups_wrap.c
: cups.h
338 echo Creating
$< using SWIG...
339 swig
-php
-o
$@
-module cups cups.h
343 # testadmin (dependency on static CUPS library is intentional)
346 testadmin
: testadmin.o libcups.a
348 $(CC
) $(LDFLAGS
) -o
$@ testadmin.o libcups.a \
349 $(LIBGSSAPI
) $(SSLLIBS
) $(COMMONLIBS
) $(LIBZ
)
353 # testarray (dependency on static CUPS library is intentional)
356 testarray
: testarray.o libcups.a
358 $(CC
) $(LDFLAGS
) -o
$@ testarray.o libcups.a \
359 $(LIBGSSAPI
) $(SSLLIBS
) $(COMMONLIBS
) $(LIBZ
)
363 # testcups (dependency on static CUPS library is intentional)
366 testcups
: testcups.o libcups.a
368 $(CC
) $(LDFLAGS
) -o
$@ testcups.o libcups.a \
369 $(LIBGSSAPI
) $(SSLLIBS
) $(COMMONLIBS
) $(LIBZ
)
373 # testfile (dependency on static CUPS library is intentional)
376 testfile
: testfile.o libcups.a
378 $(CC
) $(LDFLAGS
) -o
$@ testfile.o libcups.a \
379 $(LIBGSSAPI
) $(SSLLIBS
) $(COMMONLIBS
) $(LIBZ
)
383 # testhttp (dependency on static CUPS library is intentional)
386 testhttp
: testhttp.o libcups.a
388 $(CC
) $(LDFLAGS
) -o
$@ testhttp.o libcups.a \
389 $(LIBGSSAPI
) $(SSLLIBS
) $(COMMONLIBS
) $(LIBZ
)
393 # testipp (dependency on static CUPS library is intentional)
396 testipp
: testipp.o libcups.a
398 $(CC
) $(LDFLAGS
) -o
$@ testipp.o libcups.a \
399 $(LIBGSSAPI
) $(SSLLIBS
) $(COMMONLIBS
) $(LIBZ
)
403 # testi18n (dependency on static CUPS library is intentional)
406 testi18n
: testi18n.o libcups.a
408 $(CC
) $(LDFLAGS
) -o
$@ testi18n.o libcups.a \
409 $(LIBGSSAPI
) $(SSLLIBS
) $(COMMONLIBS
) $(LIBZ
)
413 # testlang (dependency on static CUPS library is intentional)
416 testlang
: testlang.o libcups.a
418 $(CC
) $(LDFLAGS
) -o
$@ testlang.o libcups.a \
419 $(LIBGSSAPI
) $(SSLLIBS
) $(COMMONLIBS
) $(LIBZ
)
423 # testppd (dependency on static CUPS library is intentional)
426 testppd
: testppd.o libcups.a
428 $(CC
) $(LDFLAGS
) -o
$@ testppd.o libcups.a \
429 $(LIBGSSAPI
) $(SSLLIBS
) $(COMMONLIBS
) $(LIBZ
)
433 # testsnmp (dependency on static CUPS library is intentional)
436 testsnmp
: testsnmp.o libcups.a
438 $(CC
) $(LDFLAGS
) -o
$@ testsnmp.o libcups.a \
439 $(LIBGSSAPI
) $(SSLLIBS
) $(COMMONLIBS
) $(LIBZ
)
443 # Automatic API help files...
447 echo Generating CUPS API help files...
448 mxmldoc
--section
"Programming" \
449 --title
"Introduction to CUPS Programming" \
450 --css ..
/doc
/cups-printable.css \
451 --header api-overview.header
--intro api-overview.shtml \
452 >..
/doc
/help
/api-overview.html
453 mxmldoc
--section
"Programming" --title
"Array API" \
454 --css ..
/doc
/cups-printable.css \
455 --header api-array.header
--intro api-array.shtml \
456 array.h array.c
>..
/doc
/help
/api-array.html
457 mxmldoc
--section
"Programming" --title
"CUPS API" \
458 --css ..
/doc
/cups-printable.css \
459 --header api-cups.header
--intro api-cups.shtml \
460 cups.h dest.c getputfile.c language.c notify.c \
461 options.c tempfile.c usersys.c \
462 util.c
>..
/doc
/help
/api-cups.html
463 mxmldoc
--section
"Programming" --title
"File and Directory APIs" \
464 --css ..
/doc
/cups-printable.css \
465 --header api-filedir.header
--intro api-filedir.shtml \
466 file.h file.c
dir.h
dir.c
>..
/doc
/help
/api-filedir.html
467 mxmldoc
--section
"Programming" --title
"PPD API" \
468 --css ..
/doc
/cups-printable.css \
469 --header api-ppd.header
--intro api-ppd.shtml \
470 ppd.h attr.c custom.c emit.c localize.c mark.c page.c \
471 ppd.c
>..
/doc
/help
/api-ppd.html
472 mxmldoc
--section
"Programming" --title
"HTTP and IPP APIs" \
473 --css ..
/doc
/cups-printable.css \
474 --header api-httpipp.header
--intro api-httpipp.shtml \
475 http.h ipp.h auth.c encode.c http.c http-addr.c \
476 http-support.c ipp.c ipp-support.c md5passwd.c \
477 request.c
>..
/doc
/help
/api-httpipp.html
478 mxmldoc
--section
"Programming" \
479 --title
"Filter and Backend Programming" \
480 --css ..
/doc
/cups-printable.css \
481 --header api-filter.header
--intro api-filter.shtml \
482 backchannel.c backend.h backend.c sidechannel.c sidechannel.h \
483 snmp.c snmp.h
>..
/doc
/help
/api-filter.html
486 echo Generating CUPS API help files...
487 mxmldoc
--framed api-overview \
488 --section
"Programming" \
489 --title
"Introduction to CUPS Programming" \
490 --css ..
/doc
/cups-printable.css \
491 --header api-overview.header
--intro api-overview.shtml
492 mxmldoc
--framed api-array \
493 --section
"Programming" --title
"Array API" \
494 --css ..
/doc
/cups-printable.css \
495 --header api-array.header
--intro api-array.shtml \
497 mxmldoc
--framed api-cups \
498 --section
"Programming" --title
"CUPS API" \
499 --css ..
/doc
/cups-printable.css \
500 --header api-cups.header
--intro api-cups.shtml \
501 cups.h dest.c getputfile.c language.c notify.c \
502 options.c tempfile.c usersys.c \
504 mxmldoc
--framed api-filedir \
505 --section
"Programming" --title
"File and Directory APIs" \
506 --css ..
/doc
/cups-printable.css \
507 --header api-filedir.header
--intro api-filedir.shtml \
508 file.h file.c
dir.h
dir.c
509 mxmldoc
--framed api-ppd \
510 --section
"Programming" --title
"PPD API" \
511 --css ..
/doc
/cups-printable.css \
512 --header api-ppd.header
--intro api-ppd.shtml \
513 ppd.h attr.c custom.c emit.c localize.c mark.c page.c \
515 mxmldoc
--framed api-httpipp \
516 --section
"Programming" --title
"HTTP and IPP APIs" \
517 --css ..
/doc
/cups-printable.css \
518 --header api-httpipp.header
--intro api-httpipp.shtml \
519 http.h ipp.h auth.c encode.c http.c http-addr.c \
520 http-support.c ipp.c ipp-support.c md5passwd.c \
522 mxmldoc
--framed api-filter \
523 --section
"Programming" \
524 --title
"Filter and Backend Programming" \
525 --css ..
/doc
/cups-printable.css \
526 --header api-filter.header
--intro api-filter.shtml \
527 backchannel.c backend.h backend.c sidechannel.c sidechannel.h \
539 # End of "$Id: Makefile 6649 2007-07-11 21:46:42Z mike $".