]> git.ipfire.org Git - thirdparty/cups.git/blame - cups/Makefile
Merge CUPS 1.4svn-r7319.
[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 \
96 i18n.h \
97 ipp.h \
98 language.h \
ef416fc2 99 ppd.h \
ac884b6a 100 raster.h \
f7deaa1a 101 sidechannel.h \
91c84a35 102 snmp.h \
a41f09e2
MS
103 transcode.h \
104 versioning.h
ef416fc2 105
106
107#
108# Targets in this directory...
109#
110
111TARGETS = \
112 $(LIBCUPS) \
e1d6a774 113 $(LIB32CUPS) \
114 $(LIB64CUPS) \
ef416fc2 115 libcups.a \
757d2cad 116 testadmin \
ef416fc2 117 testarray \
09a101d6 118 testcups \
ef416fc2 119 testfile \
120 testhttp \
121 testi18n \
122 testipp \
fa73b229 123 testlang \
91c84a35
MS
124 testppd \
125 testsnmp
ef416fc2 126
127
128#
129# Make all targets...
130#
131
132all: $(TARGETS)
133
134
135#
136# Remove object and target files...
137#
138
139clean:
e1d6a774 140 $(RM) $(OBJS) $(TARGETS)
f301802f 141 $(RM) libcups.so libcups.sl libcups.dylib
ed486911 142 $(RM) -r 32bit 64bit
ef416fc2 143
144
145#
146# Update dependencies (without system header dependencies...)
147#
148
149depend:
e1d6a774 150 touch Dependencies.tmp
151 makedepend -Y -I.. -fDependencies.tmp $(OBJS:.o=.c) >/dev/null 2>&1
152 $(RM) Dependencies
153 cp Dependencies.tmp Dependencies
91c84a35
MS
154 sed -E -e '1,$$s/^([^.]+)\.o:/\1\.32.o: \1\.c /' Dependencies.tmp >>Dependencies
155 sed -E -e '1,$$s/^([^.]+)\.o:/\1\.64.o: \1\.c /' Dependencies.tmp >>Dependencies
e1d6a774 156 $(RM) Dependencies.tmp
ef416fc2 157
158
159#
160# Install object and target files...
161#
162
e1d6a774 163install: all installhdrs $(INSTALLSTATIC) $(INSTALL32) $(INSTALL64)
bd7854cb 164 $(INSTALL_DIR) -m 755 $(LIBDIR)
ef416fc2 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`; \
169 fi
170 if test $(LIBCUPS) = "libcups.2.dylib"; then \
171 $(STRIP) -x $(LIBDIR)/$(LIBCUPS); \
172 $(RM) $(LIBDIR)/libcups.dylib; \
173 $(LN) $(LIBCUPS) $(LIBDIR)/libcups.dylib; \
174 fi
09a101d6 175 if test "x$(SYMROOT)" != "x"; then \
176 $(INSTALL_DIR) $(SYMROOT); \
177 for file in $(TARGETS); do \
178 cp $$file $(SYMROOT); \
179 done \
180 fi
923edb68 181
182installstatic:
183 $(INSTALL_DIR) -m 755 $(LIBDIR)
d6ae789d 184 $(INSTALL_LIB) libcups.a $(LIBDIR)
185 $(RANLIB) $(LIBDIR)/libcups.a
ef416fc2 186
187installhdrs:
bd7854cb 188 $(INSTALL_DIR) -m 755 $(INCLUDEDIR)/cups
ef416fc2 189 for file in $(HEADERS); do \
190 $(INSTALL_DATA) $$file $(INCLUDEDIR)/cups; \
191 done
192
e1d6a774 193install32bit:
194 $(INSTALL_DIR) -m 755 $(LIB32DIR)
f301802f 195 $(INSTALL_LIB) 32bit/libcups.so.2 $(LIB32DIR)/libcups.so.2
ed486911 196 $(LN) libcups.so.2 $(LIB32DIR)/libcups.so
e1d6a774 197
198install64bit:
199 $(INSTALL_DIR) -m 755 $(LIB64DIR)
f301802f 200 $(INSTALL_LIB) 64bit/libcups.so.2 $(LIB64DIR)/libcups.so.2
ed486911 201 $(LN) libcups.so.2 $(LIB64DIR)/libcups.so
e1d6a774 202
ef416fc2 203
757d2cad 204#
205# Uninstall object and target files...
206#
207
e1d6a774 208uninstall: $(UNINSTALL32) $(UNINSTALL64)
757d2cad 209 $(RM) $(LIBDIR)/libcups.2.dylib
210 $(RM) $(LIBDIR)/libcups.a
211 $(RM) $(LIBDIR)/libcups.dylib
212 $(RM) $(LIBDIR)/libcups_s.a
213 $(RM) $(LIBDIR)/libcups.sl
214 $(RM) $(LIBDIR)/libcups.sl.2
215 $(RM) $(LIBDIR)/libcups.so
216 $(RM) $(LIBDIR)/libcups.so.2
217 -$(RMDIR) $(LIBDIR)
218 for file in $(HEADERS); do \
219 $(RM) $(INCLUDEDIR)/cups/$$file; \
220 done
221 -$(RMDIR) $(INCLUDEDIR)/cups
222
e1d6a774 223uninstall32bit:
224 $(RM) $(LIB32DIR)/libcups.so
225 $(RM) $(LIB32DIR)/libcups.so.2
226 -$(RMDIR) $(LIB32DIR)
227
228uninstall64bit:
229 $(RM) $(LIB64DIR)/libcups.so
230 $(RM) $(LIB64DIR)/libcups.so.2
231 -$(RMDIR) $(LIB64DIR)
232
757d2cad 233
ef416fc2 234#
235# libcups.so.2, libcups.sl.2
236#
237
238libcups.so.2 libcups.sl.2: $(LIBOBJS)
239 echo Linking $@...
f7deaa1a 240 $(DSO) $(ARCHFLAGS) $(DSOFLAGS) -o $@ $(LIBOBJS) $(LIBGSSAPI) $(SSLLIBS) $(COMMONLIBS) $(LIBZ)
ef416fc2 241 $(RM) `basename $@ .2`
242 $(LN) $@ `basename $@ .2`
243
244
e1d6a774 245#
f301802f 246# 32bit/libcups.so.2
e1d6a774 247#
248
f301802f 24932bit/libcups.so.2: $(LIB32OBJS)
e1d6a774 250 echo Linking 32-bit $@...
f301802f 251 -mkdir 32bit
f7deaa1a 252 $(DSO) $(ARCH32FLAGS) $(DSO32FLAGS) -o $@ $(LIB32OBJS) $(LIBGSSAPI) $(SSLLIBS) $(COMMONLIBS) $(LIBZ)
f301802f 253 $(RM) 32bit/libcups.so
254 $(LN) libcups.so.2 32bit/libcups.so
e1d6a774 255
256
257#
f301802f 258# 64bit/libcups.so.2
e1d6a774 259#
260
f301802f 26164bit/libcups.so.2: $(LIB64OBJS)
e1d6a774 262 echo Linking 64-bit $@...
f301802f 263 -mkdir 64bit
f7deaa1a 264 $(DSO) $(ARCH64FLAGS) $(DSO64FLAGS) -o $@ $(LIB64OBJS) $(LIBGSSAPI) $(SSLLIBS) $(COMMONLIBS) $(LIBZ)
f301802f 265 $(RM) 64bit/libcups.so
266 $(LN) libcups.so.2 64bit/libcups.so
e1d6a774 267
268
ef416fc2 269#
270# libcups.2.dylib
271#
272
a4924f6c 273libcups.2.dylib: $(LIBOBJS) $(LIBCUPSORDER) libcups.exp
ef416fc2 274 echo Linking $@...
e1d6a774 275 $(DSO) $(ARCHFLAGS) $(DSOFLAGS) -o $@ \
fa73b229 276 -install_name $(libdir)/$@ \
f7deaa1a 277 -current_version 2.8.0 \
ef416fc2 278 -compatibility_version 2.0.0 \
09a101d6 279 -exported_symbols_list libcups.exp \
280 -sectorder __TEXT __text $(LIBCUPSORDER) \
f7deaa1a 281 $(LIBOBJS) $(LIBGSSAPI) $(SSLLIBS) $(COMMONLIBS) $(LIBZ)
ef416fc2 282 $(RM) libcups.dylib
283 $(LN) $@ libcups.dylib
284
285
286#
287# libcups_s.a
288#
289
a74454a7 290libcups_s.a: $(LIBOBJS) libcups_s.exp
ef416fc2 291 echo Creating $@...
f7deaa1a 292 $(DSO) $(DSOFLAGS) -Wl,-bexport:libcups_s.exp -o libcups_s.o $(LIBOBJS) $(LIBGSSAPI) $(SSLLIBS) $(COMMONLIBS) $(LIBZ) -lm
ef416fc2 293 $(RM) $@
294 $(AR) $(ARFLAGS) $@ libcups_s.o
295
296
297#
298# libcups.la
299#
300
301libcups.la: $(LIBOBJS)
302 echo Linking $@...
e1d6a774 303 $(CC) $(ARCHFLAGS) $(DSOFLAGS) -o $@ $(LIBOBJS:.o=.lo) -rpath $(LIBDIR) \
f7deaa1a 304 -version-info 2:8 $(LIBGSSAPI) $(SSLLIBS) $(COMMONLIBS) $(LIBZ)
ef416fc2 305
306
307#
308# libcups.a
309#
310
311libcups.a: $(LIBOBJS)
312 echo Archiving $@...
313 $(RM) $@
314 $(AR) $(ARFLAGS) $@ $(LIBOBJS)
315 $(RANLIB) $@
316
317
318#
319# CUPS language bindings for various scripting languages...
320#
757d2cad 321# NOTE: Not currently used or functional - see the scripting/php directory
322# for the hand-written bindings...
323#
ef416fc2 324
325phpcups.so: $(LIBCUPS) php_cups_wrap.o
326 echo Linking $@...
327 if test `uname` = Darwin; then \
328 DSOFLAGS="-bundle -flat_namespace -undefined suppress"; \
329 else \
330 DSOFLAGS="$(DSOFLAGS)"; \
331 fi; \
332 $(DSO) $$DSOFLAGS -o $@ php_cups_wrap.o $(LIBS) `php-config --ldflags --libs`
333
334php_cups_wrap.o: php_cups_wrap.c
335 echo Compiling $<...
336 $(CC) $(CFLAGS) `php-config --includes` -c $<
337php_cups_wrap.c: cups.h
338 echo Creating $< using SWIG...
339 swig -php -o $@ -module cups cups.h
340
341
757d2cad 342#
343# testadmin (dependency on static CUPS library is intentional)
344#
345
346testadmin: testadmin.o libcups.a
347 echo Linking $@...
348 $(CC) $(LDFLAGS) -o $@ testadmin.o libcups.a \
f7deaa1a 349 $(LIBGSSAPI) $(SSLLIBS) $(COMMONLIBS) $(LIBZ)
757d2cad 350
351
ef416fc2 352#
353# testarray (dependency on static CUPS library is intentional)
354#
355
356testarray: testarray.o libcups.a
357 echo Linking $@...
358 $(CC) $(LDFLAGS) -o $@ testarray.o libcups.a \
f7deaa1a 359 $(LIBGSSAPI) $(SSLLIBS) $(COMMONLIBS) $(LIBZ)
ef416fc2 360
361
09a101d6 362#
363# testcups (dependency on static CUPS library is intentional)
364#
365
366testcups: testcups.o libcups.a
367 echo Linking $@...
368 $(CC) $(LDFLAGS) -o $@ testcups.o libcups.a \
369 $(LIBGSSAPI) $(SSLLIBS) $(COMMONLIBS) $(LIBZ)
370
371
ef416fc2 372#
373# testfile (dependency on static CUPS library is intentional)
374#
375
376testfile: testfile.o libcups.a
377 echo Linking $@...
378 $(CC) $(LDFLAGS) -o $@ testfile.o libcups.a \
f7deaa1a 379 $(LIBGSSAPI) $(SSLLIBS) $(COMMONLIBS) $(LIBZ)
ef416fc2 380
381
382#
383# testhttp (dependency on static CUPS library is intentional)
384#
385
386testhttp: testhttp.o libcups.a
387 echo Linking $@...
388 $(CC) $(LDFLAGS) -o $@ testhttp.o libcups.a \
f7deaa1a 389 $(LIBGSSAPI) $(SSLLIBS) $(COMMONLIBS) $(LIBZ)
ef416fc2 390
391
392#
393# testipp (dependency on static CUPS library is intentional)
394#
395
396testipp: testipp.o libcups.a
397 echo Linking $@...
398 $(CC) $(LDFLAGS) -o $@ testipp.o libcups.a \
f7deaa1a 399 $(LIBGSSAPI) $(SSLLIBS) $(COMMONLIBS) $(LIBZ)
ef416fc2 400
401
402#
403# testi18n (dependency on static CUPS library is intentional)
404#
405
406testi18n: testi18n.o libcups.a
407 echo Linking $@...
408 $(CC) $(LDFLAGS) -o $@ testi18n.o libcups.a \
f7deaa1a 409 $(LIBGSSAPI) $(SSLLIBS) $(COMMONLIBS) $(LIBZ)
ef416fc2 410
411
412#
413# testlang (dependency on static CUPS library is intentional)
414#
415
416testlang: testlang.o libcups.a
417 echo Linking $@...
418 $(CC) $(LDFLAGS) -o $@ testlang.o libcups.a \
f7deaa1a 419 $(LIBGSSAPI) $(SSLLIBS) $(COMMONLIBS) $(LIBZ)
ef416fc2 420
421
fa73b229 422#
423# testppd (dependency on static CUPS library is intentional)
424#
425
426testppd: testppd.o libcups.a
427 echo Linking $@...
428 $(CC) $(LDFLAGS) -o $@ testppd.o libcups.a \
f7deaa1a 429 $(LIBGSSAPI) $(SSLLIBS) $(COMMONLIBS) $(LIBZ)
fa73b229 430
431
91c84a35
MS
432#
433# testsnmp (dependency on static CUPS library is intentional)
434#
435
436testsnmp: testsnmp.o libcups.a
437 echo Linking $@...
438 $(CC) $(LDFLAGS) -o $@ testsnmp.o libcups.a \
439 $(LIBGSSAPI) $(SSLLIBS) $(COMMONLIBS) $(LIBZ)
440
441
ef416fc2 442#
443# Automatic API help files...
444#
445
446apihelp:
447 echo Generating CUPS API help files...
5a738aea
MS
448 mxmldoc --section "Programming" \
449 --title "Introduction to CUPS Programming" \
450 --css ../doc/cups-printable.css \
451 --header api-overview.header --intro api-overview.shtml \
452 >../doc/help/api-overview.html
ef416fc2 453 mxmldoc --section "Programming" --title "Array API" \
5a738aea
MS
454 --css ../doc/cups-printable.css \
455 --header api-array.header --intro api-array.shtml \
ef416fc2 456 array.h array.c >../doc/help/api-array.html
457 mxmldoc --section "Programming" --title "CUPS API" \
5a738aea
MS
458 --css ../doc/cups-printable.css \
459 --header api-cups.header --intro api-cups.shtml \
f7deaa1a 460 cups.h dest.c getputfile.c language.c notify.c \
ef416fc2 461 options.c tempfile.c usersys.c \
462 util.c >../doc/help/api-cups.html
463 mxmldoc --section "Programming" --title "File and Directory APIs" \
5a738aea
MS
464 --css ../doc/cups-printable.css \
465 --header api-filedir.header --intro api-filedir.shtml \
ef416fc2 466 file.h file.c dir.h dir.c >../doc/help/api-filedir.html
467 mxmldoc --section "Programming" --title "PPD API" \
5a738aea
MS
468 --css ../doc/cups-printable.css \
469 --header api-ppd.header --intro api-ppd.shtml \
89d46774 470 ppd.h attr.c custom.c emit.c localize.c mark.c page.c \
ef416fc2 471 ppd.c >../doc/help/api-ppd.html
472 mxmldoc --section "Programming" --title "HTTP and IPP APIs" \
5a738aea
MS
473 --css ../doc/cups-printable.css \
474 --header api-httpipp.header --intro api-httpipp.shtml \
ecdc0628 475 http.h ipp.h auth.c encode.c http.c http-addr.c \
476 http-support.c ipp.c ipp-support.c md5passwd.c \
477 request.c >../doc/help/api-httpipp.html
5a738aea
MS
478 mxmldoc --section "Programming" \
479 --title "Filter and Backend Programming" \
480 --css ../doc/cups-printable.css \
481 --header api-filter.header --intro api-filter.shtml \
ac884b6a
MS
482 backchannel.c backend.h backend.c sidechannel.c sidechannel.h \
483 snmp.c snmp.h >../doc/help/api-filter.html
5a738aea
MS
484
485framedhelp:
486 echo Generating CUPS API help files...
487 mxmldoc --framed api-overview \
488 --section "Programming" \
489 --title "Introduction to CUPS Programming" \
490 --css ../doc/cups-printable.css \
491 --header api-overview.header --intro api-overview.shtml
492 mxmldoc --framed api-array \
493 --section "Programming" --title "Array API" \
494 --css ../doc/cups-printable.css \
495 --header api-array.header --intro api-array.shtml \
496 array.h array.c
497 mxmldoc --framed api-cups \
498 --section "Programming" --title "CUPS API" \
499 --css ../doc/cups-printable.css \
500 --header api-cups.header --intro api-cups.shtml \
501 cups.h dest.c getputfile.c language.c notify.c \
502 options.c tempfile.c usersys.c \
ac884b6a 503 util.c
5a738aea
MS
504 mxmldoc --framed api-filedir \
505 --section "Programming" --title "File and Directory APIs" \
506 --css ../doc/cups-printable.css \
507 --header api-filedir.header --intro api-filedir.shtml \
ac884b6a 508 file.h file.c dir.h dir.c
5a738aea
MS
509 mxmldoc --framed api-ppd \
510 --section "Programming" --title "PPD API" \
511 --css ../doc/cups-printable.css \
512 --header api-ppd.header --intro api-ppd.shtml \
513 ppd.h attr.c custom.c emit.c localize.c mark.c page.c \
ac884b6a 514 ppd.c
5a738aea
MS
515 mxmldoc --framed api-httpipp \
516 --section "Programming" --title "HTTP and IPP APIs" \
517 --css ../doc/cups-printable.css \
518 --header api-httpipp.header --intro api-httpipp.shtml \
519 http.h ipp.h auth.c encode.c http.c http-addr.c \
520 http-support.c ipp.c ipp-support.c md5passwd.c \
ac884b6a 521 request.c
5a738aea
MS
522 mxmldoc --framed api-filter \
523 --section "Programming" \
524 --title "Filter and Backend Programming" \
525 --css ../doc/cups-printable.css \
526 --header api-filter.header --intro api-filter.shtml \
ac884b6a
MS
527 backchannel.c backend.h backend.c sidechannel.c sidechannel.h \
528 snmp.c snmp.h
ef416fc2 529
530
531#
532# Dependencies...
533#
534
535include Dependencies
536
537
538#
bc44d920 539# End of "$Id: Makefile 6649 2007-07-11 21:46:42Z mike $".
ef416fc2 540#