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