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