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...
107 # Targets in this directory...
128 # Make all targets...
135 # Remove object and target files...
139 $(RM
) $(OBJS
) $(TARGETS
)
140 $(RM
) libcups.so libcups.sl libcups.dylib
145 # Update dependencies (without system header dependencies...)
149 touch Dependencies.tmp
150 makedepend
-Y
-I..
-fDependencies.tmp
$(OBJS
:.o
=.c
) >/dev
/null
2>&1
152 cp Dependencies.tmp Dependencies
153 sed
-E
-e
'1,$$s/^([^.]+)\.o:/\1\.32.o: \1\.c /' Dependencies.tmp
>>Dependencies
154 sed
-E
-e
'1,$$s/^([^.]+)\.o:/\1\.64.o: \1\.c /' Dependencies.tmp
>>Dependencies
155 $(RM
) Dependencies.tmp
159 # Install object and target files...
162 install: all installhdrs
$(INSTALLSTATIC
) $(INSTALL32
) $(INSTALL64
)
163 $(INSTALL_DIR
) -m
755 $(LIBDIR
)
164 $(INSTALL_LIB
) $(LIBCUPS
) $(LIBDIR
)
165 if
test $(LIBCUPS
) = "libcups.so.2" -o
$(LIBCUPS
) = "libcups.sl.2"; then \
166 $(RM
) $(LIBDIR
)/`basename $(LIBCUPS) .2`; \
167 $(LN
) $(LIBCUPS
) $(LIBDIR
)/`basename $(LIBCUPS) .2`; \
169 if
test $(LIBCUPS
) = "libcups.2.dylib"; then \
170 $(STRIP
) -x
$(LIBDIR
)/$(LIBCUPS
); \
171 $(RM
) $(LIBDIR
)/libcups.dylib
; \
172 $(LN
) $(LIBCUPS
) $(LIBDIR
)/libcups.dylib
; \
174 if
test "x$(SYMROOT)" != "x"; then \
175 $(INSTALL_DIR
) $(SYMROOT
); \
176 for file in
$(TARGETS
); do \
177 cp
$$file $(SYMROOT
); \
182 $(INSTALL_DIR
) -m
755 $(LIBDIR
)
183 $(INSTALL_LIB
) libcups.a
$(LIBDIR
)
184 $(RANLIB
) $(LIBDIR
)/libcups.a
187 $(INSTALL_DIR
) -m
755 $(INCLUDEDIR
)/cups
188 for file in
$(HEADERS
); do \
189 $(INSTALL_DATA
) $$file $(INCLUDEDIR
)/cups
; \
193 $(INSTALL_DIR
) -m
755 $(LIB32DIR
)
194 $(INSTALL_LIB
) 32bit
/libcups.so
.2 $(LIB32DIR
)/libcups.so
.2
195 $(LN
) libcups.so
.2 $(LIB32DIR
)/libcups.so
198 $(INSTALL_DIR
) -m
755 $(LIB64DIR
)
199 $(INSTALL_LIB
) 64bit
/libcups.so
.2 $(LIB64DIR
)/libcups.so
.2
200 $(LN
) libcups.so
.2 $(LIB64DIR
)/libcups.so
204 # Uninstall object and target files...
207 uninstall: $(UNINSTALL32
) $(UNINSTALL64
)
208 $(RM
) $(LIBDIR
)/libcups
.2.dylib
209 $(RM
) $(LIBDIR
)/libcups.a
210 $(RM
) $(LIBDIR
)/libcups.dylib
211 $(RM
) $(LIBDIR
)/libcups_s.a
212 $(RM
) $(LIBDIR
)/libcups.sl
213 $(RM
) $(LIBDIR
)/libcups.sl
.2
214 $(RM
) $(LIBDIR
)/libcups.so
215 $(RM
) $(LIBDIR
)/libcups.so
.2
217 for file in
$(HEADERS
); do \
218 $(RM
) $(INCLUDEDIR
)/cups
/$$file; \
220 -$(RMDIR
) $(INCLUDEDIR
)/cups
223 $(RM
) $(LIB32DIR
)/libcups.so
224 $(RM
) $(LIB32DIR
)/libcups.so
.2
225 -$(RMDIR
) $(LIB32DIR
)
228 $(RM
) $(LIB64DIR
)/libcups.so
229 $(RM
) $(LIB64DIR
)/libcups.so
.2
230 -$(RMDIR
) $(LIB64DIR
)
234 # libcups.so.2, libcups.sl.2
237 libcups.so
.2 libcups.sl
.2: $(LIBOBJS
)
239 $(DSO
) $(ARCHFLAGS
) $(DSOFLAGS
) -o
$@
$(LIBOBJS
) $(LIBGSSAPI
) $(SSLLIBS
) $(COMMONLIBS
) $(LIBZ
)
240 $(RM
) `basename $@ .2`
241 $(LN
) $@
`basename $@ .2`
248 32bit
/libcups.so
.2: $(LIB32OBJS
)
249 echo Linking
32-bit
$@...
251 $(DSO
) $(ARCH32FLAGS
) $(DSO32FLAGS
) -o
$@
$(LIB32OBJS
) $(LIBGSSAPI
) $(SSLLIBS
) $(COMMONLIBS
) $(LIBZ
)
252 $(RM
) 32bit
/libcups.so
253 $(LN
) libcups.so
.2 32bit
/libcups.so
260 64bit
/libcups.so
.2: $(LIB64OBJS
)
261 echo Linking
64-bit
$@...
263 $(DSO
) $(ARCH64FLAGS
) $(DSO64FLAGS
) -o
$@
$(LIB64OBJS
) $(LIBGSSAPI
) $(SSLLIBS
) $(COMMONLIBS
) $(LIBZ
)
264 $(RM
) 64bit
/libcups.so
265 $(LN
) libcups.so
.2 64bit
/libcups.so
272 libcups
.2.dylib
: $(LIBOBJS
) $(LIBCUPSORDER
) libcups.exp
274 $(DSO
) $(ARCHFLAGS
) $(DSOFLAGS
) -o
$@ \
275 -install_name
$(libdir)/$@ \
276 -current_version
2.8.0 \
277 -compatibility_version
2.0.0 \
278 -exported_symbols_list libcups.exp \
279 -sectorder __TEXT __text
$(LIBCUPSORDER
) \
280 $(LIBOBJS
) $(LIBGSSAPI
) $(SSLLIBS
) $(COMMONLIBS
) $(LIBZ
)
282 $(LN
) $@ libcups.dylib
289 libcups_s.a
: $(LIBOBJS
) libcups_s.exp
291 $(DSO
) $(DSOFLAGS
) -Wl
,-bexport
:libcups_s.exp
-o libcups_s.o
$(LIBOBJS
) $(LIBGSSAPI
) $(SSLLIBS
) $(COMMONLIBS
) $(LIBZ
) -lm
293 $(AR
) $(ARFLAGS
) $@ libcups_s.o
300 libcups.la
: $(LIBOBJS
)
302 $(CC
) $(ARCHFLAGS
) $(DSOFLAGS
) -o
$@
$(LIBOBJS
:.o
=.lo
) -rpath
$(LIBDIR
) \
303 -version-info
2:8 $(LIBGSSAPI
) $(SSLLIBS
) $(COMMONLIBS
) $(LIBZ
)
310 libcups.a
: $(LIBOBJS
)
313 $(AR
) $(ARFLAGS
) $@
$(LIBOBJS
)
318 # CUPS language bindings for various scripting languages...
320 # NOTE: Not currently used or functional - see the scripting/php directory
321 # for the hand-written bindings...
324 phpcups.so
: $(LIBCUPS
) php_cups_wrap.o
326 if
test `uname` = Darwin
; then \
327 DSOFLAGS
="-bundle -flat_namespace -undefined suppress"; \
329 DSOFLAGS
="$(DSOFLAGS)"; \
331 $(DSO
) $$DSOFLAGS -o
$@ php_cups_wrap.o
$(LIBS
) `php-config --ldflags --libs`
333 php_cups_wrap.o
: php_cups_wrap.c
335 $(CC
) $(CFLAGS
) `php-config --includes` -c
$<
336 php_cups_wrap.c
: cups.h
337 echo Creating
$< using SWIG...
338 swig
-php
-o
$@
-module cups cups.h
342 # testadmin (dependency on static CUPS library is intentional)
345 testadmin
: testadmin.o libcups.a
347 $(CC
) $(LDFLAGS
) -o
$@ testadmin.o libcups.a \
348 $(LIBGSSAPI
) $(SSLLIBS
) $(COMMONLIBS
) $(LIBZ
)
352 # testarray (dependency on static CUPS library is intentional)
355 testarray
: testarray.o libcups.a
357 $(CC
) $(LDFLAGS
) -o
$@ testarray.o libcups.a \
358 $(LIBGSSAPI
) $(SSLLIBS
) $(COMMONLIBS
) $(LIBZ
)
362 # testcups (dependency on static CUPS library is intentional)
365 testcups
: testcups.o libcups.a
367 $(CC
) $(LDFLAGS
) -o
$@ testcups.o libcups.a \
368 $(LIBGSSAPI
) $(SSLLIBS
) $(COMMONLIBS
) $(LIBZ
)
372 # testfile (dependency on static CUPS library is intentional)
375 testfile
: testfile.o libcups.a
377 $(CC
) $(LDFLAGS
) -o
$@ testfile.o libcups.a \
378 $(LIBGSSAPI
) $(SSLLIBS
) $(COMMONLIBS
) $(LIBZ
)
382 # testhttp (dependency on static CUPS library is intentional)
385 testhttp
: testhttp.o libcups.a
387 $(CC
) $(LDFLAGS
) -o
$@ testhttp.o libcups.a \
388 $(LIBGSSAPI
) $(SSLLIBS
) $(COMMONLIBS
) $(LIBZ
)
392 # testipp (dependency on static CUPS library is intentional)
395 testipp
: testipp.o libcups.a
397 $(CC
) $(LDFLAGS
) -o
$@ testipp.o libcups.a \
398 $(LIBGSSAPI
) $(SSLLIBS
) $(COMMONLIBS
) $(LIBZ
)
402 # testi18n (dependency on static CUPS library is intentional)
405 testi18n
: testi18n.o libcups.a
407 $(CC
) $(LDFLAGS
) -o
$@ testi18n.o libcups.a \
408 $(LIBGSSAPI
) $(SSLLIBS
) $(COMMONLIBS
) $(LIBZ
)
412 # testlang (dependency on static CUPS library is intentional)
415 testlang
: testlang.o libcups.a
417 $(CC
) $(LDFLAGS
) -o
$@ testlang.o libcups.a \
418 $(LIBGSSAPI
) $(SSLLIBS
) $(COMMONLIBS
) $(LIBZ
)
422 # testppd (dependency on static CUPS library is intentional)
425 testppd
: testppd.o libcups.a
427 $(CC
) $(LDFLAGS
) -o
$@ testppd.o libcups.a \
428 $(LIBGSSAPI
) $(SSLLIBS
) $(COMMONLIBS
) $(LIBZ
)
432 # testsnmp (dependency on static CUPS library is intentional)
435 testsnmp
: testsnmp.o libcups.a
437 $(CC
) $(LDFLAGS
) -o
$@ testsnmp.o libcups.a \
438 $(LIBGSSAPI
) $(SSLLIBS
) $(COMMONLIBS
) $(LIBZ
)
442 # Automatic API help files...
446 echo Generating CUPS API help files...
447 mxmldoc
--section
"Programming" \
448 --title
"Introduction to CUPS Programming" \
449 --css ..
/doc
/cups-printable.css \
450 --header api-overview.header
--intro api-overview.shtml \
451 >..
/doc
/help
/api-overview.html
452 mxmldoc
--section
"Programming" --title
"Array API" \
453 --css ..
/doc
/cups-printable.css \
454 --header api-array.header
--intro api-array.shtml \
455 array.h array.c
>..
/doc
/help
/api-array.html
456 mxmldoc
--section
"Programming" --title
"CUPS API" \
457 --css ..
/doc
/cups-printable.css \
458 --header api-cups.header
--intro api-cups.shtml \
459 cups.h dest.c getputfile.c language.c notify.c \
460 options.c tempfile.c usersys.c \
461 util.c
>..
/doc
/help
/api-cups.html
462 mxmldoc
--section
"Programming" --title
"File and Directory APIs" \
463 --css ..
/doc
/cups-printable.css \
464 --header api-filedir.header
--intro api-filedir.shtml \
465 file.h file.c
dir.h
dir.c
>..
/doc
/help
/api-filedir.html
466 mxmldoc
--section
"Programming" --title
"PPD API" \
467 --css ..
/doc
/cups-printable.css \
468 --header api-ppd.header
--intro api-ppd.shtml \
469 ppd.h attr.c custom.c emit.c localize.c mark.c page.c \
470 ppd.c
>..
/doc
/help
/api-ppd.html
471 mxmldoc
--section
"Programming" --title
"HTTP and IPP APIs" \
472 --css ..
/doc
/cups-printable.css \
473 --header api-httpipp.header
--intro api-httpipp.shtml \
474 http.h ipp.h auth.c encode.c http.c http-addr.c \
475 http-support.c ipp.c ipp-support.c md5passwd.c \
476 request.c
>..
/doc
/help
/api-httpipp.html
477 mxmldoc
--section
"Programming" \
478 --title
"Filter and Backend Programming" \
479 --css ..
/doc
/cups-printable.css \
480 --header api-filter.header
--intro api-filter.shtml \
481 backchannel.c backend.h backend.c sidechannel.c sidechannel.h \
482 snmp.c snmp.h
>..
/doc
/help
/api-filter.html
485 echo Generating CUPS API help files...
486 mxmldoc
--framed api-overview \
487 --section
"Programming" \
488 --title
"Introduction to CUPS Programming" \
489 --css ..
/doc
/cups-printable.css \
490 --header api-overview.header
--intro api-overview.shtml
491 mxmldoc
--framed api-array \
492 --section
"Programming" --title
"Array API" \
493 --css ..
/doc
/cups-printable.css \
494 --header api-array.header
--intro api-array.shtml \
496 mxmldoc
--framed api-cups \
497 --section
"Programming" --title
"CUPS API" \
498 --css ..
/doc
/cups-printable.css \
499 --header api-cups.header
--intro api-cups.shtml \
500 cups.h dest.c getputfile.c language.c notify.c \
501 options.c tempfile.c usersys.c \
503 mxmldoc
--framed api-filedir \
504 --section
"Programming" --title
"File and Directory APIs" \
505 --css ..
/doc
/cups-printable.css \
506 --header api-filedir.header
--intro api-filedir.shtml \
507 file.h file.c
dir.h
dir.c
508 mxmldoc
--framed api-ppd \
509 --section
"Programming" --title
"PPD API" \
510 --css ..
/doc
/cups-printable.css \
511 --header api-ppd.header
--intro api-ppd.shtml \
512 ppd.h attr.c custom.c emit.c localize.c mark.c page.c \
514 mxmldoc
--framed api-httpipp \
515 --section
"Programming" --title
"HTTP and IPP APIs" \
516 --css ..
/doc
/cups-printable.css \
517 --header api-httpipp.header
--intro api-httpipp.shtml \
518 http.h ipp.h auth.c encode.c http.c http-addr.c \
519 http-support.c ipp.c ipp-support.c md5passwd.c \
521 mxmldoc
--framed api-filter \
522 --section
"Programming" \
523 --title
"Filter and Backend Programming" \
524 --css ..
/doc
/cups-printable.css \
525 --header api-filter.header
--intro api-filter.shtml \
526 backchannel.c backend.h backend.c sidechannel.c sidechannel.h \
538 # End of "$Id: Makefile 6649 2007-07-11 21:46:42Z mike $".