2 # "$Id: Makefile 5303 2006-03-18 01:05:59Z mike $"
4 # API library Makefile for the Common UNIX Printing System (CUPS).
6 # Copyright 1997-2006 by Easy Software Products, all rights reserved.
8 # These coded instructions, statements, and computer programs are the
9 # property of Easy Software Products and are protected by Federal
10 # copyright law. Distribution and use rights are outlined in the file
11 # "LICENSE.txt" which should have been included with this file. If this
12 # file is missing or damaged please contact Easy Software Products
15 # Attn: CUPS Licensing Information
16 # Easy Software Products
17 # 44141 Airport View Drive, Suite 204
18 # Hollywood, Maryland 20636 USA
20 # Voice: (301) 373-9600
21 # EMail: cups-info@cups.org
22 # WWW: http://www.cups.org
24 # This file is subject to the Apple OS-Developed Software exception.
71 LIB32OBJS
= $(LIBOBJS
:.o
=.32.o
)
72 LIB64OBJS
= $(LIBOBJS
:.o
=.64.o
)
89 # Header files to install...
108 # Targets in this directory...
127 # Make all targets...
134 # Remove object and target files...
138 $(RM
) $(OBJS
) $(TARGETS
)
139 $(RM
) libcups.so libcups.sl libcups.dylib libcups
.32.so libcups
.64.so
143 # Update dependencies (without system header dependencies...)
147 touch Dependencies.tmp
148 makedepend
-Y
-I..
-fDependencies.tmp
$(OBJS
:.o
=.c
) >/dev
/null
2>&1
150 cp Dependencies.tmp Dependencies
151 sed
-r
-e
'1,$$s/^([^.]+)\.o:/\1\.32.o: \1\.c /' Dependencies.tmp
>>Dependencies
152 sed
-r
-e
'1,$$s/^([^.]+)\.o:/\1\.64.o: \1\.c /' Dependencies.tmp
>>Dependencies
153 $(RM
) Dependencies.tmp
157 # Install object and target files...
160 install: all installhdrs
$(INSTALLSTATIC
) $(INSTALL32
) $(INSTALL64
)
161 $(INSTALL_DIR
) -m
755 $(LIBDIR
)
162 $(INSTALL_LIB
) $(LIBCUPS
) $(LIBDIR
)
163 if
test $(LIBCUPS
) = "libcups.so.2" -o
$(LIBCUPS
) = "libcups.sl.2"; then \
164 $(RM
) $(LIBDIR
)/`basename $(LIBCUPS) .2`; \
165 $(LN
) $(LIBCUPS
) $(LIBDIR
)/`basename $(LIBCUPS) .2`; \
167 if
test $(LIBCUPS
) = "libcups.2.dylib"; then \
168 $(STRIP
) -x
$(LIBDIR
)/$(LIBCUPS
); \
169 $(RM
) $(LIBDIR
)/libcups.dylib
; \
170 $(LN
) $(LIBCUPS
) $(LIBDIR
)/libcups.dylib
; \
174 $(INSTALL_DIR
) -m
755 $(LIBDIR
)
175 if
test $(LIBCUPS
) != "libcups.a"; then \
176 $(INSTALL_LIB
) libcups.a
$(LIBDIR
); \
177 $(RANLIB
) $(LIBDIR
)/libcups.a
; \
181 $(INSTALL_DIR
) -m
755 $(INCLUDEDIR
)/cups
182 for file in
$(HEADERS
); do \
183 $(INSTALL_DATA
) $$file $(INCLUDEDIR
)/cups
; \
187 $(INSTALL_DIR
) -m
755 $(LIB32DIR
)
188 $(INSTALL_LIB
) libcups
.32.so
.2 $(LIB32DIR
)/libcups.so
.2
189 $(LN
) libcups.so
$(LIB32DIR
)/libcups.so
.2
192 $(INSTALL_DIR
) -m
755 $(LIB64DIR
)
193 $(INSTALL_LIB
) libcups
.64.so
.2 $(LIB64DIR
)/libcups.so
.2
194 $(LN
) libcups.so
$(LIB64DIR
)/libcups.so
.2
198 # Uninstall object and target files...
201 uninstall: $(UNINSTALL32
) $(UNINSTALL64
)
202 $(RM
) $(LIBDIR
)/libcups
.2.dylib
203 $(RM
) $(LIBDIR
)/libcups.a
204 $(RM
) $(LIBDIR
)/libcups.dylib
205 $(RM
) $(LIBDIR
)/libcups_s.a
206 $(RM
) $(LIBDIR
)/libcups.sl
207 $(RM
) $(LIBDIR
)/libcups.sl
.2
208 $(RM
) $(LIBDIR
)/libcups.so
209 $(RM
) $(LIBDIR
)/libcups.so
.2
211 for file in
$(HEADERS
); do \
212 $(RM
) $(INCLUDEDIR
)/cups
/$$file; \
214 -$(RMDIR
) $(INCLUDEDIR
)/cups
217 $(RM
) $(LIB32DIR
)/libcups.so
218 $(RM
) $(LIB32DIR
)/libcups.so
.2
219 -$(RMDIR
) $(LIB32DIR
)
222 $(RM
) $(LIB64DIR
)/libcups.so
223 $(RM
) $(LIB64DIR
)/libcups.so
.2
224 -$(RMDIR
) $(LIB64DIR
)
228 # libcups.so.2, libcups.sl.2
231 libcups.so
.2 libcups.sl
.2: $(LIBOBJS
)
233 $(DSO
) $(ARCHFLAGS
) $(DSOFLAGS
) -o
$@
$(LIBOBJS
) $(SSLLIBS
) $(COMMONLIBS
) $(LIBZ
)
234 $(RM
) `basename $@ .2`
235 $(LN
) $@
`basename $@ .2`
242 libcups
.32.so
.2: $(LIB32OBJS
)
243 echo Linking
32-bit
$@...
244 $(DSO
) $(ARCH32FLAGS
) $(DSOFLAGS
) -o
$@
$(LIB32OBJS
) $(SSLLIBS
) $(COMMONLIBS
) $(LIBZ
)
251 libcups
.64.so
.2: $(LIB64OBJS
)
252 echo Linking
64-bit
$@...
253 $(DSO
) $(ARCH64FLAGS
) $(DSOFLAGS
) -o
$@
$(LIB64OBJS
) $(SSLLIBS
) $(COMMONLIBS
) $(LIBZ
)
260 libcups
.2.dylib
: $(LIBOBJS
)
262 $(DSO
) $(ARCHFLAGS
) $(DSOFLAGS
) -o
$@ \
263 -install_name
$(libdir)/$@ \
264 -current_version
2.7.0 \
265 -compatibility_version
2.0.0 \
266 $(LIBOBJS
) $(SSLLIBS
) $(COMMONLIBS
) $(LIBZ
)
268 $(LN
) $@ libcups.dylib
275 libcups_s.a
: $(LIBOBJS
)
277 $(DSO
) $(DSOFLAGS
) -Wl
,-bexport
:libcups_s.exp
-o libcups_s.o
$(LIBOBJS
) $(SSLLIBS
) $(COMMONLIBS
) $(LIBZ
) -lm
279 $(AR
) $(ARFLAGS
) $@ libcups_s.o
286 libcups.la
: $(LIBOBJS
)
288 $(CC
) $(ARCHFLAGS
) $(DSOFLAGS
) -o
$@
$(LIBOBJS
:.o
=.lo
) -rpath
$(LIBDIR
) \
289 -version-info
2:7 $(SSLLIBS
) $(COMMONLIBS
) $(LIBZ
)
296 libcups.a
: $(LIBOBJS
)
299 $(AR
) $(ARFLAGS
) $@
$(LIBOBJS
)
304 # CUPS language bindings for various scripting languages...
306 # NOTE: Not currently used or functional - see the scripting/php directory
307 # for the hand-written bindings...
310 phpcups.so
: $(LIBCUPS
) php_cups_wrap.o
312 if
test `uname` = Darwin
; then \
313 DSOFLAGS
="-bundle -flat_namespace -undefined suppress"; \
315 DSOFLAGS
="$(DSOFLAGS)"; \
317 $(DSO
) $$DSOFLAGS -o
$@ php_cups_wrap.o
$(LIBS
) `php-config --ldflags --libs`
319 php_cups_wrap.o
: php_cups_wrap.c
321 $(CC
) $(CFLAGS
) `php-config --includes` -c
$<
322 php_cups_wrap.c
: cups.h
323 echo Creating
$< using SWIG...
324 swig
-php
-o
$@
-module cups cups.h
328 # testadmin (dependency on static CUPS library is intentional)
331 testadmin
: testadmin.o libcups.a
333 $(CC
) $(LDFLAGS
) -o
$@ testadmin.o libcups.a \
334 $(SSLLIBS
) $(COMMONLIBS
) $(LIBZ
)
338 # testarray (dependency on static CUPS library is intentional)
341 testarray
: testarray.o libcups.a
343 $(CC
) $(LDFLAGS
) -o
$@ testarray.o libcups.a \
344 $(SSLLIBS
) $(COMMONLIBS
) $(LIBZ
)
348 # testfile (dependency on static CUPS library is intentional)
351 testfile
: testfile.o libcups.a
353 $(CC
) $(LDFLAGS
) -o
$@ testfile.o libcups.a \
354 $(SSLLIBS
) $(COMMONLIBS
) $(LIBZ
)
358 # testhttp (dependency on static CUPS library is intentional)
361 testhttp
: testhttp.o libcups.a
363 $(CC
) $(LDFLAGS
) -o
$@ testhttp.o libcups.a \
364 $(SSLLIBS
) $(COMMONLIBS
) $(LIBZ
)
368 # testipp (dependency on static CUPS library is intentional)
371 testipp
: testipp.o libcups.a
373 $(CC
) $(LDFLAGS
) -o
$@ testipp.o libcups.a \
374 $(SSLLIBS
) $(COMMONLIBS
) $(LIBZ
)
378 # testi18n (dependency on static CUPS library is intentional)
381 testi18n
: testi18n.o libcups.a
383 $(CC
) $(LDFLAGS
) -o
$@ testi18n.o libcups.a \
384 $(SSLLIBS
) $(COMMONLIBS
) $(LIBZ
)
388 # testlang (dependency on static CUPS library is intentional)
391 testlang
: testlang.o libcups.a
393 $(CC
) $(LDFLAGS
) -o
$@ testlang.o libcups.a \
394 $(SSLLIBS
) $(COMMONLIBS
) $(LIBZ
)
398 # testppd (dependency on static CUPS library is intentional)
401 testppd
: testppd.o libcups.a
403 $(CC
) $(LDFLAGS
) -o
$@ testppd.o libcups.a \
404 $(SSLLIBS
) $(COMMONLIBS
) $(LIBZ
)
408 # Automatic API help files...
412 echo Generating CUPS API help files...
413 mxmldoc
--section
"Programming" --title
"Array API" \
414 --intro api-array.shtml \
415 array.h array.c
>..
/doc
/help
/api-array.html
416 mxmldoc
--section
"Programming" --title
"CUPS API" \
417 --intro api-cups.shtml \
418 cups.h dest.c getputfile.c language.c \
419 options.c tempfile.c usersys.c \
420 util.c
>..
/doc
/help
/api-cups.html
421 mxmldoc
--section
"Programming" --title
"File and Directory APIs" \
422 --intro api-filedir.shtml \
423 file.h file.c
dir.h
dir.c
>..
/doc
/help
/api-filedir.html
424 mxmldoc
--section
"Programming" --title
"PPD API" \
425 --intro api-ppd.shtml \
426 ppd.h attr.c emit.c mark.c page.c \
427 ppd.c
>..
/doc
/help
/api-ppd.html
428 mxmldoc
--section
"Programming" --title
"HTTP and IPP APIs" \
429 --intro api-httpipp.shtml \
430 http.h ipp.h auth.c encode.c http.c http-addr.c \
431 http-support.c ipp.c ipp-support.c md5passwd.c \
432 request.c
>..
/doc
/help
/api-httpipp.html
433 mxmldoc
--section
"Programming" --title
"Filter and Backend APIs" \
434 --intro api-filter.shtml \
435 backchannel.c
>..
/doc
/help
/api-filter.html
446 # End of "$Id: Makefile 5303 2006-03-18 01:05:59Z mike $".