]> git.ipfire.org Git - thirdparty/cups.git/blame - cups/Makefile
Import CUPS 1.4svn-r7356.
[thirdparty/cups.git] / cups / Makefile
CommitLineData
ef416fc2 1#
bc44d920 2# "$Id: Makefile 6649 2007-07-11 21:46:42Z mike $"
ef416fc2 3#
4# API library Makefile for the Common UNIX Printing System (CUPS).
5#
91c84a35 6# Copyright 2007-2008 by Apple Inc.
ef416fc2 7# Copyright 1997-2006 by Easy Software Products, all rights reserved.
8#
9# These coded instructions, statements, and computer programs are the
bc44d920 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/".
ef416fc2 14#
15# This file is subject to the Apple OS-Developed Software exception.
16#
17
18include ../Makedefs
19
20#
21# Object files...
22#
23
24LIBOBJS = \
757d2cad 25 adminutil.o \
ef416fc2 26 array.o \
27 attr.o \
28 auth.o \
29 backchannel.o \
a4d04587 30 backend.o \
fa73b229 31 custom.o \
ef416fc2 32 dest.o \
33 dir.o \
34 emit.o \
35 encode.o \
36 file.o \
89d46774 37 getifaddrs.o \
ef416fc2 38 getputfile.o \
39 globals.o \
40 http.o \
41 http-addr.o \
42 http-addrlist.o \
43 http-support.o \
44 ipp.o \
45 ipp-support.o \
46 langprintf.o \
47 language.o \
fa73b229 48 localize.o \
ef416fc2 49 mark.o \
50 md5.o \
51 md5passwd.o \
fa73b229 52 notify.o \
ef416fc2 53 options.o \
54 page.o \
55 ppd.o \
ecdc0628 56 request.o \
f7deaa1a 57 sidechannel.o \
91c84a35 58 snmp.o \
ef416fc2 59 snprintf.o \
60 string.o \
61 tempfile.o \
62 transcode.o \
63 usersys.o \
64 util.o
e1d6a774 65LIB32OBJS = $(LIBOBJS:.o=.32.o)
66LIB64OBJS = $(LIBOBJS:.o=.64.o)
ef416fc2 67OBJS = \
68 $(LIBOBJS) \
e1d6a774 69 $(LIB32OBJS) \
70 $(LIB64OBJS) \
757d2cad 71 testadmin.o \
ef416fc2 72 testarray.o \
09a101d6 73 testcups.o \
ef416fc2 74 testfile.o \
75 testhttp.o \
76 testi18n.o \
77 testipp.o \
78 testlang.o \
fa73b229 79 testppd.o \
91c84a35 80 testsnmp.o \
ef416fc2 81 php_cups_wrap.o
82
83
84#
85# Header files to install...
86#
87
88HEADERS = \
757d2cad 89 adminutil.h \
ef416fc2 90 array.h \
d09495fa 91 backend.h \
ef416fc2 92 cups.h \
93 dir.h \
94 file.h \
95 http.h \
ef416fc2 96 ipp.h \
97 language.h \
ef416fc2 98 ppd.h \
ac884b6a 99 raster.h \
f7deaa1a 100 sidechannel.h \
91c84a35 101 snmp.h \
a41f09e2
MS
102 transcode.h \
103 versioning.h
ef416fc2 104
105
106#
107# Targets in this directory...
108#
109
110TARGETS = \
111 $(LIBCUPS) \
e1d6a774 112 $(LIB32CUPS) \
113 $(LIB64CUPS) \
ef416fc2 114 libcups.a \
757d2cad 115 testadmin \
ef416fc2 116 testarray \
09a101d6 117 testcups \
ef416fc2 118 testfile \
119 testhttp \
120 testi18n \
121 testipp \
fa73b229 122 testlang \
91c84a35
MS
123 testppd \
124 testsnmp
ef416fc2 125
126
127#
128# Make all targets...
129#
130
131all: $(TARGETS)
132
133
134#
135# Remove object and target files...
136#
137
138clean:
e1d6a774 139 $(RM) $(OBJS) $(TARGETS)
f301802f 140 $(RM) libcups.so libcups.sl libcups.dylib
ed486911 141 $(RM) -r 32bit 64bit
ef416fc2 142
143
144#
145# Update dependencies (without system header dependencies...)
146#
147
148depend:
e1d6a774 149 touch Dependencies.tmp
150 makedepend -Y -I.. -fDependencies.tmp $(OBJS:.o=.c) >/dev/null 2>&1
151 $(RM) Dependencies
152 cp Dependencies.tmp Dependencies
91c84a35
MS
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
e1d6a774 155 $(RM) Dependencies.tmp
ef416fc2 156
157
158#
159# Install object and target files...
160#
161
e1d6a774 162install: all installhdrs $(INSTALLSTATIC) $(INSTALL32) $(INSTALL64)
bd7854cb 163 $(INSTALL_DIR) -m 755 $(LIBDIR)
ef416fc2 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`; \
168 fi
169 if test $(LIBCUPS) = "libcups.2.dylib"; then \
170 $(STRIP) -x $(LIBDIR)/$(LIBCUPS); \
171 $(RM) $(LIBDIR)/libcups.dylib; \
172 $(LN) $(LIBCUPS) $(LIBDIR)/libcups.dylib; \
173 fi
09a101d6 174 if test "x$(SYMROOT)" != "x"; then \
175 $(INSTALL_DIR) $(SYMROOT); \
176 for file in $(TARGETS); do \
177 cp $$file $(SYMROOT); \
178 done \
179 fi
923edb68 180
181installstatic:
182 $(INSTALL_DIR) -m 755 $(LIBDIR)
d6ae789d 183 $(INSTALL_LIB) libcups.a $(LIBDIR)
184 $(RANLIB) $(LIBDIR)/libcups.a
ef416fc2 185
186installhdrs:
bd7854cb 187 $(INSTALL_DIR) -m 755 $(INCLUDEDIR)/cups
ef416fc2 188 for file in $(HEADERS); do \
189 $(INSTALL_DATA) $$file $(INCLUDEDIR)/cups; \
190 done
191
e1d6a774 192install32bit:
193 $(INSTALL_DIR) -m 755 $(LIB32DIR)
f301802f 194 $(INSTALL_LIB) 32bit/libcups.so.2 $(LIB32DIR)/libcups.so.2
ed486911 195 $(LN) libcups.so.2 $(LIB32DIR)/libcups.so
e1d6a774 196
197install64bit:
198 $(INSTALL_DIR) -m 755 $(LIB64DIR)
f301802f 199 $(INSTALL_LIB) 64bit/libcups.so.2 $(LIB64DIR)/libcups.so.2
ed486911 200 $(LN) libcups.so.2 $(LIB64DIR)/libcups.so
e1d6a774 201
ef416fc2 202
757d2cad 203#
204# Uninstall object and target files...
205#
206
e1d6a774 207uninstall: $(UNINSTALL32) $(UNINSTALL64)
757d2cad 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
216 -$(RMDIR) $(LIBDIR)
217 for file in $(HEADERS); do \
218 $(RM) $(INCLUDEDIR)/cups/$$file; \
219 done
220 -$(RMDIR) $(INCLUDEDIR)/cups
221
e1d6a774 222uninstall32bit:
223 $(RM) $(LIB32DIR)/libcups.so
224 $(RM) $(LIB32DIR)/libcups.so.2
225 -$(RMDIR) $(LIB32DIR)
226
227uninstall64bit:
228 $(RM) $(LIB64DIR)/libcups.so
229 $(RM) $(LIB64DIR)/libcups.so.2
230 -$(RMDIR) $(LIB64DIR)
231
757d2cad 232
ef416fc2 233#
234# libcups.so.2, libcups.sl.2
235#
236
237libcups.so.2 libcups.sl.2: $(LIBOBJS)
238 echo Linking $@...
f7deaa1a 239 $(DSO) $(ARCHFLAGS) $(DSOFLAGS) -o $@ $(LIBOBJS) $(LIBGSSAPI) $(SSLLIBS) $(COMMONLIBS) $(LIBZ)
ef416fc2 240 $(RM) `basename $@ .2`
241 $(LN) $@ `basename $@ .2`
242
243
e1d6a774 244#
f301802f 245# 32bit/libcups.so.2
e1d6a774 246#
247
f301802f 24832bit/libcups.so.2: $(LIB32OBJS)
e1d6a774 249 echo Linking 32-bit $@...
f301802f 250 -mkdir 32bit
f7deaa1a 251 $(DSO) $(ARCH32FLAGS) $(DSO32FLAGS) -o $@ $(LIB32OBJS) $(LIBGSSAPI) $(SSLLIBS) $(COMMONLIBS) $(LIBZ)
f301802f 252 $(RM) 32bit/libcups.so
253 $(LN) libcups.so.2 32bit/libcups.so
e1d6a774 254
255
256#
f301802f 257# 64bit/libcups.so.2
e1d6a774 258#
259
f301802f 26064bit/libcups.so.2: $(LIB64OBJS)
e1d6a774 261 echo Linking 64-bit $@...
f301802f 262 -mkdir 64bit
f7deaa1a 263 $(DSO) $(ARCH64FLAGS) $(DSO64FLAGS) -o $@ $(LIB64OBJS) $(LIBGSSAPI) $(SSLLIBS) $(COMMONLIBS) $(LIBZ)
f301802f 264 $(RM) 64bit/libcups.so
265 $(LN) libcups.so.2 64bit/libcups.so
e1d6a774 266
267
ef416fc2 268#
269# libcups.2.dylib
270#
271
a4924f6c 272libcups.2.dylib: $(LIBOBJS) $(LIBCUPSORDER) libcups.exp
ef416fc2 273 echo Linking $@...
e1d6a774 274 $(DSO) $(ARCHFLAGS) $(DSOFLAGS) -o $@ \
fa73b229 275 -install_name $(libdir)/$@ \
f7deaa1a 276 -current_version 2.8.0 \
ef416fc2 277 -compatibility_version 2.0.0 \
09a101d6 278 -exported_symbols_list libcups.exp \
279 -sectorder __TEXT __text $(LIBCUPSORDER) \
f7deaa1a 280 $(LIBOBJS) $(LIBGSSAPI) $(SSLLIBS) $(COMMONLIBS) $(LIBZ)
ef416fc2 281 $(RM) libcups.dylib
282 $(LN) $@ libcups.dylib
283
284
285#
286# libcups_s.a
287#
288
a74454a7 289libcups_s.a: $(LIBOBJS) libcups_s.exp
ef416fc2 290 echo Creating $@...
f7deaa1a 291 $(DSO) $(DSOFLAGS) -Wl,-bexport:libcups_s.exp -o libcups_s.o $(LIBOBJS) $(LIBGSSAPI) $(SSLLIBS) $(COMMONLIBS) $(LIBZ) -lm
ef416fc2 292 $(RM) $@
293 $(AR) $(ARFLAGS) $@ libcups_s.o
294
295
296#
297# libcups.la
298#
299
300libcups.la: $(LIBOBJS)
301 echo Linking $@...
e1d6a774 302 $(CC) $(ARCHFLAGS) $(DSOFLAGS) -o $@ $(LIBOBJS:.o=.lo) -rpath $(LIBDIR) \
f7deaa1a 303 -version-info 2:8 $(LIBGSSAPI) $(SSLLIBS) $(COMMONLIBS) $(LIBZ)
ef416fc2 304
305
306#
307# libcups.a
308#
309
310libcups.a: $(LIBOBJS)
311 echo Archiving $@...
312 $(RM) $@
313 $(AR) $(ARFLAGS) $@ $(LIBOBJS)
314 $(RANLIB) $@
315
316
317#
318# CUPS language bindings for various scripting languages...
319#
757d2cad 320# NOTE: Not currently used or functional - see the scripting/php directory
321# for the hand-written bindings...
322#
ef416fc2 323
324phpcups.so: $(LIBCUPS) php_cups_wrap.o
325 echo Linking $@...
326 if test `uname` = Darwin; then \
327 DSOFLAGS="-bundle -flat_namespace -undefined suppress"; \
328 else \
329 DSOFLAGS="$(DSOFLAGS)"; \
330 fi; \
331 $(DSO) $$DSOFLAGS -o $@ php_cups_wrap.o $(LIBS) `php-config --ldflags --libs`
332
333php_cups_wrap.o: php_cups_wrap.c
334 echo Compiling $<...
335 $(CC) $(CFLAGS) `php-config --includes` -c $<
336php_cups_wrap.c: cups.h
337 echo Creating $< using SWIG...
338 swig -php -o $@ -module cups cups.h
339
340
757d2cad 341#
342# testadmin (dependency on static CUPS library is intentional)
343#
344
345testadmin: testadmin.o libcups.a
346 echo Linking $@...
347 $(CC) $(LDFLAGS) -o $@ testadmin.o libcups.a \
f7deaa1a 348 $(LIBGSSAPI) $(SSLLIBS) $(COMMONLIBS) $(LIBZ)
757d2cad 349
350
ef416fc2 351#
352# testarray (dependency on static CUPS library is intentional)
353#
354
355testarray: testarray.o libcups.a
356 echo Linking $@...
357 $(CC) $(LDFLAGS) -o $@ testarray.o libcups.a \
f7deaa1a 358 $(LIBGSSAPI) $(SSLLIBS) $(COMMONLIBS) $(LIBZ)
ef416fc2 359
360
09a101d6 361#
362# testcups (dependency on static CUPS library is intentional)
363#
364
365testcups: testcups.o libcups.a
366 echo Linking $@...
367 $(CC) $(LDFLAGS) -o $@ testcups.o libcups.a \
368 $(LIBGSSAPI) $(SSLLIBS) $(COMMONLIBS) $(LIBZ)
369
370
ef416fc2 371#
372# testfile (dependency on static CUPS library is intentional)
373#
374
375testfile: testfile.o libcups.a
376 echo Linking $@...
377 $(CC) $(LDFLAGS) -o $@ testfile.o libcups.a \
f7deaa1a 378 $(LIBGSSAPI) $(SSLLIBS) $(COMMONLIBS) $(LIBZ)
ef416fc2 379
380
381#
382# testhttp (dependency on static CUPS library is intentional)
383#
384
385testhttp: testhttp.o libcups.a
386 echo Linking $@...
387 $(CC) $(LDFLAGS) -o $@ testhttp.o libcups.a \
f7deaa1a 388 $(LIBGSSAPI) $(SSLLIBS) $(COMMONLIBS) $(LIBZ)
ef416fc2 389
390
391#
392# testipp (dependency on static CUPS library is intentional)
393#
394
395testipp: testipp.o libcups.a
396 echo Linking $@...
397 $(CC) $(LDFLAGS) -o $@ testipp.o libcups.a \
f7deaa1a 398 $(LIBGSSAPI) $(SSLLIBS) $(COMMONLIBS) $(LIBZ)
ef416fc2 399
400
401#
402# testi18n (dependency on static CUPS library is intentional)
403#
404
405testi18n: testi18n.o libcups.a
406 echo Linking $@...
407 $(CC) $(LDFLAGS) -o $@ testi18n.o libcups.a \
f7deaa1a 408 $(LIBGSSAPI) $(SSLLIBS) $(COMMONLIBS) $(LIBZ)
ef416fc2 409
410
411#
412# testlang (dependency on static CUPS library is intentional)
413#
414
415testlang: testlang.o libcups.a
416 echo Linking $@...
417 $(CC) $(LDFLAGS) -o $@ testlang.o libcups.a \
f7deaa1a 418 $(LIBGSSAPI) $(SSLLIBS) $(COMMONLIBS) $(LIBZ)
ef416fc2 419
420
fa73b229 421#
422# testppd (dependency on static CUPS library is intentional)
423#
424
425testppd: testppd.o libcups.a
426 echo Linking $@...
427 $(CC) $(LDFLAGS) -o $@ testppd.o libcups.a \
f7deaa1a 428 $(LIBGSSAPI) $(SSLLIBS) $(COMMONLIBS) $(LIBZ)
fa73b229 429
430
91c84a35
MS
431#
432# testsnmp (dependency on static CUPS library is intentional)
433#
434
435testsnmp: testsnmp.o libcups.a
436 echo Linking $@...
437 $(CC) $(LDFLAGS) -o $@ testsnmp.o libcups.a \
438 $(LIBGSSAPI) $(SSLLIBS) $(COMMONLIBS) $(LIBZ)
439
440
ef416fc2 441#
442# Automatic API help files...
443#
444
445apihelp:
446 echo Generating CUPS API help files...
5a738aea
MS
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
ef416fc2 452 mxmldoc --section "Programming" --title "Array API" \
5a738aea
MS
453 --css ../doc/cups-printable.css \
454 --header api-array.header --intro api-array.shtml \
ef416fc2 455 array.h array.c >../doc/help/api-array.html
456 mxmldoc --section "Programming" --title "CUPS API" \
5a738aea
MS
457 --css ../doc/cups-printable.css \
458 --header api-cups.header --intro api-cups.shtml \
f7deaa1a 459 cups.h dest.c getputfile.c language.c notify.c \
ef416fc2 460 options.c tempfile.c usersys.c \
461 util.c >../doc/help/api-cups.html
462 mxmldoc --section "Programming" --title "File and Directory APIs" \
5a738aea
MS
463 --css ../doc/cups-printable.css \
464 --header api-filedir.header --intro api-filedir.shtml \
ef416fc2 465 file.h file.c dir.h dir.c >../doc/help/api-filedir.html
466 mxmldoc --section "Programming" --title "PPD API" \
5a738aea
MS
467 --css ../doc/cups-printable.css \
468 --header api-ppd.header --intro api-ppd.shtml \
89d46774 469 ppd.h attr.c custom.c emit.c localize.c mark.c page.c \
ef416fc2 470 ppd.c >../doc/help/api-ppd.html
471 mxmldoc --section "Programming" --title "HTTP and IPP APIs" \
5a738aea
MS
472 --css ../doc/cups-printable.css \
473 --header api-httpipp.header --intro api-httpipp.shtml \
ecdc0628 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
5a738aea
MS
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 \
ac884b6a
MS
481 backchannel.c backend.h backend.c sidechannel.c sidechannel.h \
482 snmp.c snmp.h >../doc/help/api-filter.html
5a738aea
MS
483
484framedhelp:
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 \
495 array.h array.c
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 \
ac884b6a 502 util.c
5a738aea
MS
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 \
ac884b6a 507 file.h file.c dir.h dir.c
5a738aea
MS
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 \
ac884b6a 513 ppd.c
5a738aea
MS
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 \
ac884b6a 520 request.c
5a738aea
MS
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 \
ac884b6a
MS
526 backchannel.c backend.h backend.c sidechannel.c sidechannel.h \
527 snmp.c snmp.h
ef416fc2 528
529
530#
531# Dependencies...
532#
533
534include Dependencies
535
536
537#
bc44d920 538# End of "$Id: Makefile 6649 2007-07-11 21:46:42Z mike $".
ef416fc2 539#