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