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