2 # "$Id: Makefile 5354 2006-03-29 20:55:15Z 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 $(INSTALL_LIB
) libcups.a
$(LIBDIR
)
176 $(RANLIB
) $(LIBDIR
)/libcups.a
179 $(INSTALL_DIR
) -m
755 $(INCLUDEDIR
)/cups
180 for file in
$(HEADERS
); do \
181 $(INSTALL_DATA
) $$file $(INCLUDEDIR
)/cups
; \
185 $(INSTALL_DIR
) -m
755 $(LIB32DIR
)
186 $(INSTALL_LIB
) libcups
.32.so
.2 $(LIB32DIR
)/libcups.so
.2
187 $(LN
) libcups.so
$(LIB32DIR
)/libcups.so
.2
190 $(INSTALL_DIR
) -m
755 $(LIB64DIR
)
191 $(INSTALL_LIB
) libcups
.64.so
.2 $(LIB64DIR
)/libcups.so
.2
192 $(LN
) libcups.so
$(LIB64DIR
)/libcups.so
.2
196 # Uninstall object and target files...
199 uninstall: $(UNINSTALL32
) $(UNINSTALL64
)
200 $(RM
) $(LIBDIR
)/libcups
.2.dylib
201 $(RM
) $(LIBDIR
)/libcups.a
202 $(RM
) $(LIBDIR
)/libcups.dylib
203 $(RM
) $(LIBDIR
)/libcups_s.a
204 $(RM
) $(LIBDIR
)/libcups.sl
205 $(RM
) $(LIBDIR
)/libcups.sl
.2
206 $(RM
) $(LIBDIR
)/libcups.so
207 $(RM
) $(LIBDIR
)/libcups.so
.2
209 for file in
$(HEADERS
); do \
210 $(RM
) $(INCLUDEDIR
)/cups
/$$file; \
212 -$(RMDIR
) $(INCLUDEDIR
)/cups
215 $(RM
) $(LIB32DIR
)/libcups.so
216 $(RM
) $(LIB32DIR
)/libcups.so
.2
217 -$(RMDIR
) $(LIB32DIR
)
220 $(RM
) $(LIB64DIR
)/libcups.so
221 $(RM
) $(LIB64DIR
)/libcups.so
.2
222 -$(RMDIR
) $(LIB64DIR
)
226 # libcups.so.2, libcups.sl.2
229 libcups.so
.2 libcups.sl
.2: $(LIBOBJS
)
231 $(DSO
) $(ARCHFLAGS
) $(DSOFLAGS
) -o
$@
$(LIBOBJS
) $(SSLLIBS
) $(COMMONLIBS
) $(LIBZ
)
232 $(RM
) `basename $@ .2`
233 $(LN
) $@
`basename $@ .2`
240 libcups
.32.so
.2: $(LIB32OBJS
)
241 echo Linking
32-bit
$@...
242 $(DSO
) $(ARCH32FLAGS
) $(DSOFLAGS
) -o
$@
$(LIB32OBJS
) $(SSLLIBS
) $(COMMONLIBS
) $(LIBZ
)
249 libcups
.64.so
.2: $(LIB64OBJS
)
250 echo Linking
64-bit
$@...
251 $(DSO
) $(ARCH64FLAGS
) $(DSOFLAGS
) -o
$@
$(LIB64OBJS
) $(SSLLIBS
) $(COMMONLIBS
) $(LIBZ
)
258 libcups
.2.dylib
: $(LIBOBJS
)
260 $(DSO
) $(ARCHFLAGS
) $(DSOFLAGS
) -o
$@ \
261 -install_name
$(libdir)/$@ \
262 -current_version
2.7.0 \
263 -compatibility_version
2.0.0 \
264 $(LIBOBJS
) $(SSLLIBS
) $(COMMONLIBS
) $(LIBZ
)
266 $(LN
) $@ libcups.dylib
273 libcups_s.a
: $(LIBOBJS
)
275 $(DSO
) $(DSOFLAGS
) -Wl
,-bexport
:libcups_s.exp
-o libcups_s.o
$(LIBOBJS
) $(SSLLIBS
) $(COMMONLIBS
) $(LIBZ
) -lm
277 $(AR
) $(ARFLAGS
) $@ libcups_s.o
284 libcups.la
: $(LIBOBJS
)
286 $(CC
) $(ARCHFLAGS
) $(DSOFLAGS
) -o
$@
$(LIBOBJS
:.o
=.lo
) -rpath
$(LIBDIR
) \
287 -version-info
2:7 $(SSLLIBS
) $(COMMONLIBS
) $(LIBZ
)
294 libcups.a
: $(LIBOBJS
)
297 $(AR
) $(ARFLAGS
) $@
$(LIBOBJS
)
302 # CUPS language bindings for various scripting languages...
304 # NOTE: Not currently used or functional - see the scripting/php directory
305 # for the hand-written bindings...
308 phpcups.so
: $(LIBCUPS
) php_cups_wrap.o
310 if
test `uname` = Darwin
; then \
311 DSOFLAGS
="-bundle -flat_namespace -undefined suppress"; \
313 DSOFLAGS
="$(DSOFLAGS)"; \
315 $(DSO
) $$DSOFLAGS -o
$@ php_cups_wrap.o
$(LIBS
) `php-config --ldflags --libs`
317 php_cups_wrap.o
: php_cups_wrap.c
319 $(CC
) $(CFLAGS
) `php-config --includes` -c
$<
320 php_cups_wrap.c
: cups.h
321 echo Creating
$< using SWIG...
322 swig
-php
-o
$@
-module cups cups.h
326 # testadmin (dependency on static CUPS library is intentional)
329 testadmin
: testadmin.o libcups.a
331 $(CC
) $(LDFLAGS
) -o
$@ testadmin.o libcups.a \
332 $(SSLLIBS
) $(COMMONLIBS
) $(LIBZ
)
336 # testarray (dependency on static CUPS library is intentional)
339 testarray
: testarray.o libcups.a
341 $(CC
) $(LDFLAGS
) -o
$@ testarray.o libcups.a \
342 $(SSLLIBS
) $(COMMONLIBS
) $(LIBZ
)
346 # testfile (dependency on static CUPS library is intentional)
349 testfile
: testfile.o libcups.a
351 $(CC
) $(LDFLAGS
) -o
$@ testfile.o libcups.a \
352 $(SSLLIBS
) $(COMMONLIBS
) $(LIBZ
)
356 # testhttp (dependency on static CUPS library is intentional)
359 testhttp
: testhttp.o libcups.a
361 $(CC
) $(LDFLAGS
) -o
$@ testhttp.o libcups.a \
362 $(SSLLIBS
) $(COMMONLIBS
) $(LIBZ
)
366 # testipp (dependency on static CUPS library is intentional)
369 testipp
: testipp.o libcups.a
371 $(CC
) $(LDFLAGS
) -o
$@ testipp.o libcups.a \
372 $(SSLLIBS
) $(COMMONLIBS
) $(LIBZ
)
376 # testi18n (dependency on static CUPS library is intentional)
379 testi18n
: testi18n.o libcups.a
381 $(CC
) $(LDFLAGS
) -o
$@ testi18n.o libcups.a \
382 $(SSLLIBS
) $(COMMONLIBS
) $(LIBZ
)
386 # testlang (dependency on static CUPS library is intentional)
389 testlang
: testlang.o libcups.a
391 $(CC
) $(LDFLAGS
) -o
$@ testlang.o libcups.a \
392 $(SSLLIBS
) $(COMMONLIBS
) $(LIBZ
)
396 # testppd (dependency on static CUPS library is intentional)
399 testppd
: testppd.o libcups.a
401 $(CC
) $(LDFLAGS
) -o
$@ testppd.o libcups.a \
402 $(SSLLIBS
) $(COMMONLIBS
) $(LIBZ
)
406 # Automatic API help files...
410 echo Generating CUPS API help files...
411 mxmldoc
--section
"Programming" --title
"Array API" \
412 --intro api-array.shtml \
413 array.h array.c
>..
/doc
/help
/api-array.html
414 mxmldoc
--section
"Programming" --title
"CUPS API" \
415 --intro api-cups.shtml \
416 cups.h dest.c getputfile.c language.c \
417 options.c tempfile.c usersys.c \
418 util.c
>..
/doc
/help
/api-cups.html
419 mxmldoc
--section
"Programming" --title
"File and Directory APIs" \
420 --intro api-filedir.shtml \
421 file.h file.c
dir.h
dir.c
>..
/doc
/help
/api-filedir.html
422 mxmldoc
--section
"Programming" --title
"PPD API" \
423 --intro api-ppd.shtml \
424 ppd.h attr.c emit.c mark.c page.c \
425 ppd.c
>..
/doc
/help
/api-ppd.html
426 mxmldoc
--section
"Programming" --title
"HTTP and IPP APIs" \
427 --intro api-httpipp.shtml \
428 http.h ipp.h auth.c encode.c http.c http-addr.c \
429 http-support.c ipp.c ipp-support.c md5passwd.c \
430 request.c
>..
/doc
/help
/api-httpipp.html
431 mxmldoc
--section
"Programming" --title
"Filter and Backend APIs" \
432 --intro api-filter.shtml \
433 backchannel.c
>..
/doc
/help
/api-filter.html
444 # End of "$Id: Makefile 5354 2006-03-29 20:55:15Z mike $".