]>
Commit | Line | Data |
---|---|---|
ac884b6a MS |
1 | # |
2 | # "$Id$" | |
3 | # | |
4 | # Makefile for the CUPS PPD Compiler. | |
5 | # | |
6 | # Copyright 2007-2008 by Apple Inc. | |
7 | # Copyright 2002-2006 by Easy Software Products. | |
8 | # | |
9 | # These coded instructions, statements, and computer programs are the | |
10 | # property of Apple Inc. and are protected by Federal copyright | |
11 | # law. Distribution and use rights are outlined in the file "LICENSE.txt" | |
12 | # which should have been included with this file. If this file is | |
13 | # file is missing or damaged, see the license at "http://www.cups.org/". | |
14 | # | |
15 | ||
16 | # | |
17 | # Include standard definitions... | |
18 | # | |
19 | ||
20 | include ../Makedefs | |
21 | ||
22 | ||
23 | # | |
24 | # Object files... | |
25 | # | |
26 | ||
50fe7201 | 27 | LIBOBJS = \ |
ac884b6a MS |
28 | ppdc-array.o \ |
29 | ppdc-attr.o \ | |
30 | ppdc-catalog.o \ | |
31 | ppdc-choice.o \ | |
32 | ppdc-constraint.o \ | |
33 | ppdc-driver.o \ | |
34 | ppdc-file.o \ | |
35 | ppdc-filter.o \ | |
36 | ppdc-font.o \ | |
37 | ppdc-group.o \ | |
38 | ppdc-import.o \ | |
39 | ppdc-mediasize.o \ | |
40 | ppdc-message.o \ | |
41 | ppdc-option.o \ | |
42 | ppdc-profile.o \ | |
43 | ppdc-shared.o \ | |
44 | ppdc-source.o \ | |
45 | ppdc-string.o \ | |
46 | ppdc-variable.o | |
50fe7201 MS |
47 | LIB32OBJS = $(LIBOBJS:.o=.32.o) |
48 | LIB64OBJS = $(LIBOBJS:.o=.64.o) | |
49 | OBJS = \ | |
50 | $(LIBOBJS) \ | |
51 | $(LIB32OBJS) \ | |
52 | $(LIB64OBJS) \ | |
ac884b6a MS |
53 | drv.o \ |
54 | ppdc.o \ | |
55 | ppdhtml.o \ | |
56 | ppdi.o \ | |
57 | ppdmerge.o \ | |
50fe7201 | 58 | ppdpo.o |
c9fc04c6 | 59 | LIBTARGETS = \ |
50fe7201 MS |
60 | $(LIBCUPSPPDC) \ |
61 | $(LIB32CUPSPPDC) \ | |
62 | $(LIB64CUPSPPDC) \ | |
63 | libcupsppdc.a \ | |
c9fc04c6 MS |
64 | ppdc-static |
65 | TARGETS = \ | |
66 | $(LIBTARGETS) \ | |
ac884b6a | 67 | drv \ |
ac884b6a MS |
68 | ppdc \ |
69 | ppdhtml \ | |
70 | ppdi \ | |
71 | ppdmerge \ | |
72 | ppdpo | |
73 | ||
74 | ||
75 | # | |
76 | # Make everything... | |
77 | # | |
78 | ||
79 | all: $(TARGETS) | |
80 | ||
81 | ||
c9fc04c6 MS |
82 | # |
83 | # Make library targets... | |
84 | # | |
85 | ||
86 | libs: $(LIBTARGETS) | |
87 | ||
88 | ||
ac884b6a MS |
89 | # |
90 | # Clean everything... | |
91 | # | |
92 | ||
93 | clean: | |
94 | $(RM) $(OBJS) core | |
95 | $(RM) *.bak *.bck core.* | |
96 | $(RM) $(TARGETS) | |
97 | $(RM) -r ppd | |
98 | $(RM) test.drv | |
50fe7201 MS |
99 | $(RM) libcupsppdc.so libcupsppdc.sl libcupsppdc.dylib |
100 | $(RM) -r 32bit 64bit | |
ac884b6a MS |
101 | |
102 | ||
103 | # | |
104 | # Update dependencies... | |
105 | # | |
106 | ||
107 | depend: | |
50fe7201 MS |
108 | touch Dependencies.tmp |
109 | makedepend -Y -I.. -fDependencies.tmp $(OBJS:.o=.c) >/dev/null 2>&1 | |
110 | $(RM) Dependencies | |
111 | cp Dependencies.tmp Dependencies | |
112 | sed -E -e '1,$$s/^([^.]+)\.o:/\1\.32.o: \1\.c /' Dependencies.tmp >>Dependencies | |
113 | sed -E -e '1,$$s/^([^.]+)\.o:/\1\.64.o: \1\.c /' Dependencies.tmp >>Dependencies | |
114 | $(RM) Dependencies.tmp | |
115 | ||
116 | ||
117 | # | |
118 | # Install all targets... | |
119 | # | |
120 | ||
121 | install: all install-data install-headers install-libs install-exec | |
122 | ||
123 | ||
124 | # | |
125 | # Install data files... | |
126 | # | |
127 | ||
128 | install-data: | |
129 | $(INSTALL_DIR) $(DATADIR)/drv | |
634763e8 MS |
130 | $(INSTALL_DATA) sample.drv $(DATADIR)/drv |
131 | if test `uname` = Darwin; then \ | |
132 | $(INSTALL_DIR) /Library/Printers/PPDs.drv; \ | |
133 | fi | |
ac884b6a MS |
134 | |
135 | ||
136 | # | |
50fe7201 | 137 | # Install programs... |
ac884b6a MS |
138 | # |
139 | ||
50fe7201 | 140 | install-exec: |
ac884b6a MS |
141 | echo Installing PPD compiler programs... |
142 | $(INSTALL_DIR) $(BINDIR) | |
143 | $(INSTALL_BIN) ppdc $(BINDIR) | |
144 | $(INSTALL_BIN) ppdhtml $(BINDIR) | |
145 | $(INSTALL_BIN) ppdi $(BINDIR) | |
146 | $(INSTALL_BIN) ppdmerge $(BINDIR) | |
147 | $(INSTALL_BIN) ppdpo $(BINDIR) | |
148 | $(INSTALL_DIR) $(SERVERBIN)/driver | |
149 | $(INSTALL_BIN) drv $(SERVERBIN)/driver | |
50fe7201 MS |
150 | if test "x$(SYMROOT)" != "x"; then \ |
151 | $(INSTALL_DIR) $(SYMROOT); \ | |
152 | for file in $(TARGETS); do \ | |
153 | cp $$file $(SYMROOT); \ | |
154 | done \ | |
155 | fi | |
156 | ||
157 | ||
158 | # | |
159 | # Install headers... | |
160 | # | |
161 | ||
162 | install-headers: | |
163 | echo Installing header files in $(INCLUDEDIR)/cups... | |
164 | $(INSTALL_DIR) -m 755 $(INCLUDEDIR)/cups | |
165 | $(INSTALL_DATA) ppdc.h $(INCLUDEDIR)/cups | |
166 | ||
167 | ||
168 | # | |
169 | # Install libraries... | |
170 | # | |
171 | ||
172 | install-libs: $(INSTALLSTATIC) $(INSTALL32) $(INSTALL64) | |
173 | echo Installing libraries in $(LIBDIR)... | |
174 | $(INSTALL_DIR) -m 755 $(LIBDIR) | |
175 | $(INSTALL_LIB) $(LIBCUPSPPDC) $(LIBDIR) | |
176 | if test $(LIBCUPSPPDC) = "libcupsppdc.so.1" -o $(LIBCUPSPPDC) = "libcupsppdc.sl.1"; then \ | |
177 | $(RM) $(LIBDIR)/`basename $(LIBCUPSPPDC) .1`; \ | |
178 | $(LN) $(LIBCUPSPPDC) $(LIBDIR)/`basename $(LIBCUPSPPDC) .1`; \ | |
179 | fi | |
180 | if test $(LIBCUPSPPDC) = "libcupsppdc.1.dylib"; then \ | |
50fe7201 MS |
181 | $(RM) $(LIBDIR)/libcupsppdc.dylib; \ |
182 | $(LN) $(LIBCUPSPPDC) $(LIBDIR)/libcupsppdc.dylib; \ | |
183 | fi | |
184 | if test "x$(SYMROOT)" != "x"; then \ | |
185 | $(INSTALL_DIR) $(SYMROOT); \ | |
186 | cp $(LIBCUPSPPDC) $(SYMROOT); \ | |
187 | fi | |
188 | ||
189 | installstatic: | |
190 | $(INSTALL_DIR) -m 755 $(LIBDIR) | |
191 | $(INSTALL_LIB) libcupsppdc.a $(LIBDIR) | |
192 | $(RANLIB) $(LIBDIR)/libcupsppdc.a | |
193 | ||
194 | install32bit: | |
195 | echo Installing libraries in $(LIB32DIR)... | |
196 | $(INSTALL_DIR) -m 755 $(LIB32DIR) | |
197 | $(INSTALL_LIB) 32bit/libcupsppdc.so.1 $(LIB32DIR)/libcupsppdc.so.1 | |
198 | $(LN) libcupsppdc.so.1 $(LIB32DIR)/libcupsppdc.so | |
199 | ||
200 | install64bit: | |
201 | echo Installing libraries in $(LIB64DIR)... | |
202 | $(INSTALL_DIR) -m 755 $(LIB64DIR) | |
203 | $(INSTALL_LIB) 64bit/libcupsppdc.so.1 $(LIB64DIR)/libcupsppdc.so.1 | |
204 | $(LN) libcupsppdc.so.1 $(LIB64DIR)/libcupsppdc.so | |
ac884b6a MS |
205 | |
206 | ||
207 | # | |
208 | # Uninstall... | |
209 | # | |
210 | ||
211 | uninstall: | |
212 | $(RM) $(BINDIR)/ppdc | |
213 | $(RM) $(BINDIR)/ppdhtml | |
214 | $(RM) $(BINDIR)/ppdi | |
215 | $(RM) $(BINDIR)/ppdmerge | |
216 | $(RM) $(BINDIR)/ppdpo | |
217 | $(RM) $(SERVERBIN)/driver/drv | |
218 | $(RMDIR) $(SERVERBIN)/driver | |
634763e8 | 219 | $(RM) $(DATADIR)/drv/sample.drv |
ac884b6a | 220 | $(RMDIR) $(DATADIR)/drv |
634763e8 MS |
221 | if test `uname` = Darwin; then \ |
222 | $(RMDIR) /Library/Printers/PPDs.drv; \ | |
223 | fi | |
50fe7201 MS |
224 | $(RM) $(LIBDIR)/libcupsppdc.1.dylib |
225 | $(RM) $(LIBDIR)/libcupsppdc.a | |
226 | $(RM) $(LIBDIR)/libcupsppdc.dylib | |
227 | $(RM) $(LIBDIR)/libcupsppdc_s.a | |
228 | $(RM) $(LIBDIR)/libcupsppdc.sl | |
229 | $(RM) $(LIBDIR)/libcupsppdc.sl.1 | |
230 | $(RM) $(LIBDIR)/libcupsppdc.so | |
231 | $(RM) $(LIBDIR)/libcupsppdc.so.1 | |
232 | -$(RMDIR) $(LIBDIR) | |
233 | $(RM) $(INCLUDEDIR)/cups/ppdc.h | |
234 | -$(RMDIR) $(INCLUDEDIR)/cups | |
235 | ||
236 | uninstall32bit: | |
237 | $(RM) $(LIB32DIR)/libcupsppdc.so | |
238 | $(RM) $(LIB32DIR)/libcupsppdc.so.1 | |
239 | -$(RMDIR) $(LIB32DIR) | |
240 | ||
241 | uninstall64bit: | |
242 | $(RM) $(LIB64DIR)/libcupsppdc.so | |
243 | $(RM) $(LIB64DIR)/libcupsppdc.so.1 | |
244 | -$(RMDIR) $(LIB64DIR) | |
245 | ||
246 | ||
247 | # | |
248 | # Automatic API help files... | |
249 | # | |
250 | ||
251 | apihelp: | |
252 | mxmldoc --section "Programming" \ | |
253 | --title "PPD Compiler API" \ | |
254 | --css ../doc/cups-printable.css \ | |
255 | --header api-ppdc.header --intro api-ppdc.shtml \ | |
256 | ppdc.h $(LIBOBJS:.o=.cxx) >../doc/help/api-ppdc.html | |
257 | ||
258 | framedhelp: | |
259 | mxmldoc --framed api-ppdc \ | |
260 | --section "Programming" \ | |
261 | --title "PPD Compiler API" \ | |
262 | --css ../doc/cups-printable.css \ | |
263 | --header api-ppdc.header --intro api-ppdc.shtml \ | |
264 | ppdc.h $(LIBOBJS:.o=.cxx) | |
ac884b6a MS |
265 | |
266 | ||
267 | # | |
268 | # drv, the CUPS driver interface program to the PPD compiler. | |
269 | # | |
270 | ||
50fe7201 | 271 | drv: drv.o $(LIBCUPSPPDC) ../cups/$(LIBCUPS) |
ac884b6a | 272 | echo Linking $@... |
50fe7201 | 273 | $(CXX) $(LDFLAGS) -o $@ drv.o -L. -lcupsppdc $(LIBS) |
ac884b6a MS |
274 | |
275 | ||
276 | # | |
277 | # ppdc, the PPD compiler. | |
278 | # | |
279 | ||
50fe7201 | 280 | ppdc: ppdc.o $(LIBCUPSPPDC) ../cups/$(LIBCUPS) |
ac884b6a | 281 | echo Linking $@... |
50fe7201 | 282 | $(CXX) $(LDFLAGS) -o $@ ppdc.o -L. -lcupsppdc $(LIBS) |
ac884b6a MS |
283 | |
284 | ||
50fe7201 | 285 | ppdc-static: ppdc.o libcupsppdc.a ../cups/libcups.a foo.drv foo-fr.po |
ac884b6a | 286 | echo Linking $@... |
c9fc04c6 MS |
287 | $(CXX) $(ARCHFLAGS) $(LDFLAGS) -o ppdc-static ppdc.o libcupsppdc.a \ |
288 | ../cups/libcups.a $(LIBGSSAPI) $(SSLLIBS) $(COMMONLIBS) $(LIBZ) | |
ac884b6a MS |
289 | echo Testing PPD compiler... |
290 | ./ppdc-static -l en,fr -I ../data foo.drv | |
291 | ./ppdc-static -l en,fr -z -I ../data foo.drv | |
292 | ||
293 | ||
294 | # | |
295 | # ppdhtml, the PPD to HTML utility. | |
296 | # | |
297 | ||
50fe7201 | 298 | ppdhtml: ppdhtml.o $(LIBCUPSPPDC) ../cups/$(LIBCUPS) |
ac884b6a | 299 | echo Linking $@... |
50fe7201 | 300 | $(CXX) $(LDFLAGS) -o $@ ppdhtml.o -L. -lcupsppdc $(LIBS) |
ac884b6a MS |
301 | |
302 | ||
303 | # | |
304 | # ppdi, import PPD files. | |
305 | # | |
306 | ||
50fe7201 | 307 | ppdi: ppdi.o $(LIBCUPSPPDC) ../cups/$(LIBCUPS) |
ac884b6a | 308 | echo Linking $@... |
50fe7201 | 309 | $(CXX) $(LDFLAGS) -o $@ ppdi.o -L. -lcupsppdc $(LIBS) |
ac884b6a MS |
310 | |
311 | ||
312 | # | |
313 | # ppdmerge, merge PPD files. | |
314 | # | |
315 | ||
316 | ppdmerge: ppdmerge.o ../cups/$(LIBCUPS) | |
317 | echo Linking $@... | |
318 | $(CXX) $(LDFLAGS) -o $@ ppdmerge.o $(LIBS) | |
319 | ||
320 | ||
321 | # | |
322 | # ppdpo, create message catalog files. | |
323 | # | |
324 | ||
50fe7201 | 325 | ppdpo: ppdpo.o $(LIBCUPSPPDC) ../cups/$(LIBCUPS) |
ac884b6a | 326 | echo Linking $@... |
50fe7201 | 327 | $(CXX) $(LDFLAGS) -o $@ ppdpo.o -L. -lcupsppdc $(LIBS) |
ac884b6a MS |
328 | |
329 | ||
330 | # | |
50fe7201 | 331 | # libcupsppdc.so.1, libcupsppdc.sl.1 |
ac884b6a MS |
332 | # |
333 | ||
50fe7201 MS |
334 | libcupsppdc.so.1 libcupsppdc.sl.1: $(LIBOBJS) |
335 | echo Linking $@... | |
336 | $(DSOXX) $(ARCHFLAGS) $(DSOFLAGS) -o $@ $(LIBOBJS) $(LIBS) | |
337 | $(RM) `basename $@ .1` | |
338 | $(LN) $@ `basename $@ .1` | |
339 | ||
340 | ||
341 | # | |
342 | # 32bit/libcupsppdc.so.1 | |
343 | # | |
344 | ||
345 | 32bit/libcupsppdc.so.1: $(LIB32OBJS) | |
346 | echo Linking 32-bit $@... | |
347 | -mkdir 32bit | |
348 | $(DSOXX) $(ARCH32FLAGS) $(DSO32FLAGS) -o $@ $(LIB32OBJS) $(LIBS) | |
349 | $(RM) 32bit/libcupsppdc.so | |
350 | $(LN) libcupsppdc.so.1 32bit/libcupsppdc.so | |
351 | ||
352 | ||
353 | # | |
354 | # 64bit/libcupsppdc.so.1 | |
355 | # | |
356 | ||
357 | 64bit/libcupsppdc.so.1: $(LIB64OBJS) | |
358 | echo Linking 64-bit $@... | |
359 | -mkdir 64bit | |
360 | $(DSOXX) $(ARCH64FLAGS) $(DSO64FLAGS) -o $@ $(LIB64OBJS) $(LIBS) | |
361 | $(RM) 64bit/libcupsppdc.so | |
362 | $(LN) libcupsppdc.so.1 64bit/libcupsppdc.so | |
363 | ||
364 | ||
365 | # | |
366 | # libcupsppdc.1.dylib | |
367 | # | |
368 | ||
369 | libcupsppdc.1.dylib: $(LIBOBJS) libcupsppdc.exp | |
370 | echo Linking $@... | |
371 | $(DSOXX) $(ARCHFLAGS) $(DSOFLAGS) -o $@ \ | |
372 | -install_name $(libdir)/$@ \ | |
373 | -current_version 1.0.0 \ | |
374 | -compatibility_version 1.0.0 \ | |
375 | -exported_symbols_list libcupsppdc.exp \ | |
376 | $(LIBOBJS) $(LIBS) | |
377 | $(RM) libcupsppdc.dylib | |
378 | $(LN) $@ libcupsppdc.dylib | |
379 | ||
380 | ||
381 | # | |
382 | # libcupsppdc_s.a | |
383 | # | |
384 | ||
385 | libcupsppdc_s.a: $(LIBOBJS) | |
ac884b6a | 386 | echo Creating $@... |
50fe7201 MS |
387 | $(DSOXX) $(DSOFLAGS) -o libcupsppdc_s.o $(LIBOBJS) $(LIBS) |
388 | $(RM) $@ | |
389 | $(AR) $(ARFLAGS) $@ libcupsppdc_s.o | |
390 | ||
391 | ||
392 | # | |
393 | # libcupsppdc.la | |
394 | # | |
395 | ||
396 | libcupsppdc.la: $(LIBOBJS) | |
397 | echo Linking $@... | |
398 | $(CC) $(ARCHFLAGS) $(DSOFLAGS) -o $@ $(LIBOBJS:.o=.lo) -rpath $(LIBDIR) \ | |
399 | -version-info 1:0 $(LIBS) | |
400 | ||
401 | ||
402 | # | |
403 | # libcupsppdc.a | |
404 | # | |
405 | ||
406 | libcupsppdc.a: $(LIBOBJS) | |
407 | echo Archiving $@... | |
ac884b6a | 408 | $(RM) $@ |
50fe7201 | 409 | $(AR) $(ARFLAGS) $@ $(LIBOBJS) |
ac884b6a MS |
410 | $(RANLIB) $@ |
411 | ||
412 | ||
413 | # | |
414 | # Include dependencies... | |
415 | # | |
416 | ||
417 | include Dependencies | |
418 | ||
419 | ||
420 | # | |
421 | # End of "$Id$". | |
422 | # |