]> git.ipfire.org Git - thirdparty/cups.git/blob - cups/Makefile
Load cups into easysw/current.
[thirdparty/cups.git] / cups / Makefile
1 #
2 # "$Id: Makefile 6304 2007-02-22 22:06:23Z 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 sidechannel.o \
67 snprintf.o \
68 string.o \
69 tempfile.o \
70 transcode.o \
71 usersys.o \
72 util.o
73 LIB32OBJS = $(LIBOBJS:.o=.32.o)
74 LIB64OBJS = $(LIBOBJS:.o=.64.o)
75 OBJS = \
76 $(LIBOBJS) \
77 $(LIB32OBJS) \
78 $(LIB64OBJS) \
79 testadmin.o \
80 testarray.o \
81 testfile.o \
82 testhttp.o \
83 testi18n.o \
84 testipp.o \
85 testlang.o \
86 testppd.o \
87 php_cups_wrap.o
88
89
90 #
91 # Header files to install...
92 #
93
94 HEADERS = \
95 adminutil.h \
96 array.h \
97 backend.h \
98 cups.h \
99 dir.h \
100 file.h \
101 http.h \
102 i18n.h \
103 ipp.h \
104 language.h \
105 ppd.h \
106 sidechannel.h \
107 transcode.h
108
109
110 #
111 # Targets in this directory...
112 #
113
114 TARGETS = \
115 $(LIBCUPS) \
116 $(LIB32CUPS) \
117 $(LIB64CUPS) \
118 libcups.a \
119 testadmin \
120 testarray \
121 testfile \
122 testhttp \
123 testi18n \
124 testipp \
125 testlang \
126 testppd
127
128
129 #
130 # Make all targets...
131 #
132
133 all: $(TARGETS)
134
135
136 #
137 # Remove object and target files...
138 #
139
140 clean:
141 $(RM) $(OBJS) $(TARGETS)
142 $(RM) libcups.so libcups.sl libcups.dylib
143 $(RM) -r 32bit 64bit
144
145
146 #
147 # Update dependencies (without system header dependencies...)
148 #
149
150 depend:
151 touch Dependencies.tmp
152 makedepend -Y -I.. -fDependencies.tmp $(OBJS:.o=.c) >/dev/null 2>&1
153 $(RM) Dependencies
154 cp Dependencies.tmp Dependencies
155 sed -r -e '1,$$s/^([^.]+)\.o:/\1\.32.o: \1\.c /' Dependencies.tmp >>Dependencies
156 sed -r -e '1,$$s/^([^.]+)\.o:/\1\.64.o: \1\.c /' Dependencies.tmp >>Dependencies
157 $(RM) Dependencies.tmp
158
159
160 #
161 # Install object and target files...
162 #
163
164 install: all installhdrs $(INSTALLSTATIC) $(INSTALL32) $(INSTALL64)
165 $(INSTALL_DIR) -m 755 $(LIBDIR)
166 $(INSTALL_LIB) $(LIBCUPS) $(LIBDIR)
167 if test $(LIBCUPS) = "libcups.so.2" -o $(LIBCUPS) = "libcups.sl.2"; then \
168 $(RM) $(LIBDIR)/`basename $(LIBCUPS) .2`; \
169 $(LN) $(LIBCUPS) $(LIBDIR)/`basename $(LIBCUPS) .2`; \
170 fi
171 if test $(LIBCUPS) = "libcups.2.dylib"; then \
172 $(STRIP) -x $(LIBDIR)/$(LIBCUPS); \
173 $(RM) $(LIBDIR)/libcups.dylib; \
174 $(LN) $(LIBCUPS) $(LIBDIR)/libcups.dylib; \
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)
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 $(LIBOBJS) $(LIBGSSAPI) $(SSLLIBS) $(COMMONLIBS) $(LIBZ)
275 $(RM) libcups.dylib
276 $(LN) $@ libcups.dylib
277
278
279 #
280 # libcups_s.a
281 #
282
283 libcups_s.a: $(LIBOBJS) libcups_s.exp
284 echo Creating $@...
285 $(DSO) $(DSOFLAGS) -Wl,-bexport:libcups_s.exp -o libcups_s.o $(LIBOBJS) $(LIBGSSAPI) $(SSLLIBS) $(COMMONLIBS) $(LIBZ) -lm
286 $(RM) $@
287 $(AR) $(ARFLAGS) $@ libcups_s.o
288
289
290 #
291 # libcups.la
292 #
293
294 libcups.la: $(LIBOBJS)
295 echo Linking $@...
296 $(CC) $(ARCHFLAGS) $(DSOFLAGS) -o $@ $(LIBOBJS:.o=.lo) -rpath $(LIBDIR) \
297 -version-info 2:8 $(LIBGSSAPI) $(SSLLIBS) $(COMMONLIBS) $(LIBZ)
298
299
300 #
301 # libcups.a
302 #
303
304 libcups.a: $(LIBOBJS)
305 echo Archiving $@...
306 $(RM) $@
307 $(AR) $(ARFLAGS) $@ $(LIBOBJS)
308 $(RANLIB) $@
309
310
311 #
312 # CUPS language bindings for various scripting languages...
313 #
314 # NOTE: Not currently used or functional - see the scripting/php directory
315 # for the hand-written bindings...
316 #
317
318 phpcups.so: $(LIBCUPS) php_cups_wrap.o
319 echo Linking $@...
320 if test `uname` = Darwin; then \
321 DSOFLAGS="-bundle -flat_namespace -undefined suppress"; \
322 else \
323 DSOFLAGS="$(DSOFLAGS)"; \
324 fi; \
325 $(DSO) $$DSOFLAGS -o $@ php_cups_wrap.o $(LIBS) `php-config --ldflags --libs`
326
327 php_cups_wrap.o: php_cups_wrap.c
328 echo Compiling $<...
329 $(CC) $(CFLAGS) `php-config --includes` -c $<
330 php_cups_wrap.c: cups.h
331 echo Creating $< using SWIG...
332 swig -php -o $@ -module cups cups.h
333
334
335 #
336 # testadmin (dependency on static CUPS library is intentional)
337 #
338
339 testadmin: testadmin.o libcups.a
340 echo Linking $@...
341 $(CC) $(LDFLAGS) -o $@ testadmin.o libcups.a \
342 $(LIBGSSAPI) $(SSLLIBS) $(COMMONLIBS) $(LIBZ)
343
344
345 #
346 # testarray (dependency on static CUPS library is intentional)
347 #
348
349 testarray: testarray.o libcups.a
350 echo Linking $@...
351 $(CC) $(LDFLAGS) -o $@ testarray.o libcups.a \
352 $(LIBGSSAPI) $(SSLLIBS) $(COMMONLIBS) $(LIBZ)
353
354
355 #
356 # testfile (dependency on static CUPS library is intentional)
357 #
358
359 testfile: testfile.o libcups.a
360 echo Linking $@...
361 $(CC) $(LDFLAGS) -o $@ testfile.o libcups.a \
362 $(LIBGSSAPI) $(SSLLIBS) $(COMMONLIBS) $(LIBZ)
363
364
365 #
366 # testhttp (dependency on static CUPS library is intentional)
367 #
368
369 testhttp: testhttp.o libcups.a
370 echo Linking $@...
371 $(CC) $(LDFLAGS) -o $@ testhttp.o libcups.a \
372 $(LIBGSSAPI) $(SSLLIBS) $(COMMONLIBS) $(LIBZ)
373
374
375 #
376 # testipp (dependency on static CUPS library is intentional)
377 #
378
379 testipp: testipp.o libcups.a
380 echo Linking $@...
381 $(CC) $(LDFLAGS) -o $@ testipp.o libcups.a \
382 $(LIBGSSAPI) $(SSLLIBS) $(COMMONLIBS) $(LIBZ)
383
384
385 #
386 # testi18n (dependency on static CUPS library is intentional)
387 #
388
389 testi18n: testi18n.o libcups.a
390 echo Linking $@...
391 $(CC) $(LDFLAGS) -o $@ testi18n.o libcups.a \
392 $(LIBGSSAPI) $(SSLLIBS) $(COMMONLIBS) $(LIBZ)
393
394
395 #
396 # testlang (dependency on static CUPS library is intentional)
397 #
398
399 testlang: testlang.o libcups.a
400 echo Linking $@...
401 $(CC) $(LDFLAGS) -o $@ testlang.o libcups.a \
402 $(LIBGSSAPI) $(SSLLIBS) $(COMMONLIBS) $(LIBZ)
403
404
405 #
406 # testppd (dependency on static CUPS library is intentional)
407 #
408
409 testppd: testppd.o libcups.a
410 echo Linking $@...
411 $(CC) $(LDFLAGS) -o $@ testppd.o libcups.a \
412 $(LIBGSSAPI) $(SSLLIBS) $(COMMONLIBS) $(LIBZ)
413
414
415 #
416 # Automatic API help files...
417 #
418
419 apihelp:
420 echo Generating CUPS API help files...
421 mxmldoc --section "Programming" --title "Array API" \
422 --intro api-array.shtml \
423 array.h array.c >../doc/help/api-array.html
424 mxmldoc --section "Programming" --title "CUPS API" \
425 --intro api-cups.shtml \
426 cups.h dest.c getputfile.c language.c notify.c \
427 options.c tempfile.c usersys.c \
428 util.c >../doc/help/api-cups.html
429 mxmldoc --section "Programming" --title "File and Directory APIs" \
430 --intro api-filedir.shtml \
431 file.h file.c dir.h dir.c >../doc/help/api-filedir.html
432 mxmldoc --section "Programming" --title "PPD API" \
433 --intro api-ppd.shtml \
434 ppd.h attr.c custom.c emit.c localize.c mark.c page.c \
435 ppd.c >../doc/help/api-ppd.html
436 mxmldoc --section "Programming" --title "HTTP and IPP APIs" \
437 --intro api-httpipp.shtml \
438 http.h ipp.h auth.c encode.c http.c http-addr.c \
439 http-support.c ipp.c ipp-support.c md5passwd.c \
440 request.c >../doc/help/api-httpipp.html
441 mxmldoc --section "Programming" --title "Filter and Backend APIs" \
442 --intro api-filter.shtml \
443 backchannel.c sidechannel.c sidechannel.h >../doc/help/api-filter.html
444
445
446 #
447 # Dependencies...
448 #
449
450 include Dependencies
451
452
453 #
454 # End of "$Id: Makefile 6304 2007-02-22 22:06:23Z mike $".
455 #