]> git.ipfire.org Git - thirdparty/cups.git/blob - cups/Makefile
Import CUPS 1.4svn-r7226.
[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 sidechannel.h \
101 snmp.h \
102 transcode.h \
103 versioning.h
104
105
106 #
107 # Targets in this directory...
108 #
109
110 TARGETS = \
111 $(LIBCUPS) \
112 $(LIB32CUPS) \
113 $(LIB64CUPS) \
114 libcups.a \
115 testadmin \
116 testarray \
117 testcups \
118 testfile \
119 testhttp \
120 testi18n \
121 testipp \
122 testlang \
123 testppd \
124 testsnmp
125
126
127 #
128 # Make all targets...
129 #
130
131 all: $(TARGETS)
132
133
134 #
135 # Remove object and target files...
136 #
137
138 clean:
139 $(RM) $(OBJS) $(TARGETS)
140 $(RM) libcups.so libcups.sl libcups.dylib
141 $(RM) -r 32bit 64bit
142
143
144 #
145 # Update dependencies (without system header dependencies...)
146 #
147
148 depend:
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
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
155 $(RM) Dependencies.tmp
156
157
158 #
159 # Install object and target files...
160 #
161
162 install: all installhdrs $(INSTALLSTATIC) $(INSTALL32) $(INSTALL64)
163 $(INSTALL_DIR) -m 755 $(LIBDIR)
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
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
180
181 installstatic:
182 $(INSTALL_DIR) -m 755 $(LIBDIR)
183 $(INSTALL_LIB) libcups.a $(LIBDIR)
184 $(RANLIB) $(LIBDIR)/libcups.a
185
186 installhdrs:
187 $(INSTALL_DIR) -m 755 $(INCLUDEDIR)/cups
188 for file in $(HEADERS); do \
189 $(INSTALL_DATA) $$file $(INCLUDEDIR)/cups; \
190 done
191
192 install32bit:
193 $(INSTALL_DIR) -m 755 $(LIB32DIR)
194 $(INSTALL_LIB) 32bit/libcups.so.2 $(LIB32DIR)/libcups.so.2
195 $(LN) libcups.so.2 $(LIB32DIR)/libcups.so
196
197 install64bit:
198 $(INSTALL_DIR) -m 755 $(LIB64DIR)
199 $(INSTALL_LIB) 64bit/libcups.so.2 $(LIB64DIR)/libcups.so.2
200 $(LN) libcups.so.2 $(LIB64DIR)/libcups.so
201
202
203 #
204 # Uninstall object and target files...
205 #
206
207 uninstall: $(UNINSTALL32) $(UNINSTALL64)
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
222 uninstall32bit:
223 $(RM) $(LIB32DIR)/libcups.so
224 $(RM) $(LIB32DIR)/libcups.so.2
225 -$(RMDIR) $(LIB32DIR)
226
227 uninstall64bit:
228 $(RM) $(LIB64DIR)/libcups.so
229 $(RM) $(LIB64DIR)/libcups.so.2
230 -$(RMDIR) $(LIB64DIR)
231
232
233 #
234 # libcups.so.2, libcups.sl.2
235 #
236
237 libcups.so.2 libcups.sl.2: $(LIBOBJS)
238 echo Linking $@...
239 $(DSO) $(ARCHFLAGS) $(DSOFLAGS) -o $@ $(LIBOBJS) $(LIBGSSAPI) $(SSLLIBS) $(COMMONLIBS) $(LIBZ)
240 $(RM) `basename $@ .2`
241 $(LN) $@ `basename $@ .2`
242
243
244 #
245 # 32bit/libcups.so.2
246 #
247
248 32bit/libcups.so.2: $(LIB32OBJS)
249 echo Linking 32-bit $@...
250 -mkdir 32bit
251 $(DSO) $(ARCH32FLAGS) $(DSO32FLAGS) -o $@ $(LIB32OBJS) $(LIBGSSAPI) $(SSLLIBS) $(COMMONLIBS) $(LIBZ)
252 $(RM) 32bit/libcups.so
253 $(LN) libcups.so.2 32bit/libcups.so
254
255
256 #
257 # 64bit/libcups.so.2
258 #
259
260 64bit/libcups.so.2: $(LIB64OBJS)
261 echo Linking 64-bit $@...
262 -mkdir 64bit
263 $(DSO) $(ARCH64FLAGS) $(DSO64FLAGS) -o $@ $(LIB64OBJS) $(LIBGSSAPI) $(SSLLIBS) $(COMMONLIBS) $(LIBZ)
264 $(RM) 64bit/libcups.so
265 $(LN) libcups.so.2 64bit/libcups.so
266
267
268 #
269 # libcups.2.dylib
270 #
271
272 libcups.2.dylib: $(LIBOBJS) $(LIBCUPSORDER) libcups.exp
273 echo Linking $@...
274 $(DSO) $(ARCHFLAGS) $(DSOFLAGS) -o $@ \
275 -install_name $(libdir)/$@ \
276 -current_version 2.8.0 \
277 -compatibility_version 2.0.0 \
278 -exported_symbols_list libcups.exp \
279 -sectorder __TEXT __text $(LIBCUPSORDER) \
280 $(LIBOBJS) $(LIBGSSAPI) $(SSLLIBS) $(COMMONLIBS) $(LIBZ)
281 $(RM) libcups.dylib
282 $(LN) $@ libcups.dylib
283
284
285 #
286 # libcups_s.a
287 #
288
289 libcups_s.a: $(LIBOBJS) libcups_s.exp
290 echo Creating $@...
291 $(DSO) $(DSOFLAGS) -Wl,-bexport:libcups_s.exp -o libcups_s.o $(LIBOBJS) $(LIBGSSAPI) $(SSLLIBS) $(COMMONLIBS) $(LIBZ) -lm
292 $(RM) $@
293 $(AR) $(ARFLAGS) $@ libcups_s.o
294
295
296 #
297 # libcups.la
298 #
299
300 libcups.la: $(LIBOBJS)
301 echo Linking $@...
302 $(CC) $(ARCHFLAGS) $(DSOFLAGS) -o $@ $(LIBOBJS:.o=.lo) -rpath $(LIBDIR) \
303 -version-info 2:8 $(LIBGSSAPI) $(SSLLIBS) $(COMMONLIBS) $(LIBZ)
304
305
306 #
307 # libcups.a
308 #
309
310 libcups.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 #
320 # NOTE: Not currently used or functional - see the scripting/php directory
321 # for the hand-written bindings...
322 #
323
324 phpcups.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
333 php_cups_wrap.o: php_cups_wrap.c
334 echo Compiling $<...
335 $(CC) $(CFLAGS) `php-config --includes` -c $<
336 php_cups_wrap.c: cups.h
337 echo Creating $< using SWIG...
338 swig -php -o $@ -module cups cups.h
339
340
341 #
342 # testadmin (dependency on static CUPS library is intentional)
343 #
344
345 testadmin: testadmin.o libcups.a
346 echo Linking $@...
347 $(CC) $(LDFLAGS) -o $@ testadmin.o libcups.a \
348 $(LIBGSSAPI) $(SSLLIBS) $(COMMONLIBS) $(LIBZ)
349
350
351 #
352 # testarray (dependency on static CUPS library is intentional)
353 #
354
355 testarray: testarray.o libcups.a
356 echo Linking $@...
357 $(CC) $(LDFLAGS) -o $@ testarray.o libcups.a \
358 $(LIBGSSAPI) $(SSLLIBS) $(COMMONLIBS) $(LIBZ)
359
360
361 #
362 # testcups (dependency on static CUPS library is intentional)
363 #
364
365 testcups: testcups.o libcups.a
366 echo Linking $@...
367 $(CC) $(LDFLAGS) -o $@ testcups.o libcups.a \
368 $(LIBGSSAPI) $(SSLLIBS) $(COMMONLIBS) $(LIBZ)
369
370
371 #
372 # testfile (dependency on static CUPS library is intentional)
373 #
374
375 testfile: testfile.o libcups.a
376 echo Linking $@...
377 $(CC) $(LDFLAGS) -o $@ testfile.o libcups.a \
378 $(LIBGSSAPI) $(SSLLIBS) $(COMMONLIBS) $(LIBZ)
379
380
381 #
382 # testhttp (dependency on static CUPS library is intentional)
383 #
384
385 testhttp: testhttp.o libcups.a
386 echo Linking $@...
387 $(CC) $(LDFLAGS) -o $@ testhttp.o libcups.a \
388 $(LIBGSSAPI) $(SSLLIBS) $(COMMONLIBS) $(LIBZ)
389
390
391 #
392 # testipp (dependency on static CUPS library is intentional)
393 #
394
395 testipp: testipp.o libcups.a
396 echo Linking $@...
397 $(CC) $(LDFLAGS) -o $@ testipp.o libcups.a \
398 $(LIBGSSAPI) $(SSLLIBS) $(COMMONLIBS) $(LIBZ)
399
400
401 #
402 # testi18n (dependency on static CUPS library is intentional)
403 #
404
405 testi18n: testi18n.o libcups.a
406 echo Linking $@...
407 $(CC) $(LDFLAGS) -o $@ testi18n.o libcups.a \
408 $(LIBGSSAPI) $(SSLLIBS) $(COMMONLIBS) $(LIBZ)
409
410
411 #
412 # testlang (dependency on static CUPS library is intentional)
413 #
414
415 testlang: testlang.o libcups.a
416 echo Linking $@...
417 $(CC) $(LDFLAGS) -o $@ testlang.o libcups.a \
418 $(LIBGSSAPI) $(SSLLIBS) $(COMMONLIBS) $(LIBZ)
419
420
421 #
422 # testppd (dependency on static CUPS library is intentional)
423 #
424
425 testppd: testppd.o libcups.a
426 echo Linking $@...
427 $(CC) $(LDFLAGS) -o $@ testppd.o libcups.a \
428 $(LIBGSSAPI) $(SSLLIBS) $(COMMONLIBS) $(LIBZ)
429
430
431 #
432 # testsnmp (dependency on static CUPS library is intentional)
433 #
434
435 testsnmp: testsnmp.o libcups.a
436 echo Linking $@...
437 $(CC) $(LDFLAGS) -o $@ testsnmp.o libcups.a \
438 $(LIBGSSAPI) $(SSLLIBS) $(COMMONLIBS) $(LIBZ)
439
440
441 #
442 # Automatic API help files...
443 #
444
445 apihelp:
446 echo Generating CUPS API help files...
447 mxmldoc --section "Programming" --title "Array API" \
448 --intro api-array.shtml \
449 array.h array.c >../doc/help/api-array.html
450 mxmldoc --section "Programming" --title "CUPS API" \
451 --intro api-cups.shtml \
452 cups.h dest.c getputfile.c language.c notify.c \
453 options.c tempfile.c usersys.c \
454 util.c >../doc/help/api-cups.html
455 mxmldoc --section "Programming" --title "File and Directory APIs" \
456 --intro api-filedir.shtml \
457 file.h file.c dir.h dir.c >../doc/help/api-filedir.html
458 mxmldoc --section "Programming" --title "PPD API" \
459 --intro api-ppd.shtml \
460 ppd.h attr.c custom.c emit.c localize.c mark.c page.c \
461 ppd.c >../doc/help/api-ppd.html
462 mxmldoc --section "Programming" --title "HTTP and IPP APIs" \
463 --intro api-httpipp.shtml \
464 http.h ipp.h auth.c encode.c http.c http-addr.c \
465 http-support.c ipp.c ipp-support.c md5passwd.c \
466 request.c >../doc/help/api-httpipp.html
467 mxmldoc --section "Programming" --title "Filter and Backend APIs" \
468 --intro api-filter.shtml \
469 backchannel.c sidechannel.c sidechannel.h >../doc/help/api-filter.html
470
471
472 #
473 # Dependencies...
474 #
475
476 include Dependencies
477
478
479 #
480 # End of "$Id: Makefile 6649 2007-07-11 21:46:42Z mike $".
481 #