2 # "$Id: Makefile 5801 2006-08-03 02:20:57Z 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.
72 LIB32OBJS
= $(LIBOBJS
:.o
=.32.o
)
73 LIB64OBJS
= $(LIBOBJS
:.o
=.64.o
)
90 # Header files to install...
110 # 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
-r
-e
'1,$$s/^([^.]+)\.o:/\1\.32.o: \1\.c /' Dependencies.tmp
>>Dependencies
155 sed
-r
-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
; \
177 $(INSTALL_DIR
) -m
755 $(LIBDIR
)
178 $(INSTALL_LIB
) libcups.a
$(LIBDIR
)
179 $(RANLIB
) $(LIBDIR
)/libcups.a
182 $(INSTALL_DIR
) -m
755 $(INCLUDEDIR
)/cups
183 for file in
$(HEADERS
); do \
184 $(INSTALL_DATA
) $$file $(INCLUDEDIR
)/cups
; \
188 $(INSTALL_DIR
) -m
755 $(LIB32DIR
)
189 $(INSTALL_LIB
) 32bit
/libcups.so
.2 $(LIB32DIR
)/libcups.so
.2
190 $(LN
) libcups.so
.2 $(LIB32DIR
)/libcups.so
193 $(INSTALL_DIR
) -m
755 $(LIB64DIR
)
194 $(INSTALL_LIB
) 64bit
/libcups.so
.2 $(LIB64DIR
)/libcups.so
.2
195 $(LN
) libcups.so
.2 $(LIB64DIR
)/libcups.so
199 # Uninstall object and target files...
202 uninstall: $(UNINSTALL32
) $(UNINSTALL64
)
203 $(RM
) $(LIBDIR
)/libcups
.2.dylib
204 $(RM
) $(LIBDIR
)/libcups.a
205 $(RM
) $(LIBDIR
)/libcups.dylib
206 $(RM
) $(LIBDIR
)/libcups_s.a
207 $(RM
) $(LIBDIR
)/libcups.sl
208 $(RM
) $(LIBDIR
)/libcups.sl
.2
209 $(RM
) $(LIBDIR
)/libcups.so
210 $(RM
) $(LIBDIR
)/libcups.so
.2
212 for file in
$(HEADERS
); do \
213 $(RM
) $(INCLUDEDIR
)/cups
/$$file; \
215 -$(RMDIR
) $(INCLUDEDIR
)/cups
218 $(RM
) $(LIB32DIR
)/libcups.so
219 $(RM
) $(LIB32DIR
)/libcups.so
.2
220 -$(RMDIR
) $(LIB32DIR
)
223 $(RM
) $(LIB64DIR
)/libcups.so
224 $(RM
) $(LIB64DIR
)/libcups.so
.2
225 -$(RMDIR
) $(LIB64DIR
)
229 # libcups.so.2, libcups.sl.2
232 libcups.so
.2 libcups.sl
.2: $(LIBOBJS
)
234 $(DSO
) $(ARCHFLAGS
) $(DSOFLAGS
) -o
$@
$(LIBOBJS
) $(SSLLIBS
) $(COMMONLIBS
) $(LIBZ
)
235 $(RM
) `basename $@ .2`
236 $(LN
) $@
`basename $@ .2`
243 32bit
/libcups.so
.2: $(LIB32OBJS
)
244 echo Linking
32-bit
$@...
246 $(DSO
) $(ARCH32FLAGS
) $(DSO32FLAGS
) -o
$@
$(LIB32OBJS
) $(SSLLIBS
) $(COMMONLIBS
) $(LIBZ
)
247 $(RM
) 32bit
/libcups.so
248 $(LN
) libcups.so
.2 32bit
/libcups.so
255 64bit
/libcups.so
.2: $(LIB64OBJS
)
256 echo Linking
64-bit
$@...
258 $(DSO
) $(ARCH64FLAGS
) $(DSO64FLAGS
) -o
$@
$(LIB64OBJS
) $(SSLLIBS
) $(COMMONLIBS
) $(LIBZ
)
259 $(RM
) 64bit
/libcups.so
260 $(LN
) libcups.so
.2 64bit
/libcups.so
267 libcups
.2.dylib
: $(LIBOBJS
)
269 $(DSO
) $(ARCHFLAGS
) $(DSOFLAGS
) -o
$@ \
270 -install_name
$(libdir)/$@ \
271 -current_version
2.7.0 \
272 -compatibility_version
2.0.0 \
273 $(LIBOBJS
) $(SSLLIBS
) $(COMMONLIBS
) $(LIBZ
)
275 $(LN
) $@ libcups.dylib
282 libcups_s.a
: $(LIBOBJS
) libcups_s.exp
284 $(DSO
) $(DSOFLAGS
) -Wl
,-bexport
:libcups_s.exp
-o libcups_s.o
$(LIBOBJS
) $(SSLLIBS
) $(COMMONLIBS
) $(LIBZ
) -lm
286 $(AR
) $(ARFLAGS
) $@ libcups_s.o
293 libcups.la
: $(LIBOBJS
)
295 $(CC
) $(ARCHFLAGS
) $(DSOFLAGS
) -o
$@
$(LIBOBJS
:.o
=.lo
) -rpath
$(LIBDIR
) \
296 -version-info
2:7 $(SSLLIBS
) $(COMMONLIBS
) $(LIBZ
)
303 libcups.a
: $(LIBOBJS
)
306 $(AR
) $(ARFLAGS
) $@
$(LIBOBJS
)
311 # CUPS language bindings for various scripting languages...
313 # NOTE: Not currently used or functional - see the scripting/php directory
314 # for the hand-written bindings...
317 phpcups.so
: $(LIBCUPS
) php_cups_wrap.o
319 if
test `uname` = Darwin
; then \
320 DSOFLAGS
="-bundle -flat_namespace -undefined suppress"; \
322 DSOFLAGS
="$(DSOFLAGS)"; \
324 $(DSO
) $$DSOFLAGS -o
$@ php_cups_wrap.o
$(LIBS
) `php-config --ldflags --libs`
326 php_cups_wrap.o
: php_cups_wrap.c
328 $(CC
) $(CFLAGS
) `php-config --includes` -c
$<
329 php_cups_wrap.c
: cups.h
330 echo Creating
$< using SWIG...
331 swig
-php
-o
$@
-module cups cups.h
335 # testadmin (dependency on static CUPS library is intentional)
338 testadmin
: testadmin.o libcups.a
340 $(CC
) $(LDFLAGS
) -o
$@ testadmin.o libcups.a \
341 $(SSLLIBS
) $(COMMONLIBS
) $(LIBZ
)
345 # testarray (dependency on static CUPS library is intentional)
348 testarray
: testarray.o libcups.a
350 $(CC
) $(LDFLAGS
) -o
$@ testarray.o libcups.a \
351 $(SSLLIBS
) $(COMMONLIBS
) $(LIBZ
)
355 # testfile (dependency on static CUPS library is intentional)
358 testfile
: testfile.o libcups.a
360 $(CC
) $(LDFLAGS
) -o
$@ testfile.o libcups.a \
361 $(SSLLIBS
) $(COMMONLIBS
) $(LIBZ
)
365 # testhttp (dependency on static CUPS library is intentional)
368 testhttp
: testhttp.o libcups.a
370 $(CC
) $(LDFLAGS
) -o
$@ testhttp.o libcups.a \
371 $(SSLLIBS
) $(COMMONLIBS
) $(LIBZ
)
375 # testipp (dependency on static CUPS library is intentional)
378 testipp
: testipp.o libcups.a
380 $(CC
) $(LDFLAGS
) -o
$@ testipp.o libcups.a \
381 $(SSLLIBS
) $(COMMONLIBS
) $(LIBZ
)
385 # testi18n (dependency on static CUPS library is intentional)
388 testi18n
: testi18n.o libcups.a
390 $(CC
) $(LDFLAGS
) -o
$@ testi18n.o libcups.a \
391 $(SSLLIBS
) $(COMMONLIBS
) $(LIBZ
)
395 # testlang (dependency on static CUPS library is intentional)
398 testlang
: testlang.o libcups.a
400 $(CC
) $(LDFLAGS
) -o
$@ testlang.o libcups.a \
401 $(SSLLIBS
) $(COMMONLIBS
) $(LIBZ
)
405 # testppd (dependency on static CUPS library is intentional)
408 testppd
: testppd.o libcups.a
410 $(CC
) $(LDFLAGS
) -o
$@ testppd.o libcups.a \
411 $(SSLLIBS
) $(COMMONLIBS
) $(LIBZ
)
415 # Automatic API help files...
419 echo Generating CUPS API help files...
420 mxmldoc
--section
"Programming" --title
"Array API" \
421 --intro api-array.shtml \
422 array.h array.c
>..
/doc
/help
/api-array.html
423 mxmldoc
--section
"Programming" --title
"CUPS API" \
424 --intro api-cups.shtml \
425 cups.h dest.c getputfile.c language.c \
426 options.c tempfile.c usersys.c \
427 util.c
>..
/doc
/help
/api-cups.html
428 mxmldoc
--section
"Programming" --title
"File and Directory APIs" \
429 --intro api-filedir.shtml \
430 file.h file.c
dir.h
dir.c
>..
/doc
/help
/api-filedir.html
431 mxmldoc
--section
"Programming" --title
"PPD API" \
432 --intro api-ppd.shtml \
433 ppd.h attr.c custom.c emit.c localize.c mark.c page.c \
434 ppd.c
>..
/doc
/help
/api-ppd.html
435 mxmldoc
--section
"Programming" --title
"HTTP and IPP APIs" \
436 --intro api-httpipp.shtml \
437 http.h ipp.h auth.c encode.c http.c http-addr.c \
438 http-support.c ipp.c ipp-support.c md5passwd.c \
439 request.c
>..
/doc
/help
/api-httpipp.html
440 mxmldoc
--section
"Programming" --title
"Filter and Backend APIs" \
441 --intro api-filter.shtml \
442 backchannel.c
>..
/doc
/help
/api-filter.html
453 # End of "$Id: Makefile 5801 2006-08-03 02:20:57Z mike $".