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