]> git.ipfire.org Git - thirdparty/cups.git/blob - backend/Makefile
ae08947fb969163ec23fa3e051271b9afdbb8df3
[thirdparty/cups.git] / backend / Makefile
1 #
2 # Backend makefile for CUPS.
3 #
4 # Copyright 2007-2016 by Apple Inc.
5 # Copyright 1997-2007 by Easy Software Products, all rights reserved.
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 # file is 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
16 include ../Makedefs
17
18 #
19 # Object files...
20 #
21
22 # RBACKENDS are installed mode 0700 so cupsd will run them as root...
23 #
24 # UBACKENDS and ULBACKENDS are installed mode 0755 so cupsd will run them as
25 # an unprivileged user...
26 #
27 # See http://www.cups.org/documentation.php/api-filter.html for more info...
28 RBACKENDS = \
29 ipp \
30 lpd \
31 $(DNSSD_BACKEND)
32 UBACKENDS = \
33 snmp \
34 socket
35 ULBACKENDS = \
36 usb
37 UNITTESTS = \
38 test1284 \
39 testbackend \
40 testsupplies
41 TARGETS = \
42 libbackend.a \
43 $(RBACKENDS) \
44 $(UBACKENDS) \
45 $(ULBACKENDS)
46 LIBOBJS = \
47 ieee1284.o \
48 network.o \
49 runloop.o \
50 snmp-supplies.o
51 OBJS = \
52 ipp.o \
53 lpd.o \
54 dnssd.o \
55 snmp.o \
56 socket.o \
57 test1284.o \
58 testbackend.o \
59 testsupplies.o \
60 usb.o
61
62
63 #
64 # Make all targets...
65 #
66
67 all: $(TARGETS)
68
69
70 #
71 # Make library targets...
72 #
73
74 libs: $(ULBACKENDS)
75
76
77 #
78 # Make unit tests...
79 #
80
81 unittests: $(UNITTESTS)
82
83
84 #
85 # Clean all object files...
86 #
87
88 clean:
89 $(RM) $(OBJS) $(TARGETS) $(UNITTESTS) $(LIBOBJS) http https ipps mdns socket-static
90
91
92 #
93 # Update dependencies (without system header dependencies...)
94 #
95
96 depend:
97 $(CC) -MM $(ALL_CFLAGS) $(OBJS:.o=.c) >Dependencies
98
99
100 #
101 # Install all targets...
102 #
103
104 install: all install-data install-headers install-libs install-exec
105
106
107 #
108 # Install data files...
109 #
110
111 install-data:
112 if test "x$(USBQUIRKS)" != x; then \
113 echo Installing USB quirks in $(USBQUIRKS); \
114 $(INSTALL_DIR) -m 755 $(USBQUIRKS); \
115 $(INSTALL_DATA) org.cups.usb-quirks $(USBQUIRKS); \
116 fi
117
118
119 #
120 # Install programs...
121 #
122
123 install-exec: $(INSTALLXPC)
124 echo Installing backends in $(SERVERBIN)/backend
125 $(INSTALL_DIR) -m 755 $(SERVERBIN)/backend
126 for file in $(RBACKENDS); do \
127 $(LIBTOOL) $(INSTALL_BIN) -m 700 $$file $(SERVERBIN)/backend; \
128 done
129 for file in $(UBACKENDS); do \
130 $(INSTALL_BIN) $$file $(SERVERBIN)/backend; \
131 done
132 for file in $(IPPALIASES); do \
133 $(RM) $(SERVERBIN)/backend/$$file; \
134 $(LN) ipp $(SERVERBIN)/backend/$$file; \
135 done
136 if test "x$(DNSSD_BACKEND)" != x -a `uname` = Darwin; then \
137 $(RM) $(SERVERBIN)/backend/mdns; \
138 $(LN) $(DNSSD_BACKEND) $(SERVERBIN)/backend/mdns; \
139 fi
140 if test "x$(SYMROOT)" != "x"; then \
141 $(INSTALL_DIR) $(SYMROOT); \
142 for file in $(RBACKENDS) $(UBACKENDS); do \
143 cp $$file $(SYMROOT); \
144 dsymutil $(SYMROOT)/$$file; \
145 done \
146 fi
147
148 install-xpc: ipp
149 echo Installing XPC backends in $(SERVERBIN)/apple
150 $(INSTALL_DIR) -m 755 $(SERVERBIN)/apple
151 $(LIBTOOL) $(INSTALL_BIN) ipp $(SERVERBIN)/apple
152 for file in $(IPPALIASES); do \
153 $(RM) $(SERVERBIN)/apple/$$file; \
154 $(LN) ipp $(SERVERBIN)/apple/$$file; \
155 done
156
157
158 #
159 # Install headers...
160 #
161
162 install-headers:
163
164
165 #
166 # Install libraries...
167 #
168
169 install-libs:
170 echo Installing backends in $(SERVERBIN)/backend
171 $(INSTALL_DIR) -m 755 $(SERVERBIN)/backend
172 for file in $(ULBACKENDS); do \
173 $(INSTALL_BIN) $$file $(SERVERBIN)/backend; \
174 done
175 if test "x$(SYMROOT)" != "x"; then \
176 $(INSTALL_DIR) $(SYMROOT); \
177 for file in $(ULBACKENDS); do \
178 cp $$file $(SYMROOT); \
179 dsymutil $(SYMROOT)/$$file; \
180 done \
181 fi
182
183
184 #
185 # Uninstall all targets...
186 #
187
188 uninstall:
189 $(RM) $(SERVERBIN)/apple/ipp
190 for file in $(IPPALIASES); do \
191 $(RM) $(SERVERBIN)/apple/$$file; \
192 done
193 -$(RMDIR) $(SERVERBIN)/apple
194 for file in $(RBACKENDS) $(UBACKENDS) $(ULBACKENDS); do \
195 $(RM) $(SERVERBIN)/backend/$$file; \
196 done
197 for file in $(IPPALIASES); do \
198 $(RM) $(SERVERBIN)/backend/$$file; \
199 done
200 -$(RMDIR) $(SERVERBIN)/backend
201 -$(RMDIR) $(SERVERBIN)
202
203
204 #
205 # test1284
206 #
207
208 test1284: test1284.o ../cups/$(LIBCUPSSTATIC)
209 echo Linking $@...
210 $(CC) $(LDFLAGS) -o test1284 test1284.o ../cups/$(LIBCUPSSTATIC) \
211 $(LIBGSSAPI) $(SSLLIBS) $(DNSSDLIBS) $(COMMONLIBS) $(LIBZ)
212
213
214 #
215 # testbackend
216 #
217
218 testbackend: testbackend.o ../cups/$(LIBCUPSSTATIC)
219 echo Linking $@...
220 $(CC) $(LDFLAGS) -o testbackend testbackend.o ../cups/$(LIBCUPSSTATIC) \
221 $(LIBGSSAPI) $(SSLLIBS) $(DNSSDLIBS) $(COMMONLIBS) $(LIBZ)
222
223
224 #
225 # testsupplies
226 #
227
228 testsupplies: testsupplies.o libbackend.a ../cups/$(LIBCUPSSTATIC)
229 echo Linking $@...
230 $(CC) $(LDFLAGS) -o testsupplies testsupplies.o libbackend.a \
231 ../cups/$(LIBCUPSSTATIC) $(LIBGSSAPI) $(SSLLIBS) $(DNSSDLIBS) \
232 $(COMMONLIBS) $(LIBZ)
233
234
235 #
236 # libbackend.a
237 #
238
239 libbackend.a: $(LIBOBJS)
240 echo Archiving $@...
241 $(RM) $@
242 $(AR) $(ARFLAGS) $@ $(LIBOBJS)
243 $(RANLIB) $@
244
245
246 #
247 # dnssd
248 #
249
250 dnssd: dnssd.o ../cups/$(LIBCUPS) libbackend.a
251 echo Linking $@...
252 $(CC) $(LDFLAGS) -o dnssd dnssd.o libbackend.a $(LIBS)
253 if test `uname` = Darwin; then \
254 $(RM) mdns; \
255 $(LN) dnssd mdns; \
256 fi
257
258
259 #
260 # ipp
261 #
262
263 ipp: ipp.o ../cups/$(LIBCUPS) libbackend.a
264 echo Linking $@...
265 $(CC) $(LDFLAGS) -o ipp ipp.o libbackend.a $(LIBS)
266 $(RM) http
267 $(LN) ipp http
268
269
270 #
271 # lpd
272 #
273
274 lpd: lpd.o ../cups/$(LIBCUPS) libbackend.a
275 echo Linking $@...
276 $(CC) $(LDFLAGS) -o lpd lpd.o libbackend.a $(LIBS)
277
278
279 #
280 # snmp
281 #
282
283 snmp: snmp.o ../cups/$(LIBCUPS) libbackend.a
284 echo Linking $@...
285 $(CC) $(LDFLAGS) -o snmp snmp.o libbackend.a $(LIBS)
286
287
288 #
289 # socket
290 #
291
292 socket: socket.o ../cups/$(LIBCUPS) libbackend.a
293 echo Linking $@...
294 $(CC) $(LDFLAGS) -o socket socket.o libbackend.a $(LIBS)
295
296 socket-static: socket.o ../cups/$(LIBCUPSSTATIC) libbackend.a
297 echo Linking $@...
298 $(CC) $(LDFLAGS) -o socket-static socket.o libbackend.a \
299 ../cups/$(LIBCUPSSTATIC) $(LIBGSSAPI) $(SSLLIBS) $(DNSSDLIBS) \
300 $(COMMONLIBS) $(LIBZ)
301
302
303 #
304 # usb
305 #
306
307 usb: usb.o ../cups/$(LIBCUPS) libbackend.a
308 echo Linking $@...
309 $(CC) $(ARCHFLAGS) $(LDFLAGS) -o usb usb.o libbackend.a $(LIBUSB) \
310 $(BACKLIBS) $(LIBS)
311 usb.o: usb.c usb-darwin.c usb-libusb.c usb-unix.c
312
313
314 #
315 # Dependencies...
316 #
317
318 include Dependencies