4 # Makefile for the CUPS PPD Compiler.
6 # Copyright 2007-2009 by Apple Inc.
7 # Copyright 2002-2006 by Easy Software Products.
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/".
17 # Include standard definitions...
83 # Make library targets...
93 unittests
: $(UNITTARGETS
)
102 $(RM
) *.bak
*.bck core.
*
103 $(RM
) $(TARGETS
) $(UNITTARGETS
)
105 $(RM
) sample.c
test.drv
106 $(RM
) libcupsppdc.so libcupsppdc.sl libcupsppdc.dylib
110 # Update dependencies...
114 makedepend
-Y
-I..
-fDependencies
$(OBJS
:.o
=.
cxx) >/dev
/null
2>&1
118 # Install all targets...
121 install: all install-data install-headers install-libs install-exec
125 # Install data files...
129 $(INSTALL_DIR
) $(DATADIR
)/drv
130 $(INSTALL_DATA
) sample.drv
$(DATADIR
)/drv
134 # Install programs...
138 echo Installing PPD compiler programs...
139 $(INSTALL_DIR
) $(BINDIR
)
140 for file in
$(EXECTARGETS
); do \
141 $(INSTALL_BIN
) $$file $(BINDIR
); \
143 if
test "x$(SYMROOT)" != "x"; then \
144 $(INSTALL_DIR
) $(SYMROOT
); \
145 for file in
$(EXECTARGETS
) $(LIBTARGETS
); do \
146 cp
$$file $(SYMROOT
); \
156 echo Installing header files in
$(INCLUDEDIR
)/cups...
157 $(INSTALL_DIR
) -m
755 $(INCLUDEDIR
)/cups
158 $(INSTALL_DATA
) ppdc.h
$(INCLUDEDIR
)/cups
162 # Install libraries...
165 install-libs
: $(INSTALLSTATIC
)
166 echo Installing libraries in
$(LIBDIR
)...
167 $(INSTALL_DIR
) -m
755 $(LIBDIR
)
168 $(INSTALL_LIB
) $(LIBCUPSPPDC
) $(LIBDIR
)
169 if
test $(LIBCUPSPPDC
) = "libcupsppdc.so.1" -o
$(LIBCUPSPPDC
) = "libcupsppdc.sl.1"; then \
170 $(RM
) $(LIBDIR
)/`basename $(LIBCUPSPPDC) .1`; \
171 $(LN
) $(LIBCUPSPPDC
) $(LIBDIR
)/`basename $(LIBCUPSPPDC) .1`; \
173 if
test $(LIBCUPSPPDC
) = "libcupsppdc.1.dylib"; then \
174 $(RM
) $(LIBDIR
)/libcupsppdc.dylib
; \
175 $(LN
) $(LIBCUPSPPDC
) $(LIBDIR
)/libcupsppdc.dylib
; \
177 if
test "x$(SYMROOT)" != "x"; then \
178 $(INSTALL_DIR
) $(SYMROOT
); \
179 cp
$(LIBCUPSPPDC
) $(SYMROOT
); \
183 $(INSTALL_DIR
) -m
755 $(LIBDIR
)
184 $(INSTALL_LIB
) libcupsppdc.a
$(LIBDIR
)
185 $(RANLIB
) $(LIBDIR
)/libcupsppdc.a
193 for file in
$(EXECTARGETS
); do \
194 $(RM
) $(BINDIR
)/$$file; \
196 $(RM
) $(DATADIR
)/drv
/sample.drv
197 $(RMDIR
) $(DATADIR
)/drv
198 $(RM
) $(LIBDIR
)/libcupsppdc
.1.dylib
199 $(RM
) $(LIBDIR
)/libcupsppdc.a
200 $(RM
) $(LIBDIR
)/libcupsppdc.dylib
201 $(RM
) $(LIBDIR
)/libcupsppdc_s.a
202 $(RM
) $(LIBDIR
)/libcupsppdc.sl
203 $(RM
) $(LIBDIR
)/libcupsppdc.sl
.1
204 $(RM
) $(LIBDIR
)/libcupsppdc.so
205 $(RM
) $(LIBDIR
)/libcupsppdc.so
.1
207 $(RM
) $(INCLUDEDIR
)/cups
/ppdc.h
208 -$(RMDIR
) $(INCLUDEDIR
)/cups
212 # Automatic API help files...
216 mxmldoc
--section
"Programming" \
217 --title
"PPD Compiler API" \
218 --css ..
/doc
/cups-printable.css \
219 --header api-ppdc.header
--intro api-ppdc.shtml \
220 ppdc.h
$(LIBOBJS
:.o
=.
cxx) >..
/doc
/help
/api-ppdc.html
223 mxmldoc
--framed api-ppdc \
224 --section
"Programming" \
225 --title
"PPD Compiler API" \
226 --css ..
/doc
/cups-printable.css \
227 --header api-ppdc.header
--intro api-ppdc.shtml \
228 ppdc.h
$(LIBOBJS
:.o
=.
cxx)
232 # genstrings - generate GNU gettext strings.
235 genstrings
: genstrings.o libcupsppdc.a ..
/cups
/libcups.a \
236 sample.drv ..
/data
/media.defs
238 $(CXX
) $(ARCHFLAGS
) $(LDFLAGS
) -o genstrings genstrings.o \
239 libcupsppdc.a ..
/cups
/libcups.a
$(LIBGSSAPI
) $(SSLLIBS
) \
240 $(DNSSDLIBS
) $(COMMONLIBS
) $(LIBZ
)
241 echo Generating localization strings...
242 .
/genstrings
>sample.c
246 # ppdc, the PPD compiler.
249 ppdc
: ppdc.o
$(LIBCUPSPPDC
) ..
/cups
/$(LIBCUPS
)
251 $(CXX
) $(LDFLAGS
) -o
$@ ppdc.o
-L.
-lcupsppdc
$(LIBS
)
254 ppdc-static
: ppdc.o libcupsppdc.a ..
/cups
/libcups.a foo.drv foo-fr.po
256 $(CXX
) $(ARCHFLAGS
) $(LDFLAGS
) -o ppdc-static ppdc.o libcupsppdc.a \
257 ..
/cups
/libcups.a
$(LIBGSSAPI
) $(SSLLIBS
) $(DNSSDLIBS
) \
258 $(COMMONLIBS
) $(LIBZ
)
259 echo Testing PPD compiler...
260 .
/ppdc-static
-l en
,fr
-I ..
/data foo.drv
261 .
/ppdc-static
-l en
,fr
-z
-I ..
/data foo.drv
265 # ppdhtml, the PPD to HTML utility.
268 ppdhtml
: ppdhtml.o
$(LIBCUPSPPDC
) ..
/cups
/$(LIBCUPS
)
270 $(CXX
) $(LDFLAGS
) -o
$@ ppdhtml.o
-L.
-lcupsppdc
$(LIBS
)
274 # ppdi, import PPD files.
277 ppdi
: ppdi.o
$(LIBCUPSPPDC
) ..
/cups
/$(LIBCUPS
)
279 $(CXX
) $(LDFLAGS
) -o
$@ ppdi.o
-L.
-lcupsppdc
$(LIBS
)
283 # ppdmerge, merge PPD files.
286 ppdmerge
: ppdmerge.o ..
/cups
/$(LIBCUPS
)
288 $(CXX
) $(LDFLAGS
) -o
$@ ppdmerge.o
$(LIBS
)
292 # ppdpo, create message catalog files.
295 ppdpo
: ppdpo.o
$(LIBCUPSPPDC
) ..
/cups
/$(LIBCUPS
)
297 $(CXX
) $(LDFLAGS
) -o
$@ ppdpo.o
-L.
-lcupsppdc
$(LIBS
)
301 # testcatalog, test ppdcCatalog class.
304 testcatalog
: testcatalog.o libcupsppdc.a ..
/cups
/libcups.a
306 $(CXX
) $(LDFLAGS
) -o
$@ testcatalog.o libcupsppdc.a \
307 ..
/cups
/libcups.a
$(LIBGSSAPI
) $(SSLLIBS
) $(DNSSDLIBS
) \
308 $(COMMONLIBS
) $(LIBZ
)
312 # libcupsppdc.so.1, libcupsppdc.sl.1
315 libcupsppdc.so
.1 libcupsppdc.sl
.1: $(LIBOBJS
)
317 $(DSOXX
) $(ARCHFLAGS
) $(DSOFLAGS
) -o
$@
$(LIBOBJS
) $(LIBS
)
318 $(RM
) `basename $@ .1`
319 $(LN
) $@
`basename $@ .1`
323 # libcupsppdc.1.dylib
326 libcupsppdc
.1.dylib
: $(LIBOBJS
)
327 echo Creating
export list for
$@...
328 nm
$(LIBOBJS
) | grep
"T __" | awk
'{print $$3}' |
sort >t.exp
330 $(DSOXX
) $(ARCHFLAGS
) $(DSOFLAGS
) -o
$@ \
331 -install_name
$(libdir)/$@ \
332 -current_version
1.0.0 \
333 -compatibility_version
1.0.0 \
334 -exported_symbols_list t.exp \
336 $(RM
) libcupsppdc.dylib t.exp
337 $(LN
) $@ libcupsppdc.dylib
344 libcupsppdc_s.a
: $(LIBOBJS
)
346 $(DSOXX
) $(DSOFLAGS
) -o libcupsppdc_s.o
$(LIBOBJS
) $(LIBS
)
348 $(AR
) $(ARFLAGS
) $@ libcupsppdc_s.o
355 libcupsppdc.la
: $(LIBOBJS
)
357 $(CC
) $(ARCHFLAGS
) $(DSOFLAGS
) -o
$@
$(LIBOBJS
:.o
=.lo
) -rpath
$(LIBDIR
) \
358 -version-info
1:0 $(LIBS
)
365 libcupsppdc.a
: $(LIBOBJS
)
368 $(AR
) $(ARFLAGS
) $@
$(LIBOBJS
)
373 # Include dependencies...