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