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