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