]> git.ipfire.org Git - thirdparty/cups.git/blob - ppdc/Makefile
55c85b3c04dd070d0e65c5b99d313bfc75d83778
[thirdparty/cups.git] / ppdc / Makefile
1 #
2 # "$Id$"
3 #
4 # Makefile for the CUPS PPD Compiler.
5 #
6 # Copyright 2007-2009 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
27 LIBOBJS = \
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
47 OBJS = \
48 $(LIBOBJS) \
49 genstrings.o \
50 ppdc.o \
51 ppdhtml.o \
52 ppdi.o \
53 ppdmerge.o \
54 ppdpo.o \
55 testcatalog.o
56 LIBTARGETS = \
57 $(LIBCUPSPPDC) \
58 libcupsppdc.a
59 UNITTARGETS = \
60 ppdc-static \
61 testcatalog
62 EXECTARGETS = \
63 ppdc \
64 ppdhtml \
65 ppdi \
66 ppdmerge \
67 ppdpo
68
69 TARGETS = \
70 $(LIBTARGETS) \
71 $(EXECTARGETS) \
72 genstrings
73
74
75 #
76 # Make everything...
77 #
78
79 all: $(TARGETS)
80
81
82 #
83 # Make library targets...
84 #
85
86 libs: $(LIBTARGETS)
87
88
89 #
90 # Make unit tests...
91 #
92
93 unittests: $(UNITTARGETS)
94
95
96 #
97 # Clean everything...
98 #
99
100 clean:
101 $(RM) $(OBJS) core
102 $(RM) *.bak *.bck core.*
103 $(RM) $(TARGETS) $(UNITTARGETS)
104 $(RM) -r ppd
105 $(RM) sample.c test.drv
106 $(RM) libcupsppdc.so libcupsppdc.sl libcupsppdc.dylib
107
108
109 #
110 # Update dependencies...
111 #
112
113 depend:
114 makedepend -Y -I.. -fDependencies $(OBJS:.o=.cxx) >/dev/null 2>&1
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
130 $(INSTALL_DATA) sample.drv $(DATADIR)/drv
131
132
133 #
134 # Install programs...
135 #
136
137 install-exec:
138 echo Installing PPD compiler programs...
139 $(INSTALL_DIR) $(BINDIR)
140 for file in $(EXECTARGETS); do \
141 $(INSTALL_BIN) $$file $(BINDIR); \
142 done
143 if test "x$(SYMROOT)" != "x"; then \
144 $(INSTALL_DIR) $(SYMROOT); \
145 for file in $(EXECTARGETS) $(LIBTARGETS); do \
146 cp $$file $(SYMROOT); \
147 done \
148 fi
149
150
151 #
152 # Install headers...
153 #
154
155 install-headers:
156 echo Installing header files in $(INCLUDEDIR)/cups...
157 $(INSTALL_DIR) -m 755 $(INCLUDEDIR)/cups
158 $(INSTALL_DATA) ppdc.h $(INCLUDEDIR)/cups
159
160
161 #
162 # Install libraries...
163 #
164
165 install-libs: $(INSTALLSTATIC)
166 echo Installing libraries in $(LIBDIR)...
167 $(INSTALL_DIR) -m 755 $(LIBDIR)
168 $(INSTALL_LIB) $(LIBCUPSPPDC) $(LIBDIR)
169 if test $(LIBCUPSPPDC) = "libcupsppdc.so.1" -o $(LIBCUPSPPDC) = "libcupsppdc.sl.1"; then \
170 $(RM) $(LIBDIR)/`basename $(LIBCUPSPPDC) .1`; \
171 $(LN) $(LIBCUPSPPDC) $(LIBDIR)/`basename $(LIBCUPSPPDC) .1`; \
172 fi
173 if test $(LIBCUPSPPDC) = "libcupsppdc.1.dylib"; then \
174 $(RM) $(LIBDIR)/libcupsppdc.dylib; \
175 $(LN) $(LIBCUPSPPDC) $(LIBDIR)/libcupsppdc.dylib; \
176 fi
177 if test "x$(SYMROOT)" != "x"; then \
178 $(INSTALL_DIR) $(SYMROOT); \
179 cp $(LIBCUPSPPDC) $(SYMROOT); \
180 fi
181
182 installstatic:
183 $(INSTALL_DIR) -m 755 $(LIBDIR)
184 $(INSTALL_LIB) libcupsppdc.a $(LIBDIR)
185 $(RANLIB) $(LIBDIR)/libcupsppdc.a
186
187
188 #
189 # Uninstall...
190 #
191
192 uninstall:
193 for file in $(EXECTARGETS); do \
194 $(RM) $(BINDIR)/$$file; \
195 done
196 $(RM) $(DATADIR)/drv/sample.drv
197 $(RMDIR) $(DATADIR)/drv
198 $(RM) $(LIBDIR)/libcupsppdc.1.dylib
199 $(RM) $(LIBDIR)/libcupsppdc.a
200 $(RM) $(LIBDIR)/libcupsppdc.dylib
201 $(RM) $(LIBDIR)/libcupsppdc_s.a
202 $(RM) $(LIBDIR)/libcupsppdc.sl
203 $(RM) $(LIBDIR)/libcupsppdc.sl.1
204 $(RM) $(LIBDIR)/libcupsppdc.so
205 $(RM) $(LIBDIR)/libcupsppdc.so.1
206 -$(RMDIR) $(LIBDIR)
207 $(RM) $(INCLUDEDIR)/cups/ppdc.h
208 -$(RMDIR) $(INCLUDEDIR)/cups
209
210
211 #
212 # Automatic API help files...
213 #
214
215 apihelp:
216 mxmldoc --section "Programming" \
217 --title "PPD Compiler API" \
218 --css ../doc/cups-printable.css \
219 --header api-ppdc.header --intro api-ppdc.shtml \
220 ppdc.h $(LIBOBJS:.o=.cxx) >../doc/help/api-ppdc.html
221
222 framedhelp:
223 mxmldoc --framed api-ppdc \
224 --section "Programming" \
225 --title "PPD Compiler API" \
226 --css ../doc/cups-printable.css \
227 --header api-ppdc.header --intro api-ppdc.shtml \
228 ppdc.h $(LIBOBJS:.o=.cxx)
229
230
231 #
232 # genstrings - generate GNU gettext strings.
233 #
234
235 genstrings: genstrings.o libcupsppdc.a ../cups/libcups.a \
236 sample.drv ../data/media.defs
237 echo Linking $@...
238 $(CXX) $(ARCHFLAGS) $(LDFLAGS) -o genstrings genstrings.o \
239 libcupsppdc.a ../cups/libcups.a $(LIBGSSAPI) $(SSLLIBS) \
240 $(DNSSDLIBS) $(COMMONLIBS) $(LIBZ)
241 echo Generating localization strings...
242 ./genstrings >sample.c
243
244
245 #
246 # ppdc, the PPD compiler.
247 #
248
249 ppdc: ppdc.o $(LIBCUPSPPDC) ../cups/$(LIBCUPS)
250 echo Linking $@...
251 $(CXX) $(LDFLAGS) -o $@ ppdc.o -L. -lcupsppdc $(LIBS)
252
253
254 ppdc-static: ppdc.o libcupsppdc.a ../cups/libcups.a foo.drv foo-fr.po
255 echo Linking $@...
256 $(CXX) $(ARCHFLAGS) $(LDFLAGS) -o ppdc-static ppdc.o libcupsppdc.a \
257 ../cups/libcups.a $(LIBGSSAPI) $(SSLLIBS) $(DNSSDLIBS) \
258 $(COMMONLIBS) $(LIBZ)
259 echo Testing PPD compiler...
260 ./ppdc-static -l en,fr -I ../data foo.drv
261 ./ppdc-static -l en,fr -z -I ../data foo.drv
262
263
264 #
265 # ppdhtml, the PPD to HTML utility.
266 #
267
268 ppdhtml: ppdhtml.o $(LIBCUPSPPDC) ../cups/$(LIBCUPS)
269 echo Linking $@...
270 $(CXX) $(LDFLAGS) -o $@ ppdhtml.o -L. -lcupsppdc $(LIBS)
271
272
273 #
274 # ppdi, import PPD files.
275 #
276
277 ppdi: ppdi.o $(LIBCUPSPPDC) ../cups/$(LIBCUPS)
278 echo Linking $@...
279 $(CXX) $(LDFLAGS) -o $@ ppdi.o -L. -lcupsppdc $(LIBS)
280
281
282 #
283 # ppdmerge, merge PPD files.
284 #
285
286 ppdmerge: ppdmerge.o ../cups/$(LIBCUPS)
287 echo Linking $@...
288 $(CXX) $(LDFLAGS) -o $@ ppdmerge.o $(LIBS)
289
290
291 #
292 # ppdpo, create message catalog files.
293 #
294
295 ppdpo: ppdpo.o $(LIBCUPSPPDC) ../cups/$(LIBCUPS)
296 echo Linking $@...
297 $(CXX) $(LDFLAGS) -o $@ ppdpo.o -L. -lcupsppdc $(LIBS)
298
299
300 #
301 # testcatalog, test ppdcCatalog class.
302 #
303
304 testcatalog: testcatalog.o libcupsppdc.a ../cups/libcups.a
305 echo Linking $@...
306 $(CXX) $(LDFLAGS) -o $@ testcatalog.o libcupsppdc.a \
307 ../cups/libcups.a $(LIBGSSAPI) $(SSLLIBS) $(DNSSDLIBS) \
308 $(COMMONLIBS) $(LIBZ)
309
310
311 #
312 # libcupsppdc.so.1, libcupsppdc.sl.1
313 #
314
315 libcupsppdc.so.1 libcupsppdc.sl.1: $(LIBOBJS)
316 echo Linking $@...
317 $(DSOXX) $(ARCHFLAGS) $(DSOFLAGS) -o $@ $(LIBOBJS) $(LIBS)
318 $(RM) `basename $@ .1`
319 $(LN) $@ `basename $@ .1`
320
321
322 #
323 # libcupsppdc.1.dylib
324 #
325
326 libcupsppdc.1.dylib: $(LIBOBJS)
327 echo Creating export list for $@...
328 nm $(LIBOBJS) | grep "T __" | awk '{print $$3}' | sort >t.exp
329 echo Linking $@...
330 $(DSOXX) $(ARCHFLAGS) $(DSOFLAGS) -o $@ \
331 -install_name $(libdir)/$@ \
332 -current_version 1.0.0 \
333 -compatibility_version 1.0.0 \
334 -exported_symbols_list t.exp \
335 $(LIBOBJS) $(LIBS)
336 $(RM) libcupsppdc.dylib t.exp
337 $(LN) $@ libcupsppdc.dylib
338
339
340 #
341 # libcupsppdc_s.a
342 #
343
344 libcupsppdc_s.a: $(LIBOBJS)
345 echo Creating $@...
346 $(DSOXX) $(DSOFLAGS) -o libcupsppdc_s.o $(LIBOBJS) $(LIBS)
347 $(RM) $@
348 $(AR) $(ARFLAGS) $@ libcupsppdc_s.o
349
350
351 #
352 # libcupsppdc.la
353 #
354
355 libcupsppdc.la: $(LIBOBJS)
356 echo Linking $@...
357 $(CC) $(ARCHFLAGS) $(DSOFLAGS) -o $@ $(LIBOBJS:.o=.lo) -rpath $(LIBDIR) \
358 -version-info 1:0 $(LIBS)
359
360
361 #
362 # libcupsppdc.a
363 #
364
365 libcupsppdc.a: $(LIBOBJS)
366 echo Archiving $@...
367 $(RM) $@
368 $(AR) $(ARFLAGS) $@ $(LIBOBJS)
369 $(RANLIB) $@
370
371
372 #
373 # Include dependencies...
374 #
375
376 include Dependencies
377
378
379 #
380 # End of "$Id$".
381 #