]> git.ipfire.org Git - thirdparty/cups.git/blob - filter/Makefile
528839bc1fca8118a8c1ce7788e0cd7072a15fbf
[thirdparty/cups.git] / filter / Makefile
1 #
2 # "$Id$"
3 #
4 # Filter makefile for the Common UNIX Printing System (CUPS).
5 #
6 # Copyright 1997-2006 by Easy Software Products.
7 #
8 # These coded instructions, statements, and computer programs are the
9 # property of Easy Software Products and are protected by Federal
10 # copyright law. Distribution and use rights are outlined in the file
11 # "LICENSE.txt" which should have been included with this file. If this
12 # file is missing or damaged please contact Easy Software Products
13 # at:
14 #
15 # Attn: CUPS Licensing Information
16 # Easy Software Products
17 # 44141 Airport View Drive, Suite 204
18 # Hollywood, Maryland 20636 USA
19 #
20 # Voice: (301) 373-9600
21 # EMail: cups-info@cups.org
22 # WWW: http://www.cups.org
23 #
24 # This file is subject to the Apple OS-Developed Software exception.
25 #
26
27 include ../Makedefs
28
29 FILTERS = gziptoany hpgltops texttops pstops $(IMGFILTERS) \
30 rastertolabel rastertoepson rastertohp
31 TARGETS = $(FILTERS) \
32 $(LIBCUPSIMAGE) \
33 libcupsimage.a \
34 $(LIB32CUPSIMAGE) \
35 $(LIB64CUPSIMAGE) \
36 rasterbench \
37 testimage \
38 testraster
39
40 HPGLOBJS = hpgl-attr.o hpgl-config.o hpgl-main.o hpgl-prolog.o \
41 hpgl-char.o hpgl-input.o hpgl-polygon.o hpgl-vector.o
42 IMAGEOBJS = image-bmp.o image-colorspace.o image-gif.o image-jpeg.o \
43 image-photocd.o image-pix.o image-png.o image-pnm.o \
44 image-sgi.o image-sgilib.o image-sun.o image-tiff.o \
45 image-zoom.o image.o interpret.o raster.o
46 IMAGE32OBJS = $(IMAGEOBJS:.o=.32.o)
47 IMAGE64OBJS = $(IMAGEOBJS:.o=.64.o)
48 FORMOBJS = form-attr.o form-main.o form-ps.o form-text.o form-tree.o
49 OBJS = $(HPGLOBJS) $(IMAGEOBJS) $(FORMOBJS) \
50 gziptoany.o imagetops.o imagetoraster.o common.o pstops.o \
51 rasterbench.o rastertoepson.o rastertohp.o rastertolabel.o \
52 testimage.o testraster.o textcommon.o texttops.o
53
54
55 #
56 # Make all targets...
57 #
58
59 all: $(TARGETS)
60
61
62 #
63 # Clean all object files...
64 #
65
66 clean:
67 $(RM) $(OBJS) $(TARGETS)
68 $(RM) libcupsimage.so libcupsimage.sl libcupsimage.dylib
69 $(RM) -r 32bit 64bit
70
71
72 #
73 # Update dependencies (without system header dependencies...)
74 #
75
76 depend:
77 touch Dependencies.tmp
78 makedepend -Y -I.. -fDependencies.tmp $(OBJS:.o=.c) >/dev/null 2>&1
79 $(RM) Dependencies
80 cp Dependencies.tmp Dependencies
81 sed -r -e '1,$$s/^([^.]+)\.o:/\1\.32.o: \1\.c /' Dependencies.tmp >>Dependencies
82 sed -r -e '1,$$s/^([^.]+)\.o:/\1\.64.o: \1\.c /' Dependencies.tmp >>Dependencies
83 $(RM) Dependencies.tmp
84
85
86 #
87 # Install all targets...
88 #
89
90 install: all installhdrs $(INSTALLSTATIC) $(INSTALL32) $(INSTALL64)
91 $(INSTALL_DIR) -m 755 $(SERVERBIN)/filter
92 for file in $(FILTERS); do \
93 $(INSTALL_BIN) $$file $(SERVERBIN)/filter; \
94 done
95 $(RM) $(SERVERBIN)/filter/rastertodymo
96 $(LN) rastertolabel $(SERVERBIN)/filter/rastertodymo
97 $(INSTALL_DIR) -m 755 $(LIBDIR)
98 $(INSTALL_LIB) $(LIBCUPSIMAGE) $(LIBDIR)
99 -if test $(LIBCUPSIMAGE) = "libcupsimage.so.2" -o $(LIBCUPSIMAGE) = "libcupsimage.sl.2"; then \
100 $(RM) $(LIBDIR)/`basename $(LIBCUPSIMAGE) .2`; \
101 $(LN) $(LIBCUPSIMAGE) $(LIBDIR)/`basename $(LIBCUPSIMAGE) .2`; \
102 fi
103 -if test $(LIBCUPSIMAGE) = "libcupsimage.2.dylib"; then \
104 $(STRIP) -x $(LIBDIR)/$(LIBCUPSIMAGE); \
105 $(RM) $(LIBDIR)/libcupsimage.dylib; \
106 $(LN) $(LIBCUPSIMAGE) $(LIBDIR)/libcupsimage.dylib; \
107 fi
108
109 installstatic:
110 $(INSTALL_DIR) -m 755 $(LIBDIR)
111 $(INSTALL_LIB) libcupsimage.a $(LIBDIR);
112 $(RANLIB) $(LIBDIR)/libcupsimage.a;
113
114 installhdrs:
115 $(INSTALL_DIR) -m 755 $(INCLUDEDIR)/cups
116 $(INSTALL_DATA) image.h $(INCLUDEDIR)/cups
117 $(INSTALL_DATA) raster.h $(INCLUDEDIR)/cups
118
119 install32bit:
120 $(INSTALL_DIR) -m 755 $(LIB32DIR)
121 $(INSTALL_LIB) 32bit/libcupsimage.so.2 $(LIB32DIR)/libcupsimage.so.2
122 $(LN) libcupsimage.so.2 $(LIB32DIR)/libcupsimage.so
123
124 install64bit:
125 $(INSTALL_DIR) -m 755 $(LIB64DIR)
126 $(INSTALL_LIB) 64bit/libcupsimage.so.2 $(LIB64DIR)/libcupsimage.so.2
127 $(LN) libcupsimage.so.2 $(LIB64DIR)/libcupsimage.so
128
129
130 #
131 # Uninstall all targets...
132 #
133
134 uninstall: $(UNINSTALL32) $(UNINSTALL64)
135 for file in $(FILTERS); do \
136 $(RM) $(SERVERBIN)/filter/$$file; \
137 done
138 $(RM) $(SERVERBIN)/filter/rastertodymo
139 -$(RMDIR) $(SERVERBIN)/filter
140 -$(RMDIR) $(SERVERBIN)
141 $(RM) $(LIBDIR)/libcupsimage.2.dylib
142 $(RM) $(LIBDIR)/libcupsimage.a
143 $(RM) $(LIBDIR)/libcupsimage.dylib
144 $(RM) $(LIBDIR)/libcupsimage_s.a
145 $(RM) $(LIBDIR)/libcupsimage.sl
146 $(RM) $(LIBDIR)/libcupsimage.sl.2
147 $(RM) $(LIBDIR)/libcupsimage.so
148 $(RM) $(LIBDIR)/libcupsimage.so.2
149 -$(RMDIR) $(LIBDIR)
150 $(RM) $(INCLUDEDIR)/cups/image.h
151 $(RM) $(INCLUDEDIR)/cups/raster.h
152 -$(RMDIR) $(INCLUDEDIR)/cups
153
154 uninstall32bit:
155 $(RM) $(LIB32DIR)/libcupsimage.so
156 $(RM) $(LIB32DIR)/libcupsimage.so.2
157 -$(RMDIR) $(LIB32DIR)
158
159 uninstall64bit:
160 $(RM) $(LIB64DIR)/libcupsimage.so
161 $(RM) $(LIB64DIR)/libcupsimage.so.2
162 -$(RMDIR) $(LIB64DIR)
163
164
165 #
166 # Automatic API help files...
167 #
168
169 apihelp:
170 echo Generating CUPS API help files...
171 mxmldoc --section "Programming" --title "Raster API" \
172 --intro api-raster.shtml \
173 raster.h interpret.c raster.c >../doc/help/api-raster.html
174
175
176 #
177 # formtops
178 #
179
180 formtops: $(FORMOBJS) common.o ../cups/$(LIBCUPS)
181 echo Linking $@...
182 $(CC) $(LDFLAGS) -o $@ $(FORMOBJS) common.o $(LIBS) -lm
183
184
185 #
186 # gziptoany
187 #
188
189 gziptoany: gziptoany.o ../Makedefs ../cups/$(LIBCUPS)
190 echo Linking $@...
191 $(CC) $(LDFLAGS) -o $@ gziptoany.o $(LIBZ) $(LIBS)
192
193
194 #
195 # hpgltops
196 #
197
198 hpgltops: $(HPGLOBJS) common.o ../cups/$(LIBCUPS)
199 echo Linking $@...
200 $(CC) $(LDFLAGS) -o $@ $(HPGLOBJS) common.o $(LIBS) -lm
201
202
203 #
204 # libcupsimage.so.2, libcupsimage.sl.2
205 #
206
207 libcupsimage.so.2 libcupsimage.sl.2: $(IMAGEOBJS)
208 echo Linking $@...
209 $(DSO) $(ARCHFLAGS) $(DSOFLAGS) -o $@ $(IMAGEOBJS) $(DSOLIBS) \
210 -L../cups $(LINKCUPS) -lm
211 $(RM) `basename $@ .2`
212 $(LN) $@ `basename $@ .2`
213
214
215 #
216 # 32bit/libcupsimage.so.2
217 #
218
219 32bit/libcupsimage.so.2: $(IMAGE32OBJS)
220 echo Linking 32-bit $@...
221 -mkdir 32bit
222 $(DSO) $(ARCH32FLAGS) $(DSO32FLAGS) -o $@ $(IMAGE32OBJS) $(DSOLIBS) \
223 -L../cups/32bit $(LINKCUPS) -lm
224
225
226 #
227 # 64bit/libcupsimage.so.2
228 #
229
230 64bit/libcupsimage.so.2: $(IMAGE64OBJS)
231 echo Linking 64-bit $@...
232 -mkdir 64bit
233 $(DSO) $(ARCH64FLAGS) $(DSO64FLAGS) -o $@ $(IMAGE64OBJS) $(DSOLIBS) \
234 -L../cups/64bit $(LINKCUPS) -lm
235
236
237 #
238 # libcupsimage.2.dylib
239 #
240
241 libcupsimage.2.dylib: $(IMAGEOBJS)
242 echo Linking $@...
243 $(DSO) $(ARCHFLAGS) $(DSOFLAGS) -o $@ \
244 -install_name $(libdir)/$@ \
245 -current_version 2.2.0 \
246 -compatibility_version 2.0.0 \
247 $(IMAGEOBJS) $(DSOLIBS) -L../cups $(LINKCUPS) -lm
248 $(RM) libcupsimage.dylib
249 $(LN) $@ libcupsimage.dylib
250
251
252 #
253 # libcupsimage_s.a
254 #
255
256 libcupsimage_s.a: $(IMAGEOBJS) libcupsimage_s.exp
257 echo Linking $@...
258 $(DSO) $(DSOFLAGS) -Wl,-berok,-bexport:libcupsimage_s.exp \
259 -o libcupsimage_s.o $(IMAGEOBJS) $(DSOLIBS) -lm
260 $(RM) $@
261 $(AR) $(ARFLAGS) $@ libcupsimage_s.o
262
263
264 #
265 # libcupsimage.la
266 #
267
268 libcupsimage.la: $(IMAGEOBJS)
269 echo Linking $@...
270 $(DSO) $(ARCHFLAGS) $(DSOFLAGS) -o $@ $(IMAGEOBJS:.o=.lo) $(DSOLIBS) \
271 -L../cups $(LINKCUPS) \
272 -rpath $(LIBDIR) -version-info 2:2
273
274
275 #
276 # libcupsimage.a
277 #
278
279 libcupsimage.a: $(IMAGEOBJS)
280 echo Archiving $@...
281 $(RM) $@
282 $(AR) $(ARFLAGS) $@ $(IMAGEOBJS)
283 $(RANLIB) $@
284
285
286 #
287 # testimage
288 #
289
290 testimage: testimage.o libcupsimage.a ../Makedefs
291 echo Linking $@...
292 $(CC) $(LDFLAGS) -o $@ testimage.o libcupsimage.a \
293 $(IMGLIBS) $(DSOLIBS) $(LIBS)
294
295
296 #
297 # imagetops
298 #
299
300 imagetops: imagetops.o common.o $(LIBCUPSIMAGE) \
301 ../cups/$(LIBCUPS)
302 echo Linking $@...
303 $(CC) $(LDFLAGS) -o $@ imagetops.o common.o $(LINKCUPSIMAGE) \
304 $(IMGLIBS) $(LIBS)
305
306
307 #
308 # imagetoraster
309 #
310
311 imagetoraster: imagetoraster.o common.o $(LIBCUPSIMAGE) \
312 ../cups/$(LIBCUPS)
313 echo Linking $@...
314 $(CC) $(LDFLAGS) -o $@ imagetoraster.o common.o $(LINKCUPSIMAGE) \
315 $(IMGLIBS) $(LIBS)
316
317
318 #
319 # pstops
320 #
321
322 pstops: pstops.o common.o ../cups/$(LIBCUPS)
323 echo Linking $@...
324 $(CC) $(LDFLAGS) -o $@ pstops.o common.o $(LIBS) -lm
325
326
327 #
328 # rastertolabel
329 #
330
331 rastertolabel: rastertolabel.o ../cups/$(LIBCUPS) $(LIBCUPSIMAGE)
332 echo Linking $@...
333 $(CC) $(LDFLAGS) -o $@ rastertolabel.o $(LINKCUPSIMAGE) $(IMGLIBS) $(LIBS)
334
335
336 #
337 # rastertoepson
338 #
339
340 rastertoepson: rastertoepson.o ../cups/$(LIBCUPS) $(LIBCUPSIMAGE)
341 echo Linking $@...
342 $(CC) $(LDFLAGS) -o $@ rastertoepson.o $(LINKCUPSIMAGE) $(IMGLIBS) $(LIBS)
343
344
345 #
346 # rastertohp
347 #
348
349 rastertohp: rastertohp.o ../cups/$(LIBCUPS) $(LIBCUPSIMAGE)
350 echo Linking $@...
351 $(CC) $(LDFLAGS) -o $@ rastertohp.o $(LINKCUPSIMAGE) $(IMGLIBS) $(LIBS)
352
353
354 #
355 # testraster
356 #
357
358 testraster: testraster.o raster.o
359 echo Linking $@...
360 $(CC) $(LDFLAGS) -o $@ testraster.o raster.o
361
362
363 #
364 # rasterbench
365 #
366
367 rasterbench: rasterbench.o raster.o
368 echo Linking $@...
369 $(CC) $(LDFLAGS) -o $@ rasterbench.o raster.o
370
371
372 #
373 # texttops
374 #
375
376 texttops: texttops.o textcommon.o common.o \
377 ../cups/$(LIBCUPS)
378 echo Linking $@...
379 $(CC) $(LDFLAGS) -o $@ texttops.o textcommon.o common.o $(LIBS)
380
381
382 #
383 # Dependencies...
384 #
385
386 include Dependencies
387
388
389 #
390 # End of "$Id$".
391 #