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