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