2 # Backend makefile for CUPS.
4 # Copyright 2007-2016 by Apple Inc.
5 # Copyright 1997-2007 by Easy Software Products, all rights reserved.
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
11 # file is missing or damaged, see the license at "http://www.cups.org/".
13 # This file is subject to the Apple OS-Developed Software exception.
22 # RBACKENDS are installed mode 0700 so cupsd will run them as root...
24 # UBACKENDS and ULBACKENDS are installed mode 0755 so cupsd will run them as
25 # an unprivileged user...
27 # See http://www.cups.org/documentation.php/api-filter.html for more info...
71 # Make library targets...
81 unittests
: $(UNITTESTS
)
85 # Clean all object files...
89 $(RM
) $(OBJS
) $(TARGETS
) $(UNITTESTS
) $(LIBOBJS
) http https ipps mdns socket-static
93 # Update dependencies (without system header dependencies...)
97 $(CC
) -MM
$(ALL_CFLAGS
) $(OBJS
:.o
=.c
) >Dependencies
101 # Install all targets...
104 install: all install-data install-headers install-libs install-exec
108 # Install data files...
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
); \
120 # Install programs...
123 install-exec
: $(INSTALLXPC
)
124 echo Installing backends in
$(SERVERBIN
)/backend
125 $(INSTALL_DIR
) -m
755 $(SERVERBIN
)/backend
126 for file in
$(RBACKENDS
); do \
127 $(LIBTOOL
) $(INSTALL_BIN
) -m
700 $$file $(SERVERBIN
)/backend
; \
129 for file in
$(UBACKENDS
); do \
130 $(INSTALL_BIN
) $$file $(SERVERBIN
)/backend
; \
132 for file in
$(IPPALIASES
); do \
133 $(RM
) $(SERVERBIN
)/backend
/$$file; \
134 $(LN
) ipp
$(SERVERBIN
)/backend
/$$file; \
136 if
test "x$(DNSSD_BACKEND)" != x
-a
`uname` = Darwin
; then \
137 $(RM
) $(SERVERBIN
)/backend
/mdns
; \
138 $(LN
) $(DNSSD_BACKEND
) $(SERVERBIN
)/backend
/mdns
; \
140 if
test "x$(SYMROOT)" != "x"; then \
141 $(INSTALL_DIR
) $(SYMROOT
); \
142 for file in
$(RBACKENDS
) $(UBACKENDS
); do \
143 cp
$$file $(SYMROOT
); \
144 dsymutil
$(SYMROOT
)/$$file; \
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; \
166 # Install libraries...
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
; \
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; \
185 # Uninstall all targets...
189 $(RM
) $(SERVERBIN
)/apple
/ipp
190 for file in
$(IPPALIASES
); do \
191 $(RM
) $(SERVERBIN
)/apple
/$$file; \
193 -$(RMDIR
) $(SERVERBIN
)/apple
194 for file in
$(RBACKENDS
) $(UBACKENDS
) $(ULBACKENDS
); do \
195 $(RM
) $(SERVERBIN
)/backend
/$$file; \
197 for file in
$(IPPALIASES
); do \
198 $(RM
) $(SERVERBIN
)/backend
/$$file; \
200 -$(RMDIR
) $(SERVERBIN
)/backend
201 -$(RMDIR
) $(SERVERBIN
)
208 test1284
: test1284.o ..
/cups
/$(LIBCUPSSTATIC
)
210 $(CC
) $(LDFLAGS
) -o test1284 test1284.o ..
/cups
/$(LIBCUPSSTATIC
) \
211 $(LIBGSSAPI
) $(SSLLIBS
) $(DNSSDLIBS
) $(COMMONLIBS
) $(LIBZ
)
218 testbackend
: testbackend.o ..
/cups
/$(LIBCUPSSTATIC
)
220 $(CC
) $(LDFLAGS
) -o testbackend testbackend.o ..
/cups
/$(LIBCUPSSTATIC
) \
221 $(LIBGSSAPI
) $(SSLLIBS
) $(DNSSDLIBS
) $(COMMONLIBS
) $(LIBZ
)
228 testsupplies
: testsupplies.o libbackend.a ..
/cups
/$(LIBCUPSSTATIC
)
230 $(CC
) $(LDFLAGS
) -o testsupplies testsupplies.o libbackend.a \
231 ..
/cups
/$(LIBCUPSSTATIC
) $(LIBGSSAPI
) $(SSLLIBS
) $(DNSSDLIBS
) \
232 $(COMMONLIBS
) $(LIBZ
)
239 libbackend.a
: $(LIBOBJS
)
242 $(AR
) $(ARFLAGS
) $@
$(LIBOBJS
)
250 dnssd
: dnssd.o ..
/cups
/$(LIBCUPS
) libbackend.a
252 $(CC
) $(LDFLAGS
) -o dnssd dnssd.o libbackend.a
$(LIBS
)
253 if
test `uname` = Darwin
; then \
263 ipp
: ipp.o ..
/cups
/$(LIBCUPS
) libbackend.a
265 $(CC
) $(LDFLAGS
) -o ipp ipp.o libbackend.a
$(LIBS
)
274 lpd
: lpd.o ..
/cups
/$(LIBCUPS
) libbackend.a
276 $(CC
) $(LDFLAGS
) -o lpd lpd.o libbackend.a
$(LIBS
)
283 snmp
: snmp.o ..
/cups
/$(LIBCUPS
) libbackend.a
285 $(CC
) $(LDFLAGS
) -o snmp snmp.o libbackend.a
$(LIBS
)
292 socket
: socket.o ..
/cups
/$(LIBCUPS
) libbackend.a
294 $(CC
) $(LDFLAGS
) -o socket socket.o libbackend.a
$(LIBS
)
296 socket-static
: socket.o ..
/cups
/$(LIBCUPSSTATIC
) libbackend.a
298 $(CC
) $(LDFLAGS
) -o socket-static socket.o libbackend.a \
299 ..
/cups
/$(LIBCUPSSTATIC
) $(LIBGSSAPI
) $(SSLLIBS
) $(DNSSDLIBS
) \
300 $(COMMONLIBS
) $(LIBZ
)
307 usb
: usb.o ..
/cups
/$(LIBCUPS
) libbackend.a
309 $(CC
) $(ARCHFLAGS
) $(LDFLAGS
) -o usb usb.o libbackend.a
$(LIBUSB
) \
311 usb.o
: usb.c usb-darwin.c usb-libusb.c usb-unix.c