]> git.ipfire.org Git - thirdparty/cups.git/blob - filter/Makefile
License change: Apache License, Version 2.0.
[thirdparty/cups.git] / filter / Makefile
1 #
2 # Filter makefile for CUPS.
3 #
4 # Copyright 2007-2017 by Apple Inc.
5 # Copyright 1997-2006 by Easy Software Products.
6 #
7 # Licensed under Apache License v2.0. See the file "LICENSE" for more information.
8 #
9
10 include ../Makedefs
11
12
13 FILTERS = \
14 commandtops \
15 gziptoany \
16 pstops \
17 rastertoepson \
18 rastertohp \
19 rastertolabel \
20 rastertopwg
21 LIBTARGETS = \
22 $(LIBCUPSIMAGE) \
23 libcupsimage.a
24 UNITTARGETS = \
25 rasterbench \
26 testclient \
27 testraster
28 TARGETS = \
29 $(LIBTARGETS) \
30 $(FILTERS)
31
32 IMAGEOBJS = error.o interpret.o raster.o
33 OBJS = $(IMAGEOBJS) \
34 commandtops.o gziptoany.o common.o pstops.o \
35 rasterbench.o rastertoepson.o rastertohp.o rastertolabel.o \
36 rastertopwg.o testclient.o testraster.o
37
38
39 #
40 # Make all targets...
41 #
42
43 all: $(TARGETS)
44
45
46 #
47 # Make library targets...
48 #
49
50 libs: $(LIBTARGETS)
51
52
53 #
54 # Make unit tests...
55 #
56
57 unittests: $(UNITTARGETS)
58
59
60 #
61 # Clean all object files...
62 #
63
64 clean:
65 $(RM) $(OBJS) $(TARGETS) $(UNITTARGETS)
66 $(RM) libcupsimage.so libcupsimage.sl libcupsimage.dylib
67
68
69 #
70 # Update dependencies (without system header dependencies...)
71 #
72
73 depend:
74 $(CC) -MM $(ALL_CFLAGS) $(OBJS:.o=.c) >Dependencies
75
76
77 #
78 # Install all targets...
79 #
80
81 install: all install-data install-headers install-libs install-exec
82
83
84 #
85 # Install data files...
86 #
87
88 install-data:
89
90
91 #
92 # Install programs...
93 #
94
95 install-exec:
96 $(INSTALL_DIR) -m 755 $(SERVERBIN)/filter
97 for file in $(FILTERS); do \
98 $(INSTALL_BIN) $$file $(SERVERBIN)/filter; \
99 done
100 $(RM) $(SERVERBIN)/filter/rastertodymo
101 $(LN) rastertolabel $(SERVERBIN)/filter/rastertodymo
102 if test "x$(SYMROOT)" != "x"; then \
103 $(INSTALL_DIR) $(SYMROOT); \
104 for file in $(FILTERS); do \
105 cp $$file $(SYMROOT); \
106 dsymutil $(SYMROOT)/$$file; \
107 done \
108 fi
109
110
111 #
112 # Install headers...
113 #
114
115 install-headers:
116
117
118 #
119 # Install libraries...
120 #
121
122 install-libs: $(INSTALLSTATIC)
123 $(INSTALL_DIR) -m 755 $(LIBDIR)
124 $(INSTALL_LIB) $(LIBCUPSIMAGE) $(LIBDIR)
125 -if test $(LIBCUPSIMAGE) = "libcupsimage.so.2" -o $(LIBCUPSIMAGE) = "libcupsimage.sl.2"; then \
126 $(RM) $(LIBDIR)/`basename $(LIBCUPSIMAGE) .2`; \
127 $(LN) $(LIBCUPSIMAGE) $(LIBDIR)/`basename $(LIBCUPSIMAGE) .2`; \
128 fi
129 -if test $(LIBCUPSIMAGE) = "libcupsimage.2.dylib"; then \
130 $(RM) $(LIBDIR)/libcupsimage.dylib; \
131 $(LN) $(LIBCUPSIMAGE) $(LIBDIR)/libcupsimage.dylib; \
132 fi
133 if test "x$(SYMROOT)" != "x"; then \
134 $(INSTALL_DIR) $(SYMROOT); \
135 cp $(LIBCUPSIMAGE) $(SYMROOT); \
136 dsymutil $(SYMROOT)/$(LIBCUPSIMAGE); \
137 fi
138
139 installstatic:
140 $(INSTALL_DIR) -m 755 $(LIBDIR)
141 $(INSTALL_LIB) -m 755 libcupsimage.a $(LIBDIR)
142 $(RANLIB) $(LIBDIR)/libcupsimage.a
143 $(CHMOD) 555 $(LIBDIR)/libcupsimage.a
144
145
146 #
147 # Uninstall all targets...
148 #
149
150 uninstall:
151 for file in $(FILTERS); do \
152 $(RM) $(SERVERBIN)/filter/$$file; \
153 done
154 $(RM) $(SERVERBIN)/filter/rastertodymo
155 -$(RMDIR) $(SERVERBIN)/filter
156 -$(RMDIR) $(SERVERBIN)
157 $(RM) $(LIBDIR)/libcupsimage.2.dylib
158 $(RM) $(LIBDIR)/libcupsimage.a
159 $(RM) $(LIBDIR)/libcupsimage.dylib
160 $(RM) $(LIBDIR)/libcupsimage_s.a
161 $(RM) $(LIBDIR)/libcupsimage.sl
162 $(RM) $(LIBDIR)/libcupsimage.sl.2
163 $(RM) $(LIBDIR)/libcupsimage.so
164 $(RM) $(LIBDIR)/libcupsimage.so.2
165 -$(RMDIR) $(LIBDIR)
166
167
168 #
169 # Automatic API help files...
170 #
171
172 apihelp:
173 echo Generating CUPS API help files...
174 mxmldoc --section "Programming" --title "Raster API" \
175 --css ../doc/cups-printable.css \
176 --header api-raster.header --intro api-raster.shtml \
177 api-raster.xml \
178 ../cups/raster.h interpret.c raster.c \
179 >../doc/help/api-raster.html
180 mxmldoc --tokens help/api-raster.html api-raster.xml >../doc/help/api-raster.tokens
181 $(RM) api-raster.xml
182 mxmldoc --section "Programming" \
183 --title "Developing PostScript Printer Drivers" \
184 --css ../doc/cups-printable.css \
185 --header postscript-driver.header \
186 --intro postscript-driver.shtml \
187 >../doc/help/postscript-driver.html
188 mxmldoc --section "Programming" \
189 --title "Introduction to the PPD Compiler" \
190 --css ../doc/cups-printable.css \
191 --header ppd-compiler.header \
192 --intro ppd-compiler.shtml \
193 >../doc/help/ppd-compiler.html
194 mxmldoc --section "Programming" \
195 --title "Developing Raster Printer Drivers" \
196 --css ../doc/cups-printable.css \
197 --header raster-driver.header \
198 --intro raster-driver.shtml \
199 >../doc/help/raster-driver.html
200 mxmldoc --section "Specifications" \
201 --title "CUPS PPD Extensions" \
202 --css ../doc/cups-printable.css \
203 --header spec-ppd.header \
204 --intro spec-ppd.shtml \
205 >../doc/help/spec-ppd.html
206
207
208 #
209 # commandtops
210 #
211
212 commandtops: commandtops.o ../cups/$(LIBCUPS)
213 echo Linking $@...
214 $(LD_CC) $(LDFLAGS) -o $@ commandtops.o $(LIBS)
215
216
217 #
218 # gziptoany
219 #
220
221 gziptoany: gziptoany.o ../Makedefs ../cups/$(LIBCUPS)
222 echo Linking $@...
223 $(LD_CC) $(LDFLAGS) -o $@ gziptoany.o $(LIBZ) $(LIBS)
224
225
226 #
227 # libcupsimage.so.2, libcupsimage.sl.2
228 #
229
230 libcupsimage.so.2 libcupsimage.sl.2: $(IMAGEOBJS)
231 echo Linking $@...
232 $(DSO) $(ARCHFLAGS) $(DSOFLAGS) -o $@ $(IMAGEOBJS) $(DSOLIBS) \
233 -L../cups $(LINKCUPS)
234 $(RM) `basename $@ .2`
235 $(LN) $@ `basename $@ .2`
236
237
238 #
239 # libcupsimage.2.dylib
240 #
241
242 libcupsimage.2.dylib: $(IMAGEOBJS) $(LIBCUPSIMAGEORDER)
243 echo Linking $@...
244 $(DSO) $(ARCHFLAGS) $(DSOFLAGS) -o $@ \
245 -install_name $(libdir)/$@ \
246 -current_version 2.3.0 \
247 -compatibility_version 2.0.0 \
248 $(IMAGEOBJS) $(DSOLIBS) -L../cups $(LINKCUPS)
249 $(RM) libcupsimage.dylib
250 $(LN) $@ libcupsimage.dylib
251
252
253 #
254 # libcupsimage_s.a
255 #
256
257 libcupsimage_s.a: $(IMAGEOBJS) libcupsimage_s.exp
258 echo Linking $@...
259 $(DSO) $(DSOFLAGS) -Wl,-berok,-bexport:libcupsimage_s.exp \
260 -o libcupsimage_s.o $(IMAGEOBJS) $(DSOLIBS)
261 $(RM) $@
262 $(AR) $(ARFLAGS) $@ libcupsimage_s.o
263
264
265 #
266 # libcupsimage.la
267 #
268
269 libcupsimage.la: $(IMAGEOBJS)
270 echo Linking $@...
271 $(DSO) $(ARCHFLAGS) $(DSOFLAGS) -o $@ $(IMAGEOBJS:.o=.lo) $(DSOLIBS) \
272 -L../cups $(LINKCUPS) \
273 -rpath $(LIBDIR) -version-info 2:3
274
275
276 #
277 # libcupsimage.a
278 #
279
280 libcupsimage.a: $(IMAGEOBJS)
281 echo Archiving $@...
282 $(RM) $@
283 $(AR) $(ARFLAGS) $@ $(IMAGEOBJS)
284 $(RANLIB) $@
285
286
287 #
288 # pstops
289 #
290
291 pstops: pstops.o common.o ../cups/$(LIBCUPS)
292 echo Linking $@...
293 $(LD_CC) $(LDFLAGS) -o $@ pstops.o common.o $(LIBS)
294
295
296 #
297 # rastertoepson
298 #
299
300 rastertoepson: rastertoepson.o ../cups/$(LIBCUPS) $(LIBCUPSIMAGE)
301 echo Linking $@...
302 $(LD_CC) $(LDFLAGS) -o $@ rastertoepson.o $(LINKCUPSIMAGE) $(IMGLIBS) $(LIBS)
303
304
305 #
306 # rastertohp
307 #
308
309 rastertohp: rastertohp.o ../cups/$(LIBCUPS) $(LIBCUPSIMAGE)
310 echo Linking $@...
311 $(LD_CC) $(LDFLAGS) -o $@ rastertohp.o $(LINKCUPSIMAGE) $(IMGLIBS) $(LIBS)
312
313
314 #
315 # rastertolabel
316 #
317
318 rastertolabel: rastertolabel.o ../cups/$(LIBCUPS) $(LIBCUPSIMAGE)
319 echo Linking $@...
320 $(LD_CC) $(LDFLAGS) -o $@ rastertolabel.o $(LINKCUPSIMAGE) $(IMGLIBS) $(LIBS)
321
322
323 #
324 # rastertopwg
325 #
326
327 rastertopwg: rastertopwg.o ../cups/$(LIBCUPS) $(LIBCUPSIMAGE)
328 echo Linking $@...
329 $(LD_CC) $(LDFLAGS) -o $@ rastertopwg.o $(LINKCUPSIMAGE) $(IMGLIBS) $(LIBS)
330
331 rastertopwg-static: rastertopwg.o ../cups/$(LIBCUPSSTATIC) libcupsimage.a
332 echo Linking $@...
333 $(LD_CC) $(LDFLAGS) -o $@ rastertopwg.o libcupsimage.a \
334 ../cups/$(LIBCUPSSTATIC) $(IMGLIBS) $(DSOLIBS) $(COMMONLIBS) \
335 $(SSLLIBS) $(DNSSDLIBS) $(LIBGSSAPI)
336
337
338 #
339 # testclient (dependency on static libraries is intentional)
340 #
341
342 testclient: testclient.o ../cups/$(LIBCUPSSTATIC) libcupsimage.a
343 echo Linking $@...
344 $(LD_CC) $(LDFLAGS) -o $@ testclient.o \
345 libcupsimage.a ../cups/$(LIBCUPSSTATIC) \
346 $(LIBGSSAPI) $(SSLLIBS) $(DNSSDLIBS) $(COMMONLIBS) $(LIBZ)
347
348
349 #
350 # testraster
351 #
352
353 testraster: testraster.o ../cups/$(LIBCUPSSTATIC) libcupsimage.a
354 echo Linking $@...
355 $(LD_CC) $(ARCHFLAGS) $(LDFLAGS) -o $@ testraster.o libcupsimage.a \
356 ../cups/$(LIBCUPSSTATIC) $(IMGLIBS) $(DSOLIBS) $(COMMONLIBS) \
357 $(SSLLIBS) $(DNSSDLIBS) $(LIBGSSAPI)
358 echo Running raster API tests...
359 ./testraster
360
361
362 #
363 # rasterbench
364 #
365
366 rasterbench: rasterbench.o libcupsimage.a
367 echo Linking $@...
368 $(LD_CC) $(LDFLAGS) -o $@ rasterbench.o libcupsimage.a $(LIBS)
369
370
371 #
372 # Dependencies...
373 #
374
375 include Dependencies