blob: 842505ca1bffedd147dc40e08c34659ffcf6619b (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
|
#
# Makefile for the CUPS PPD Compiler.
#
# Copyright 2007-2017 by Apple Inc.
# Copyright 2002-2006 by Easy Software Products.
#
# Licensed under Apache License v2.0. See the file "LICENSE" for more information.
#
#
# Include standard definitions...
#
include ../Makedefs
#
# Object files...
#
LIBOBJS = \
ppdc-array.o \
ppdc-attr.o \
ppdc-catalog.o \
ppdc-choice.o \
ppdc-constraint.o \
ppdc-driver.o \
ppdc-file.o \
ppdc-filter.o \
ppdc-font.o \
ppdc-group.o \
ppdc-import.o \
ppdc-mediasize.o \
ppdc-message.o \
ppdc-option.o \
ppdc-profile.o \
ppdc-shared.o \
ppdc-source.o \
ppdc-string.o \
ppdc-variable.o
OBJS = \
$(LIBOBJS) \
genstrings.o \
ppdc.o \
ppdhtml.o \
ppdi.o \
ppdmerge.o \
ppdpo.o \
testcatalog.o
LIBTARGETS = \
$(LIBCUPSPPDC) \
libcupsppdc.a
UNITTARGETS = \
ppdc-static \
ppdi-static \
testcatalog
EXECTARGETS = \
ppdc \
ppdhtml \
ppdi \
ppdmerge \
ppdpo
TARGETS = \
$(LIBTARGETS) \
$(EXECTARGETS) \
$(LOCALTARGET)
#
# Make everything...
#
all: $(TARGETS)
#
# Make library targets...
#
libs: $(LIBTARGETS)
#
# Make unit tests...
#
unittests: $(UNITTARGETS)
#
# Clean everything...
#
clean:
$(RM) $(OBJS) core
$(RM) *.bak *.bck core.*
$(RM) $(TARGETS) $(UNITTARGETS) genstrings
$(RM) -r ppd ppd2
$(RM) sample-import.drv sample.c test.drv
$(RM) libcupsppdc.so libcupsppdc.dylib
#
# Update dependencies...
#
depend:
$(CXX) -MM $(ALL_CXXFLAGS) $(OBJS:.o=.cxx) >Dependencies
#
# Install all targets...
#
install: all install-data install-headers install-libs install-exec
#
# Install data files...
#
install-data:
$(INSTALL_DIR) $(DATADIR)/drv
$(INSTALL_DATA) sample.drv $(DATADIR)/drv
#
# Install programs...
#
install-exec:
echo Installing PPD compiler programs...
$(INSTALL_DIR) $(BINDIR)
for file in $(EXECTARGETS); do \
$(INSTALL_BIN) $$file $(BINDIR); \
done
if test "x$(SYMROOT)" != "x"; then \
$(INSTALL_DIR) $(SYMROOT); \
for file in $(EXECTARGETS); do \
cp $$file $(SYMROOT); \
dsymutil $(SYMROOT)/$$file; \
done \
fi
#
# Install headers...
#
install-headers:
if test "x$(privateinclude)" != x; then \
echo Installing private header files into $(PRIVATEINCLUDE)...; \
$(INSTALL_DIR) -m 755 $(PRIVATEINCLUDE); \
$(INSTALL_DATA) ppdc.h $(PRIVATEINCLUDE); \
fi
#
# Install libraries...
#
install-libs: $(INSTALLSTATIC)
echo Installing libraries in $(LIBDIR)...
$(INSTALL_DIR) -m 755 $(LIBDIR)
$(INSTALL_LIB) $(LIBCUPSPPDC) $(LIBDIR)
if test $(LIBCUPSPPDC) = "libcupsppdc.so.1"; then \
$(RM) $(LIBDIR)/`basename $(LIBCUPSPPDC) .1`; \
$(LN) $(LIBCUPSPPDC) $(LIBDIR)/`basename $(LIBCUPSPPDC) .1`; \
fi
if test $(LIBCUPSPPDC) = "libcupsppdc.1.dylib"; then \
$(RM) $(LIBDIR)/libcupsppdc.dylib; \
$(LN) $(LIBCUPSPPDC) $(LIBDIR)/libcupsppdc.dylib; \
fi
if test "x$(SYMROOT)" != "x"; then \
$(INSTALL_DIR) $(SYMROOT); \
cp $(LIBCUPSPPDC) $(SYMROOT); \
dsymutil $(SYMROOT)/$(LIBCUPSPPDC); \
fi
installstatic:
$(INSTALL_DIR) -m 755 $(LIBDIR)
$(INSTALL_LIB) -m 755 libcupsppdc.a $(LIBDIR)
$(RANLIB) $(LIBDIR)/libcupsppdc.a
$(CHMOD) 555 $(LIBDIR)/libcupsppdc.a
#
# Uninstall...
#
uninstall:
for file in $(EXECTARGETS); do \
$(RM) $(BINDIR)/$$file; \
done
$(RM) $(DATADIR)/drv/sample.drv
$(RMDIR) $(DATADIR)/drv
$(RM) $(LIBDIR)/libcupsppdc.1.dylib
$(RM) $(LIBDIR)/libcupsppdc.a
$(RM) $(LIBDIR)/libcupsppdc.dylib
$(RM) $(LIBDIR)/libcupsppdc.so
$(RM) $(LIBDIR)/libcupsppdc.so.1
-$(RMDIR) $(LIBDIR)
-if test "x$(privateinclude)" != x; then \
$(RM) $(PRIVATEINCLUDE)/ppdc.h; \
$(RMDIR) $(PRIVATEINCLUDE); \
fi
#
# Local programs (not built when cross-compiling...)
#
local: genstrings
#
# genstrings - generate GNU gettext strings.
#
genstrings: genstrings.o libcupsppdc.a ../cups/$(LIBCUPSSTATIC) \
sample.drv ../data/media.defs
echo Linking $@...
$(LD_CXX) $(ARCHFLAGS) $(LDFLAGS) -o genstrings genstrings.o \
libcupsppdc.a ../cups/$(LIBCUPSSTATIC) $(LIBGSSAPI) $(SSLLIBS) \
$(DNSSDLIBS) $(COMMONLIBS) $(LIBZ)
echo Generating localization strings...
./genstrings >sample.c
#
# ppdc, the PPD compiler.
#
ppdc: ppdc.o $(LIBCUPSPPDC) ../cups/$(LIBCUPS)
echo Linking $@...
$(LD_CXX) $(LDFLAGS) -o $@ ppdc.o -L. -lcupsppdc $(LIBS)
ppdc-static: ppdc.o libcupsppdc.a ../cups/$(LIBCUPSSTATIC) foo.drv foo-fr.po
echo Linking $@...
$(LD_CXX) $(ARCHFLAGS) $(LDFLAGS) -o ppdc-static ppdc.o libcupsppdc.a \
../cups/$(LIBCUPSSTATIC) $(LIBGSSAPI) $(SSLLIBS) $(DNSSDLIBS) \
$(COMMONLIBS) $(LIBZ)
echo Testing PPD compiler...
./ppdc-static -l en,fr -I ../data foo.drv
./ppdc-static -l en,fr -z -I ../data foo.drv
#
# ppdhtml, the PPD to HTML utility.
#
ppdhtml: ppdhtml.o $(LIBCUPSPPDC) ../cups/$(LIBCUPS)
echo Linking $@...
$(LD_CXX) $(LDFLAGS) -o $@ ppdhtml.o -L. -lcupsppdc $(LIBS)
#
# ppdi, import PPD files.
#
ppdi: ppdi.o $(LIBCUPSPPDC) ../cups/$(LIBCUPS)
echo Linking $@...
$(LD_CXX) $(LDFLAGS) -o $@ ppdi.o -L. -lcupsppdc $(LIBS)
ppdi-static: ppdc-static ppdi.o libcupsppdc.a ../cups/$(LIBCUPSSTATIC)
echo Linking $@...
$(LD_CXX) $(ARCHFLAGS) $(LDFLAGS) -o ppdi-static ppdi.o libcupsppdc.a \
../cups/$(LIBCUPSSTATIC) $(LIBGSSAPI) $(SSLLIBS) $(DNSSDLIBS) \
$(COMMONLIBS) $(LIBZ)
echo Testing PPD importer...
$(RM) -r ppd ppd2 sample-import.drv
./ppdc-static -l en -I ../data sample.drv
./ppdi-static -I ../data -o sample-import.drv ppd/*
./ppdc-static -l en -I ../data -d ppd2 sample-import.drv
if diff -r ppd ppd2 >/dev/null; then \
echo PPD import OK; \
else \
echo PPD import FAILED; \
exit 1; \
fi
#
# ppdmerge, merge PPD files.
#
ppdmerge: ppdmerge.o ../cups/$(LIBCUPS)
echo Linking $@...
$(LD_CXX) $(LDFLAGS) -o $@ ppdmerge.o $(LIBS)
#
# ppdpo, create message catalog files.
#
ppdpo: ppdpo.o $(LIBCUPSPPDC) ../cups/$(LIBCUPS)
echo Linking $@...
$(LD_CXX) $(LDFLAGS) -o $@ ppdpo.o -L. -lcupsppdc $(LIBS)
#
# testcatalog, test ppdcCatalog class.
#
testcatalog: testcatalog.o libcupsppdc.a ../cups/$(LIBCUPSSTATIC)
echo Linking $@...
$(LD_CXX) $(LDFLAGS) -o $@ testcatalog.o libcupsppdc.a \
../cups/$(LIBCUPSSTATIC) $(LIBGSSAPI) $(SSLLIBS) $(DNSSDLIBS) \
$(COMMONLIBS) $(LIBZ)
#
# libcupsppdc.so.1
#
libcupsppdc.so.1: $(LIBOBJS) ../cups/$(LIBCUPS)
echo Linking $@...
$(DSOXX) $(ARCHFLAGS) $(DSOFLAGS) -o $@ $(LIBOBJS) $(LINKCUPS)
$(RM) `basename $@ .1`
$(LN) $@ `basename $@ .1`
#
# libcupsppdc.1.dylib
#
libcupsppdc.1.dylib: $(LIBOBJS) ../cups/$(LIBCUPS)
echo Creating export list for $@...
nm -gm $(LIBOBJS) | grep "__text" | grep -v weak | awk '{print $$NF}' | sort >t.exp
echo Linking $@...
$(DSOXX) $(ARCHFLAGS) $(DSOFLAGS) -o $@ \
-install_name $(libdir)/$@ \
-current_version 1.0.0 \
-compatibility_version 1.0.0 \
-exported_symbols_list t.exp \
$(LIBOBJS) $(LINKCUPS) $(COMMONLIBS)
$(RM) libcupsppdc.dylib t.exp
$(LN) $@ libcupsppdc.dylib
#
# libcupsppdc.la
#
libcupsppdc.la: $(LIBOBJS) ../cups/$(LIBCUPS)
echo Linking $@...
$(LD_CC) $(ARCHFLAGS) $(DSOFLAGS) -o $@ $(LIBOBJS:.o=.lo) -rpath $(LIBDIR) \
-version-info 1:0 $(LINKCUPS)
#
# libcupsppdc.a
#
libcupsppdc.a: $(LIBOBJS)
echo Archiving $@...
$(RM) $@
$(AR) $(ARFLAGS) $@ $(LIBOBJS)
$(RANLIB) $@
#
# Include dependencies...
#
include Dependencies
|