]>
Commit | Line | Data |
---|---|---|
ef416fc2 | 1 | # |
503b54c9 | 2 | # Backend makefile for CUPS. |
ef416fc2 | 3 | # |
a621d151 | 4 | # Copyright 2007-2017 by Apple Inc. |
503b54c9 | 5 | # Copyright 1997-2007 by Easy Software Products, all rights reserved. |
ef416fc2 | 6 | # |
503b54c9 MS |
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 | |
57b7b66b | 11 | # missing or damaged, see the license at "http://www.cups.org/". |
ef416fc2 | 12 | # |
503b54c9 | 13 | # This file is subject to the Apple OS-Developed Software exception. |
ef416fc2 | 14 | # |
15 | ||
16 | include ../Makedefs | |
17 | ||
f8b3a85b MS |
18 | # |
19 | # Object files... | |
20 | # | |
21 | ||
f3c17241 MS |
22 | # RBACKENDS are installed mode 0700 so cupsd will run them as root... |
23 | # | |
38a68cfb MS |
24 | # UBACKENDS and ULBACKENDS are installed mode 0755 so cupsd will run them as |
25 | # an unprivileged user... | |
f3c17241 | 26 | # |
a621d151 | 27 | # See http://www.cups.org/doc/api-filter.html for more info... |
a4845881 MS |
28 | RBACKENDS = \ |
29 | ipp \ | |
30 | lpd \ | |
31 | $(DNSSD_BACKEND) | |
32 | UBACKENDS = \ | |
33 | snmp \ | |
38a68cfb MS |
34 | socket |
35 | ULBACKENDS = \ | |
a4845881 MS |
36 | usb |
37 | UNITTESTS = \ | |
38 | test1284 \ | |
39 | testbackend \ | |
40 | testsupplies | |
41 | TARGETS = \ | |
42 | libbackend.a \ | |
43 | $(RBACKENDS) \ | |
38a68cfb MS |
44 | $(UBACKENDS) \ |
45 | $(ULBACKENDS) | |
a4845881 MS |
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 | |
ef416fc2 | 61 | |
62 | ||
63 | # | |
64 | # Make all targets... | |
65 | # | |
66 | ||
67 | all: $(TARGETS) | |
68 | ||
69 | ||
c9fc04c6 MS |
70 | # |
71 | # Make library targets... | |
72 | # | |
73 | ||
38a68cfb | 74 | libs: $(ULBACKENDS) |
c9fc04c6 MS |
75 | |
76 | ||
5f64df29 MS |
77 | # |
78 | # Make unit tests... | |
79 | # | |
80 | ||
1340db2d | 81 | unittests: $(UNITTESTS) |
5f64df29 MS |
82 | |
83 | ||
ef416fc2 | 84 | # |
85 | # Clean all object files... | |
86 | # | |
87 | ||
88 | clean: | |
6fb588e0 | 89 | $(RM) $(OBJS) $(TARGETS) $(UNITTESTS) $(LIBOBJS) http https ipps mdns socket-static |
ef416fc2 | 90 | |
91 | ||
92 | # | |
93 | # Update dependencies (without system header dependencies...) | |
94 | # | |
95 | ||
96 | depend: | |
12f89d24 | 97 | $(CC) -MM $(ALL_CFLAGS) $(OBJS:.o=.c) >Dependencies |
ef416fc2 | 98 | |
99 | ||
100 | # | |
101 | # Install all targets... | |
102 | # | |
103 | ||
50fe7201 MS |
104 | install: all install-data install-headers install-libs install-exec |
105 | ||
106 | ||
107 | # | |
108 | # Install data files... | |
109 | # | |
110 | ||
111 | install-data: | |
89a65306 MS |
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 | |
50fe7201 MS |
117 | |
118 | ||
119 | # | |
120 | # Install programs... | |
121 | # | |
122 | ||
eac3a0a0 MS |
123 | install-exec: $(INSTALLXPC) |
124 | echo Installing backends in $(SERVERBIN)/backend | |
bd7854cb | 125 | $(INSTALL_DIR) -m 755 $(SERVERBIN)/backend |
e00b005a | 126 | for file in $(RBACKENDS); do \ |
839a51c8 | 127 | $(LIBTOOL) $(INSTALL_BIN) -m 700 $$file $(SERVERBIN)/backend; \ |
e00b005a | 128 | done |
129 | for file in $(UBACKENDS); do \ | |
ef416fc2 | 130 | $(INSTALL_BIN) $$file $(SERVERBIN)/backend; \ |
131 | done | |
eac3a0a0 MS |
132 | for file in $(IPPALIASES); do \ |
133 | $(RM) $(SERVERBIN)/backend/$$file; \ | |
134 | $(LN) ipp $(SERVERBIN)/backend/$$file; \ | |
135 | done | |
37e7e6e0 | 136 | if test "x$(DNSSD_BACKEND)" != x -a `uname` = Darwin; then \ |
49d87452 MS |
137 | $(RM) $(SERVERBIN)/backend/mdns; \ |
138 | $(LN) $(DNSSD_BACKEND) $(SERVERBIN)/backend/mdns; \ | |
139 | fi | |
09a101d6 | 140 | if test "x$(SYMROOT)" != "x"; then \ |
141 | $(INSTALL_DIR) $(SYMROOT); \ | |
c1420c87 | 142 | for file in $(RBACKENDS) $(UBACKENDS); do \ |
09a101d6 | 143 | cp $$file $(SYMROOT); \ |
c1420c87 | 144 | dsymutil $(SYMROOT)/$$file; \ |
09a101d6 | 145 | done \ |
146 | fi | |
ef416fc2 | 147 | |
eac3a0a0 MS |
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 | ||
ef416fc2 | 157 | |
50fe7201 MS |
158 | # |
159 | # Install headers... | |
160 | # | |
161 | ||
162 | install-headers: | |
163 | ||
164 | ||
165 | # | |
166 | # Install libraries... | |
167 | # | |
168 | ||
169 | install-libs: | |
38a68cfb MS |
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 | |
50fe7201 MS |
182 | |
183 | ||
757d2cad | 184 | # |
185 | # Uninstall all targets... | |
186 | # | |
187 | ||
188 | uninstall: | |
eac3a0a0 MS |
189 | $(RM) $(SERVERBIN)/apple/ipp |
190 | for file in $(IPPALIASES); do \ | |
191 | $(RM) $(SERVERBIN)/apple/$$file; \ | |
192 | done | |
193 | -$(RMDIR) $(SERVERBIN)/apple | |
38a68cfb | 194 | for file in $(RBACKENDS) $(UBACKENDS) $(ULBACKENDS); do \ |
757d2cad | 195 | $(RM) $(SERVERBIN)/backend/$$file; \ |
196 | done | |
eac3a0a0 MS |
197 | for file in $(IPPALIASES); do \ |
198 | $(RM) $(SERVERBIN)/backend/$$file; \ | |
199 | done | |
757d2cad | 200 | -$(RMDIR) $(SERVERBIN)/backend |
201 | -$(RMDIR) $(SERVERBIN) | |
202 | ||
203 | ||
ef416fc2 | 204 | # |
568fa3fa | 205 | # test1284 |
ef416fc2 | 206 | # |
207 | ||
f8b3a85b | 208 | test1284: test1284.o ../cups/$(LIBCUPSSTATIC) |
ef416fc2 | 209 | echo Linking $@... |
a621d151 MS |
210 | $(LD_CC) $(LDFLAGS) -o test1284 test1284.o ../cups/$(LIBCUPSSTATIC) \ |
211 | $(LIBGSSAPI) $(SSLLIBS) $(DNSSDLIBS) $(LD_COMMONLIBS) $(LIBZ) | |
ef416fc2 | 212 | |
213 | ||
214 | # | |
568fa3fa | 215 | # testbackend |
ef416fc2 | 216 | # |
217 | ||
f8b3a85b | 218 | testbackend: testbackend.o ../cups/$(LIBCUPSSTATIC) |
ef416fc2 | 219 | echo Linking $@... |
a621d151 MS |
220 | $(LD_CC) $(LDFLAGS) -o testbackend testbackend.o ../cups/$(LIBCUPSSTATIC) \ |
221 | $(LIBGSSAPI) $(SSLLIBS) $(DNSSDLIBS) $(LD_COMMONLIBS) $(LIBZ) | |
ef416fc2 | 222 | |
223 | ||
568fa3fa MS |
224 | # |
225 | # testsupplies | |
226 | # | |
227 | ||
f8b3a85b | 228 | testsupplies: testsupplies.o libbackend.a ../cups/$(LIBCUPSSTATIC) |
568fa3fa | 229 | echo Linking $@... |
a621d151 | 230 | $(LD_CC) $(LDFLAGS) -o testsupplies testsupplies.o libbackend.a \ |
f8b3a85b | 231 | ../cups/$(LIBCUPSSTATIC) $(LIBGSSAPI) $(SSLLIBS) $(DNSSDLIBS) \ |
a621d151 | 232 | $(LD_COMMONLIBS) $(LIBZ) |
568fa3fa MS |
233 | |
234 | ||
ed486911 | 235 | # |
236 | # libbackend.a | |
237 | # | |
238 | ||
239 | libbackend.a: $(LIBOBJS) | |
240 | echo Archiving $@... | |
241 | $(RM) $@ | |
242 | $(AR) $(ARFLAGS) $@ $(LIBOBJS) | |
243 | $(RANLIB) $@ | |
244 | ||
245 | ||
c5571a1d MS |
246 | # |
247 | # dnssd | |
248 | # | |
249 | ||
250 | dnssd: dnssd.o ../cups/$(LIBCUPS) libbackend.a | |
251 | echo Linking $@... | |
a621d151 | 252 | $(LD_CC) $(LDFLAGS) -o dnssd dnssd.o libbackend.a $(LIBS) |
37e7e6e0 MS |
253 | if test `uname` = Darwin; then \ |
254 | $(RM) mdns; \ | |
255 | $(LN) dnssd mdns; \ | |
256 | fi | |
c5571a1d MS |
257 | |
258 | ||
ef416fc2 | 259 | # |
260 | # ipp | |
261 | # | |
262 | ||
7a14d768 | 263 | ipp: ipp.o ../cups/$(LIBCUPS) libbackend.a |
ef416fc2 | 264 | echo Linking $@... |
a621d151 | 265 | $(LD_CC) $(LDFLAGS) -o ipp ipp.o libbackend.a $(LIBS) |
ef416fc2 | 266 | $(RM) http |
267 | $(LN) ipp http | |
268 | ||
269 | ||
270 | # | |
271 | # lpd | |
272 | # | |
273 | ||
7a14d768 | 274 | lpd: lpd.o ../cups/$(LIBCUPS) libbackend.a |
ef416fc2 | 275 | echo Linking $@... |
a621d151 | 276 | $(LD_CC) $(LDFLAGS) -o lpd lpd.o libbackend.a $(LIBS) |
7a14d768 MS |
277 | |
278 | ||
89d46774 | 279 | # |
280 | # snmp | |
281 | # | |
282 | ||
ed486911 | 283 | snmp: snmp.o ../cups/$(LIBCUPS) libbackend.a |
89d46774 | 284 | echo Linking $@... |
a621d151 | 285 | $(LD_CC) $(LDFLAGS) -o snmp snmp.o libbackend.a $(LIBS) |
89d46774 | 286 | |
287 | ||
ef416fc2 | 288 | # |
289 | # socket | |
290 | # | |
291 | ||
ed486911 | 292 | socket: socket.o ../cups/$(LIBCUPS) libbackend.a |
ef416fc2 | 293 | echo Linking $@... |
a621d151 | 294 | $(LD_CC) $(LDFLAGS) -o socket socket.o libbackend.a $(LIBS) |
ef416fc2 | 295 | |
6fb588e0 MS |
296 | socket-static: socket.o ../cups/$(LIBCUPSSTATIC) libbackend.a |
297 | echo Linking $@... | |
a621d151 | 298 | $(LD_CC) $(LDFLAGS) -o socket-static socket.o libbackend.a \ |
6fb588e0 | 299 | ../cups/$(LIBCUPSSTATIC) $(LIBGSSAPI) $(SSLLIBS) $(DNSSDLIBS) \ |
a621d151 | 300 | $(LD_COMMONLIBS) $(LIBZ) |
6fb588e0 | 301 | |
ef416fc2 | 302 | |
303 | # | |
304 | # usb | |
305 | # | |
306 | ||
ed486911 | 307 | usb: usb.o ../cups/$(LIBCUPS) libbackend.a |
ef416fc2 | 308 | echo Linking $@... |
a621d151 | 309 | $(LD_CC) $(ARCHFLAGS) $(LDFLAGS) -o usb usb.o libbackend.a $(LIBUSB) \ |
9a4f8274 | 310 | $(BACKLIBS) $(LIBS) |
75bd9771 | 311 | usb.o: usb.c usb-darwin.c usb-libusb.c usb-unix.c |
ef416fc2 | 312 | |
313 | ||
314 | # | |
315 | # Dependencies... | |
316 | # | |
317 | ||
318 | include Dependencies |