1#
2# Filter makefile for CUPS.
3#
4# Copyright © 2007-2019 by Apple Inc.
5# Copyright © 1997-2006 by Easy Software Products.
6#
7# Licensed under Apache License v2.0.  See the file "LICENSE" for more
8# information.
9#
10
11include ../Makedefs
12
13
14TARGETS	=	\
15		commandtops \
16		gziptoany \
17		pstops \
18		rastertoepson \
19		rastertohp \
20		rastertolabel \
21		rastertopwg
22
23OBJS	=	commandtops.o gziptoany.o common.o pstops.o \
24		rastertoepson.o rastertohp.o rastertolabel.o \
25		rastertopwg.o
26
27
28#
29# Make all targets...
30#
31
32all:	$(TARGETS)
33
34
35#
36# Make library targets...
37#
38
39libs:
40
41
42#
43# Make unit tests...
44#
45
46unittests:
47
48
49#
50# Clean all object files...
51#
52
53clean:
54	$(RM) $(OBJS) $(TARGETS)
55
56
57#
58# Update dependencies (without system header dependencies...)
59#
60
61depend:
62	$(CC) -MM $(ALL_CFLAGS) $(OBJS:.o=.c) >Dependencies
63
64
65#
66# Install all targets...
67#
68
69install:	all install-data install-headers install-libs install-exec
70
71
72#
73# Install data files...
74#
75
76install-data:
77
78
79#
80# Install programs...
81#
82
83install-exec:
84	$(INSTALL_DIR) -m 755 $(SERVERBIN)/filter
85	for file in $(TARGETS); do \
86		$(INSTALL_BIN) $$file $(SERVERBIN)/filter; \
87	done
88	if test "x$(SYMROOT)" != "x"; then \
89		$(INSTALL_DIR) $(SYMROOT); \
90		for file in $(TARGETS); do \
91			cp $$file $(SYMROOT); \
92			dsymutil $(SYMROOT)/$$file; \
93		done \
94	fi
95
96
97#
98# Install headers...
99#
100
101install-headers:
102
103
104#
105# Install libraries...
106#
107
108install-libs:
109
110
111#
112# Uninstall all targets...
113#
114
115uninstall:
116	for file in $(TARGETS); do \
117		$(RM) $(SERVERBIN)/filter/$$file; \
118	done
119	-$(RMDIR) $(SERVERBIN)/filter
120	-$(RMDIR) $(SERVERBIN)
121
122
123#
124# Automatic API help files...
125#
126
127apihelp:
128	echo Generating CUPS API help files...
129	codedoc --section "Programming" \
130		--title "Developing PostScript Printer Drivers" \
131		--css ../doc/cups-printable.css \
132		--header postscript-driver.header \
133		--body postscript-driver.shtml \
134		>../doc/help/postscript-driver.html
135	codedoc --section "Programming" \
136		--title "Introduction to the PPD Compiler" \
137		--css ../doc/cups-printable.css \
138		--header ppd-compiler.header \
139		--body ppd-compiler.shtml \
140		>../doc/help/ppd-compiler.html
141	codedoc --section "Programming" \
142		--title "Developing Raster Printer Drivers" \
143		--css ../doc/cups-printable.css \
144		--header raster-driver.header \
145		--body raster-driver.shtml \
146		>../doc/help/raster-driver.html
147	codedoc --section "Specifications" \
148		--title "CUPS PPD Extensions" \
149		--css ../doc/cups-printable.css \
150		--header spec-ppd.header \
151		--body spec-ppd.shtml \
152		>../doc/help/spec-ppd.html
153
154
155#
156# commandtops
157#
158
159commandtops:	commandtops.o ../cups/$(LIBCUPS)
160	echo Linking $@...
161	$(LD_CC) $(ALL_LDFLAGS) -o $@ commandtops.o $(LINKCUPS)
162	$(CODE_SIGN) -s "$(CODE_SIGN_IDENTITY)" $@
163
164
165#
166# gziptoany
167#
168
169gziptoany:	gziptoany.o ../Makedefs ../cups/$(LIBCUPS)
170	echo Linking $@...
171	$(LD_CC) $(ALL_LDFLAGS) -o $@ gziptoany.o $(LINKCUPS)
172	$(CODE_SIGN) -s "$(CODE_SIGN_IDENTITY)" $@
173
174
175#
176# pstops
177#
178
179pstops:	pstops.o common.o ../cups/$(LIBCUPS)
180	echo Linking $@...
181	$(LD_CC) $(ALL_LDFLAGS) -o $@ pstops.o common.o $(LINKCUPS)
182	$(CODE_SIGN) -s "$(CODE_SIGN_IDENTITY)" $@
183
184
185#
186# rastertoepson
187#
188
189rastertoepson:	rastertoepson.o ../cups/$(LIBCUPS)
190	echo Linking $@...
191	$(LD_CC) $(ALL_LDFLAGS) -o $@ rastertoepson.o $(LINKCUPS)
192	$(CODE_SIGN) -s "$(CODE_SIGN_IDENTITY)" $@
193
194
195#
196# rastertohp
197#
198
199rastertohp:	rastertohp.o ../cups/$(LIBCUPS)
200	echo Linking $@...
201	$(LD_CC) $(ALL_LDFLAGS) -o $@ rastertohp.o $(LINKCUPS)
202	$(CODE_SIGN) -s "$(CODE_SIGN_IDENTITY)" $@
203
204
205#
206# rastertolabel
207#
208
209rastertolabel:	rastertolabel.o ../cups/$(LIBCUPS)
210	echo Linking $@...
211	$(LD_CC) $(ALL_LDFLAGS) -o $@ rastertolabel.o $(LINKCUPS)
212	$(CODE_SIGN) -s "$(CODE_SIGN_IDENTITY)" $@
213
214
215#
216# rastertopwg
217#
218
219rastertopwg:	rastertopwg.o ../cups/$(LIBCUPS)
220	echo Linking $@...
221	$(LD_CC) $(ALL_LDFLAGS) -o $@ rastertopwg.o $(LINKCUPS)
222	$(CODE_SIGN) -s "$(CODE_SIGN_IDENTITY)" $@
223
224rastertopwg-static:	rastertopwg.o ../cups/$(LIBCUPSSTATIC)
225	echo Linking $@...
226	$(LD_CC) $(ALL_LDFLAGS) -o $@ rastertopwg.o $(LINKCUPSSTATIC)
227	$(CODE_SIGN) -s "$(CODE_SIGN_IDENTITY)" $@
228
229
230#
231# Dependencies...
232#
233
234include Dependencies
235