]>
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 | 210 | $(LD_CC) $(LDFLAGS) -o test1284 test1284.o ../cups/$(LIBCUPSSTATIC) \ |
b94f7488 | 211 | $(LIBGSSAPI) $(SSLLIBS) $(DNSSDLIBS) $(COMMONLIBS) $(LIBZ) |
ef416fc2 | 212 | |
213 | ||
214 | # | |
568fa3fa | 215 | # testbackend |
ef416fc2 | 216 | # |
217 | ||
f8b3a85b | 218 | testbackend: testbackend.o ../cups/$(LIBCUPSSTATIC) |
ef416fc2 | 219 | echo Linking $@... |
a621d151 | 220 | $(LD_CC) $(LDFLAGS) -o testbackend testbackend.o ../cups/$(LIBCUPSSTATIC) \ |
b94f7488 | 221 | $(LIBGSSAPI) $(SSLLIBS) $(DNSSDLIBS) $(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) \ |
b94f7488 | 232 | $(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) |
1c37b4f8 | 253 | $(CODE_SIGN) -s "$(CODE_SIGN_IDENTITY)" $@ |
37e7e6e0 MS |
254 | if test `uname` = Darwin; then \ |
255 | $(RM) mdns; \ | |
256 | $(LN) dnssd mdns; \ | |
257 | fi | |
c5571a1d MS |
258 | |
259 | ||
ef416fc2 | 260 | # |
261 | # ipp | |
262 | # | |
263 | ||
7a14d768 | 264 | ipp: ipp.o ../cups/$(LIBCUPS) libbackend.a |
ef416fc2 | 265 | echo Linking $@... |
a621d151 | 266 | $(LD_CC) $(LDFLAGS) -o ipp ipp.o libbackend.a $(LIBS) |
1c37b4f8 | 267 | $(CODE_SIGN) -s "$(CODE_SIGN_IDENTITY)" $@ |
ef416fc2 | 268 | $(RM) http |
269 | $(LN) ipp http | |
270 | ||
271 | ||
272 | # | |
273 | # lpd | |
274 | # | |
275 | ||
7a14d768 | 276 | lpd: lpd.o ../cups/$(LIBCUPS) libbackend.a |
ef416fc2 | 277 | echo Linking $@... |
a621d151 | 278 | $(LD_CC) $(LDFLAGS) -o lpd lpd.o libbackend.a $(LIBS) |
1c37b4f8 | 279 | $(CODE_SIGN) -s "$(CODE_SIGN_IDENTITY)" $@ |
7a14d768 MS |
280 | |
281 | ||
89d46774 | 282 | # |
283 | # snmp | |
284 | # | |
285 | ||
ed486911 | 286 | snmp: snmp.o ../cups/$(LIBCUPS) libbackend.a |
89d46774 | 287 | echo Linking $@... |
a621d151 | 288 | $(LD_CC) $(LDFLAGS) -o snmp snmp.o libbackend.a $(LIBS) |
1c37b4f8 | 289 | $(CODE_SIGN) -s "$(CODE_SIGN_IDENTITY)" $@ |
89d46774 | 290 | |
291 | ||
ef416fc2 | 292 | # |
293 | # socket | |
294 | # | |
295 | ||
ed486911 | 296 | socket: socket.o ../cups/$(LIBCUPS) libbackend.a |
ef416fc2 | 297 | echo Linking $@... |
a621d151 | 298 | $(LD_CC) $(LDFLAGS) -o socket socket.o libbackend.a $(LIBS) |
1c37b4f8 | 299 | $(CODE_SIGN) -s "$(CODE_SIGN_IDENTITY)" $@ |
ef416fc2 | 300 | |
6fb588e0 MS |
301 | socket-static: socket.o ../cups/$(LIBCUPSSTATIC) libbackend.a |
302 | echo Linking $@... | |
a621d151 | 303 | $(LD_CC) $(LDFLAGS) -o socket-static socket.o libbackend.a \ |
6fb588e0 | 304 | ../cups/$(LIBCUPSSTATIC) $(LIBGSSAPI) $(SSLLIBS) $(DNSSDLIBS) \ |
b94f7488 | 305 | $(COMMONLIBS) $(LIBZ) |
1c37b4f8 | 306 | $(CODE_SIGN) -s "$(CODE_SIGN_IDENTITY)" $@ |
6fb588e0 | 307 | |
ef416fc2 | 308 | |
309 | # | |
310 | # usb | |
311 | # | |
312 | ||
ed486911 | 313 | usb: usb.o ../cups/$(LIBCUPS) libbackend.a |
ef416fc2 | 314 | echo Linking $@... |
a621d151 | 315 | $(LD_CC) $(ARCHFLAGS) $(LDFLAGS) -o usb usb.o libbackend.a $(LIBUSB) \ |
9a4f8274 | 316 | $(BACKLIBS) $(LIBS) |
1c37b4f8 | 317 | $(CODE_SIGN) -s "$(CODE_SIGN_IDENTITY)" $@ |
75bd9771 | 318 | usb.o: usb.c usb-darwin.c usb-libusb.c usb-unix.c |
ef416fc2 | 319 | |
320 | ||
321 | # | |
322 | # Dependencies... | |
323 | # | |
324 | ||
325 | include Dependencies |