2 # Filter makefile for CUPS.
4 # Copyright 2007-2012 by Apple Inc.
5 # Copyright 1997-2006 by Easy Software Products.
7 # These coded instructions, statements, and computer programs are the
8 # property of Apple Inc. and are protected by Federal copyright
9 # law. Distribution and use rights are outlined in the file "LICENSE.txt"
10 # which should have been included with this file. If this file is
11 # file is missing or damaged, see the license at "http://www.cups.org/".
13 # This file is subject to the Apple OS-Developed Software exception.
37 IMAGEOBJS
= error.o interpret.o raster.o
39 commandtops.o gziptoany.o common.o pstops.o \
40 rasterbench.o rastertoepson.o rastertohp.o rastertolabel.o \
41 rastertopwg.o testraster.o
52 # Make library targets...
62 unittests
: $(UNITTARGETS
)
66 # Clean all object files...
70 $(RM
) $(OBJS
) $(TARGETS
) $(UNITTARGETS
)
71 $(RM
) libcupsimage.so libcupsimage.sl libcupsimage.dylib
75 # Update dependencies (without system header dependencies...)
79 $(CC
) -MM
$(ALL_CFLAGS
) $(OBJS
:.o
=.c
) >Dependencies
83 # Install all targets...
86 install: all install-data install-headers install-libs install-exec
90 # Install data files...
101 $(INSTALL_DIR
) -m
755 $(SERVERBIN
)/filter
102 for file in
$(FILTERS
); do \
103 $(INSTALL_BIN
) $$file $(SERVERBIN
)/filter; \
105 $(RM
) $(SERVERBIN
)/filter/rastertodymo
106 $(LN
) rastertolabel
$(SERVERBIN
)/filter/rastertodymo
107 if
test "x$(SYMROOT)" != "x"; then \
108 $(INSTALL_DIR
) $(SYMROOT
); \
109 for file in
$(FILTERS
); do \
110 cp
$$file $(SYMROOT
); \
111 dsymutil
$(SYMROOT
)/$$file; \
124 # Install libraries...
127 install-libs
: $(INSTALLSTATIC
)
128 $(INSTALL_DIR
) -m
755 $(LIBDIR
)
129 $(INSTALL_LIB
) $(LIBCUPSIMAGE
) $(LIBDIR
)
130 -if
test $(LIBCUPSIMAGE
) = "libcupsimage.so.2" -o
$(LIBCUPSIMAGE
) = "libcupsimage.sl.2"; then \
131 $(RM
) $(LIBDIR
)/`basename $(LIBCUPSIMAGE) .2`; \
132 $(LN
) $(LIBCUPSIMAGE
) $(LIBDIR
)/`basename $(LIBCUPSIMAGE) .2`; \
134 -if
test $(LIBCUPSIMAGE
) = "libcupsimage.2.dylib"; then \
135 $(RM
) $(LIBDIR
)/libcupsimage.dylib
; \
136 $(LN
) $(LIBCUPSIMAGE
) $(LIBDIR
)/libcupsimage.dylib
; \
138 if
test "x$(SYMROOT)" != "x"; then \
139 $(INSTALL_DIR
) $(SYMROOT
); \
140 cp
$(LIBCUPSIMAGE
) $(SYMROOT
); \
141 dsymutil
$(SYMROOT
)/$(LIBCUPSIMAGE
); \
145 $(INSTALL_DIR
) -m
755 $(LIBDIR
)
146 $(INSTALL_LIB
) -m
755 libcupsimage.a
$(LIBDIR
)
147 $(RANLIB
) $(LIBDIR
)/libcupsimage.a
148 $(CHMOD
) 555 $(LIBDIR
)/libcupsimage.a
152 # Uninstall all targets...
156 for file in
$(FILTERS
); do \
157 $(RM
) $(SERVERBIN
)/filter/$$file; \
159 $(RM
) $(SERVERBIN
)/filter/rastertodymo
160 -$(RMDIR
) $(SERVERBIN
)/filter
161 -$(RMDIR
) $(SERVERBIN
)
162 $(RM
) $(LIBDIR
)/libcupsimage
.2.dylib
163 $(RM
) $(LIBDIR
)/libcupsimage.a
164 $(RM
) $(LIBDIR
)/libcupsimage.dylib
165 $(RM
) $(LIBDIR
)/libcupsimage_s.a
166 $(RM
) $(LIBDIR
)/libcupsimage.sl
167 $(RM
) $(LIBDIR
)/libcupsimage.sl
.2
168 $(RM
) $(LIBDIR
)/libcupsimage.so
169 $(RM
) $(LIBDIR
)/libcupsimage.so
.2
174 # Automatic API help files...
178 echo Generating CUPS API help files...
179 mxmldoc
--section
"Programming" --title
"Raster API" \
180 --css ..
/doc
/cups-printable.css \
181 --header api-raster.header
--intro api-raster.shtml \
183 ..
/cups
/raster.h interpret.c raster.c \
184 >..
/doc
/help
/api-raster.html
185 mxmldoc
--tokens help
/api-raster.html api-raster.xml
>..
/doc
/help
/api-raster.tokens
187 mxmldoc
--section
"Programming" \
188 --title
"Developing PostScript Printer Drivers" \
189 --css ..
/doc
/cups-printable.css \
190 --header postscript-driver.header \
191 --intro postscript-driver.shtml \
192 >..
/doc
/help
/postscript-driver.html
193 mxmldoc
--section
"Programming" \
194 --title
"Introduction to the PPD Compiler" \
195 --css ..
/doc
/cups-printable.css \
196 --header ppd-compiler.header \
197 --intro ppd-compiler.shtml \
198 >..
/doc
/help
/ppd-compiler.html
199 mxmldoc
--section
"Programming" \
200 --title
"Developing Raster Printer Drivers" \
201 --css ..
/doc
/cups-printable.css \
202 --header raster-driver.header \
203 --intro raster-driver.shtml \
204 >..
/doc
/help
/raster-driver.html
205 mxmldoc
--section
"Specifications" \
206 --title
"CUPS PPD Extensions" \
207 --css ..
/doc
/cups-printable.css \
208 --header spec-ppd.header \
209 --intro spec-ppd.shtml \
210 >..
/doc
/help
/spec-ppd.html
217 commandtops
: commandtops.o ..
/cups
/$(LIBCUPS
)
219 $(CC
) $(LDFLAGS
) -o
$@ commandtops.o
$(LIBS
)
226 gziptoany
: gziptoany.o ..
/Makedefs ..
/cups
/$(LIBCUPS
)
228 $(CC
) $(LDFLAGS
) -o
$@ gziptoany.o
$(LIBZ
) $(LIBS
)
232 # libcupsimage.so.2, libcupsimage.sl.2
235 libcupsimage.so
.2 libcupsimage.sl
.2: $(IMAGEOBJS
)
237 $(DSO
) $(ARCHFLAGS
) $(DSOFLAGS
) -o
$@
$(IMAGEOBJS
) $(DSOLIBS
) \
238 -L..
/cups
$(LINKCUPS
)
239 $(RM
) `basename $@ .2`
240 $(LN
) $@
`basename $@ .2`
244 # libcupsimage.2.dylib
247 libcupsimage
.2.dylib
: $(IMAGEOBJS
) $(LIBCUPSIMAGEORDER
)
249 $(DSO
) $(ARCHFLAGS
) $(DSOFLAGS
) -o
$@ \
250 -install_name
$(libdir)/$@ \
251 -current_version
2.3.0 \
252 -compatibility_version
2.0.0 \
253 $(IMAGEOBJS
) $(DSOLIBS
) -L..
/cups
$(LINKCUPS
)
254 $(RM
) libcupsimage.dylib
255 $(LN
) $@ libcupsimage.dylib
262 libcupsimage_s.a
: $(IMAGEOBJS
) libcupsimage_s.exp
264 $(DSO
) $(DSOFLAGS
) -Wl
,-berok
,-bexport
:libcupsimage_s.exp \
265 -o libcupsimage_s.o
$(IMAGEOBJS
) $(DSOLIBS
)
267 $(AR
) $(ARFLAGS
) $@ libcupsimage_s.o
274 libcupsimage.la
: $(IMAGEOBJS
)
276 $(DSO
) $(ARCHFLAGS
) $(DSOFLAGS
) -o
$@
$(IMAGEOBJS
:.o
=.lo
) $(DSOLIBS
) \
277 -L..
/cups
$(LINKCUPS
) \
278 -rpath
$(LIBDIR
) -version-info
2:3
285 libcupsimage.a
: $(IMAGEOBJS
)
288 $(AR
) $(ARFLAGS
) $@
$(IMAGEOBJS
)
296 pstops
: pstops.o common.o ..
/cups
/$(LIBCUPS
)
298 $(CC
) $(LDFLAGS
) -o
$@ pstops.o common.o
$(LIBS
)
305 rastertoepson
: rastertoepson.o ..
/cups
/$(LIBCUPS
) $(LIBCUPSIMAGE
)
307 $(CC
) $(LDFLAGS
) -o
$@ rastertoepson.o
$(LINKCUPSIMAGE
) $(IMGLIBS
) $(LIBS
)
314 rastertohp
: rastertohp.o ..
/cups
/$(LIBCUPS
) $(LIBCUPSIMAGE
)
316 $(CC
) $(LDFLAGS
) -o
$@ rastertohp.o
$(LINKCUPSIMAGE
) $(IMGLIBS
) $(LIBS
)
323 rastertolabel
: rastertolabel.o ..
/cups
/$(LIBCUPS
) $(LIBCUPSIMAGE
)
325 $(CC
) $(LDFLAGS
) -o
$@ rastertolabel.o
$(LINKCUPSIMAGE
) $(IMGLIBS
) $(LIBS
)
332 rastertopwg
: rastertopwg.o ..
/cups
/$(LIBCUPS
) $(LIBCUPSIMAGE
)
334 $(CC
) $(LDFLAGS
) -o
$@ rastertopwg.o
$(LINKCUPSIMAGE
) $(IMGLIBS
) $(LIBS
)
336 rastertopwg-static
: rastertopwg.o ..
/cups
/$(LIBCUPSSTATIC
) libcupsimage.a
338 $(CC
) $(LDFLAGS
) -o
$@ rastertopwg.o libcupsimage.a \
339 ..
/cups
/$(LIBCUPSSTATIC
) $(IMGLIBS
) $(DSOLIBS
) $(COMMONLIBS
) \
340 $(SSLLIBS
) $(DNSSDLIBS
) $(LIBGSSAPI
)
347 testraster
: testraster.o ..
/cups
/$(LIBCUPSSTATIC
) libcupsimage.a
349 $(CC
) $(ARCHFLAGS
) $(LDFLAGS
) -o
$@ testraster.o libcupsimage.a \
350 ..
/cups
/$(LIBCUPSSTATIC
) $(IMGLIBS
) $(DSOLIBS
) $(COMMONLIBS
) \
351 $(SSLLIBS
) $(DNSSDLIBS
) $(LIBGSSAPI
)
352 echo Running raster API tests...
360 rasterbench
: rasterbench.o libcupsimage.a
362 $(CC
) $(LDFLAGS
) -o
$@ rasterbench.o libcupsimage.a
$(LIBS
)