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