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