]> git.ipfire.org Git - thirdparty/cups.git/blob - cups/Makefile
Load cups into easysw/current.
[thirdparty/cups.git] / cups / Makefile
1 #
2 # "$Id: Makefile 5801 2006-08-03 02:20:57Z mike $"
3 #
4 # API library Makefile for the Common UNIX Printing System (CUPS).
5 #
6 # Copyright 1997-2006 by Easy Software Products, all rights reserved.
7 #
8 # These coded instructions, statements, and computer programs are the
9 # property of Easy Software Products and are protected by Federal
10 # copyright law. Distribution and use rights are outlined in the file
11 # "LICENSE.txt" which should have been included with this file. If this
12 # file is missing or damaged please contact Easy Software Products
13 # at:
14 #
15 # Attn: CUPS Licensing Information
16 # Easy Software Products
17 # 44141 Airport View Drive, Suite 204
18 # Hollywood, Maryland 20636 USA
19 #
20 # Voice: (301) 373-9600
21 # EMail: cups-info@cups.org
22 # WWW: http://www.cups.org
23 #
24 # This file is subject to the Apple OS-Developed Software exception.
25 #
26
27 include ../Makedefs
28
29 #
30 # Object files...
31 #
32
33 LIBOBJS = \
34 adminutil.o \
35 array.o \
36 attr.o \
37 auth.o \
38 backchannel.o \
39 backend.o \
40 custom.o \
41 dest.o \
42 dir.o \
43 emit.o \
44 encode.o \
45 file.o \
46 getifaddrs.o \
47 getputfile.o \
48 globals.o \
49 http.o \
50 http-addr.o \
51 http-addrlist.o \
52 http-support.o \
53 ipp.o \
54 ipp-support.o \
55 langprintf.o \
56 language.o \
57 localize.o \
58 mark.o \
59 md5.o \
60 md5passwd.o \
61 notify.o \
62 options.o \
63 page.o \
64 ppd.o \
65 request.o \
66 snprintf.o \
67 string.o \
68 tempfile.o \
69 transcode.o \
70 usersys.o \
71 util.o
72 LIB32OBJS = $(LIBOBJS:.o=.32.o)
73 LIB64OBJS = $(LIBOBJS:.o=.64.o)
74 OBJS = \
75 $(LIBOBJS) \
76 $(LIB32OBJS) \
77 $(LIB64OBJS) \
78 testadmin.o \
79 testarray.o \
80 testfile.o \
81 testhttp.o \
82 testi18n.o \
83 testipp.o \
84 testlang.o \
85 testppd.o \
86 php_cups_wrap.o
87
88
89 #
90 # Header files to install...
91 #
92
93 HEADERS = \
94 adminutil.h \
95 array.h \
96 backend.h \
97 cups.h \
98 dir.h \
99 file.h \
100 http.h \
101 i18n.h \
102 ipp.h \
103 language.h \
104 md5.h \
105 ppd.h \
106 transcode.h
107
108
109 #
110 # Targets in this directory...
111 #
112
113 TARGETS = \
114 $(LIBCUPS) \
115 $(LIB32CUPS) \
116 $(LIB64CUPS) \
117 libcups.a \
118 testadmin \
119 testarray \
120 testfile \
121 testhttp \
122 testi18n \
123 testipp \
124 testlang \
125 testppd
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 -r -e '1,$$s/^([^.]+)\.o:/\1\.32.o: \1\.c /' Dependencies.tmp >>Dependencies
155 sed -r -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
176 installstatic:
177 $(INSTALL_DIR) -m 755 $(LIBDIR)
178 $(INSTALL_LIB) libcups.a $(LIBDIR)
179 $(RANLIB) $(LIBDIR)/libcups.a
180
181 installhdrs:
182 $(INSTALL_DIR) -m 755 $(INCLUDEDIR)/cups
183 for file in $(HEADERS); do \
184 $(INSTALL_DATA) $$file $(INCLUDEDIR)/cups; \
185 done
186
187 install32bit:
188 $(INSTALL_DIR) -m 755 $(LIB32DIR)
189 $(INSTALL_LIB) 32bit/libcups.so.2 $(LIB32DIR)/libcups.so.2
190 $(LN) libcups.so.2 $(LIB32DIR)/libcups.so
191
192 install64bit:
193 $(INSTALL_DIR) -m 755 $(LIB64DIR)
194 $(INSTALL_LIB) 64bit/libcups.so.2 $(LIB64DIR)/libcups.so.2
195 $(LN) libcups.so.2 $(LIB64DIR)/libcups.so
196
197
198 #
199 # Uninstall object and target files...
200 #
201
202 uninstall: $(UNINSTALL32) $(UNINSTALL64)
203 $(RM) $(LIBDIR)/libcups.2.dylib
204 $(RM) $(LIBDIR)/libcups.a
205 $(RM) $(LIBDIR)/libcups.dylib
206 $(RM) $(LIBDIR)/libcups_s.a
207 $(RM) $(LIBDIR)/libcups.sl
208 $(RM) $(LIBDIR)/libcups.sl.2
209 $(RM) $(LIBDIR)/libcups.so
210 $(RM) $(LIBDIR)/libcups.so.2
211 -$(RMDIR) $(LIBDIR)
212 for file in $(HEADERS); do \
213 $(RM) $(INCLUDEDIR)/cups/$$file; \
214 done
215 -$(RMDIR) $(INCLUDEDIR)/cups
216
217 uninstall32bit:
218 $(RM) $(LIB32DIR)/libcups.so
219 $(RM) $(LIB32DIR)/libcups.so.2
220 -$(RMDIR) $(LIB32DIR)
221
222 uninstall64bit:
223 $(RM) $(LIB64DIR)/libcups.so
224 $(RM) $(LIB64DIR)/libcups.so.2
225 -$(RMDIR) $(LIB64DIR)
226
227
228 #
229 # libcups.so.2, libcups.sl.2
230 #
231
232 libcups.so.2 libcups.sl.2: $(LIBOBJS)
233 echo Linking $@...
234 $(DSO) $(ARCHFLAGS) $(DSOFLAGS) -o $@ $(LIBOBJS) $(SSLLIBS) $(COMMONLIBS) $(LIBZ)
235 $(RM) `basename $@ .2`
236 $(LN) $@ `basename $@ .2`
237
238
239 #
240 # 32bit/libcups.so.2
241 #
242
243 32bit/libcups.so.2: $(LIB32OBJS)
244 echo Linking 32-bit $@...
245 -mkdir 32bit
246 $(DSO) $(ARCH32FLAGS) $(DSO32FLAGS) -o $@ $(LIB32OBJS) $(SSLLIBS) $(COMMONLIBS) $(LIBZ)
247 $(RM) 32bit/libcups.so
248 $(LN) libcups.so.2 32bit/libcups.so
249
250
251 #
252 # 64bit/libcups.so.2
253 #
254
255 64bit/libcups.so.2: $(LIB64OBJS)
256 echo Linking 64-bit $@...
257 -mkdir 64bit
258 $(DSO) $(ARCH64FLAGS) $(DSO64FLAGS) -o $@ $(LIB64OBJS) $(SSLLIBS) $(COMMONLIBS) $(LIBZ)
259 $(RM) 64bit/libcups.so
260 $(LN) libcups.so.2 64bit/libcups.so
261
262
263 #
264 # libcups.2.dylib
265 #
266
267 libcups.2.dylib: $(LIBOBJS)
268 echo Linking $@...
269 $(DSO) $(ARCHFLAGS) $(DSOFLAGS) -o $@ \
270 -install_name $(libdir)/$@ \
271 -current_version 2.7.0 \
272 -compatibility_version 2.0.0 \
273 $(LIBOBJS) $(SSLLIBS) $(COMMONLIBS) $(LIBZ)
274 $(RM) libcups.dylib
275 $(LN) $@ libcups.dylib
276
277
278 #
279 # libcups_s.a
280 #
281
282 libcups_s.a: $(LIBOBJS) libcups_s.exp
283 echo Creating $@...
284 $(DSO) $(DSOFLAGS) -Wl,-bexport:libcups_s.exp -o libcups_s.o $(LIBOBJS) $(SSLLIBS) $(COMMONLIBS) $(LIBZ) -lm
285 $(RM) $@
286 $(AR) $(ARFLAGS) $@ libcups_s.o
287
288
289 #
290 # libcups.la
291 #
292
293 libcups.la: $(LIBOBJS)
294 echo Linking $@...
295 $(CC) $(ARCHFLAGS) $(DSOFLAGS) -o $@ $(LIBOBJS:.o=.lo) -rpath $(LIBDIR) \
296 -version-info 2:7 $(SSLLIBS) $(COMMONLIBS) $(LIBZ)
297
298
299 #
300 # libcups.a
301 #
302
303 libcups.a: $(LIBOBJS)
304 echo Archiving $@...
305 $(RM) $@
306 $(AR) $(ARFLAGS) $@ $(LIBOBJS)
307 $(RANLIB) $@
308
309
310 #
311 # CUPS language bindings for various scripting languages...
312 #
313 # NOTE: Not currently used or functional - see the scripting/php directory
314 # for the hand-written bindings...
315 #
316
317 phpcups.so: $(LIBCUPS) php_cups_wrap.o
318 echo Linking $@...
319 if test `uname` = Darwin; then \
320 DSOFLAGS="-bundle -flat_namespace -undefined suppress"; \
321 else \
322 DSOFLAGS="$(DSOFLAGS)"; \
323 fi; \
324 $(DSO) $$DSOFLAGS -o $@ php_cups_wrap.o $(LIBS) `php-config --ldflags --libs`
325
326 php_cups_wrap.o: php_cups_wrap.c
327 echo Compiling $<...
328 $(CC) $(CFLAGS) `php-config --includes` -c $<
329 php_cups_wrap.c: cups.h
330 echo Creating $< using SWIG...
331 swig -php -o $@ -module cups cups.h
332
333
334 #
335 # testadmin (dependency on static CUPS library is intentional)
336 #
337
338 testadmin: testadmin.o libcups.a
339 echo Linking $@...
340 $(CC) $(LDFLAGS) -o $@ testadmin.o libcups.a \
341 $(SSLLIBS) $(COMMONLIBS) $(LIBZ)
342
343
344 #
345 # testarray (dependency on static CUPS library is intentional)
346 #
347
348 testarray: testarray.o libcups.a
349 echo Linking $@...
350 $(CC) $(LDFLAGS) -o $@ testarray.o libcups.a \
351 $(SSLLIBS) $(COMMONLIBS) $(LIBZ)
352
353
354 #
355 # testfile (dependency on static CUPS library is intentional)
356 #
357
358 testfile: testfile.o libcups.a
359 echo Linking $@...
360 $(CC) $(LDFLAGS) -o $@ testfile.o libcups.a \
361 $(SSLLIBS) $(COMMONLIBS) $(LIBZ)
362
363
364 #
365 # testhttp (dependency on static CUPS library is intentional)
366 #
367
368 testhttp: testhttp.o libcups.a
369 echo Linking $@...
370 $(CC) $(LDFLAGS) -o $@ testhttp.o libcups.a \
371 $(SSLLIBS) $(COMMONLIBS) $(LIBZ)
372
373
374 #
375 # testipp (dependency on static CUPS library is intentional)
376 #
377
378 testipp: testipp.o libcups.a
379 echo Linking $@...
380 $(CC) $(LDFLAGS) -o $@ testipp.o libcups.a \
381 $(SSLLIBS) $(COMMONLIBS) $(LIBZ)
382
383
384 #
385 # testi18n (dependency on static CUPS library is intentional)
386 #
387
388 testi18n: testi18n.o libcups.a
389 echo Linking $@...
390 $(CC) $(LDFLAGS) -o $@ testi18n.o libcups.a \
391 $(SSLLIBS) $(COMMONLIBS) $(LIBZ)
392
393
394 #
395 # testlang (dependency on static CUPS library is intentional)
396 #
397
398 testlang: testlang.o libcups.a
399 echo Linking $@...
400 $(CC) $(LDFLAGS) -o $@ testlang.o libcups.a \
401 $(SSLLIBS) $(COMMONLIBS) $(LIBZ)
402
403
404 #
405 # testppd (dependency on static CUPS library is intentional)
406 #
407
408 testppd: testppd.o libcups.a
409 echo Linking $@...
410 $(CC) $(LDFLAGS) -o $@ testppd.o libcups.a \
411 $(SSLLIBS) $(COMMONLIBS) $(LIBZ)
412
413
414 #
415 # Automatic API help files...
416 #
417
418 apihelp:
419 echo Generating CUPS API help files...
420 mxmldoc --section "Programming" --title "Array API" \
421 --intro api-array.shtml \
422 array.h array.c >../doc/help/api-array.html
423 mxmldoc --section "Programming" --title "CUPS API" \
424 --intro api-cups.shtml \
425 cups.h dest.c getputfile.c language.c \
426 options.c tempfile.c usersys.c \
427 util.c >../doc/help/api-cups.html
428 mxmldoc --section "Programming" --title "File and Directory APIs" \
429 --intro api-filedir.shtml \
430 file.h file.c dir.h dir.c >../doc/help/api-filedir.html
431 mxmldoc --section "Programming" --title "PPD API" \
432 --intro api-ppd.shtml \
433 ppd.h attr.c custom.c emit.c localize.c mark.c page.c \
434 ppd.c >../doc/help/api-ppd.html
435 mxmldoc --section "Programming" --title "HTTP and IPP APIs" \
436 --intro api-httpipp.shtml \
437 http.h ipp.h auth.c encode.c http.c http-addr.c \
438 http-support.c ipp.c ipp-support.c md5passwd.c \
439 request.c >../doc/help/api-httpipp.html
440 mxmldoc --section "Programming" --title "Filter and Backend APIs" \
441 --intro api-filter.shtml \
442 backchannel.c >../doc/help/api-filter.html
443
444
445 #
446 # Dependencies...
447 #
448
449 include Dependencies
450
451
452 #
453 # End of "$Id: Makefile 5801 2006-08-03 02:20:57Z mike $".
454 #