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