#
-# "$Id: Makefile 7924 2008-09-10 17:36:13Z mike $"
+# Backend makefile for CUPS.
#
-# Backend makefile for CUPS.
+# Copyright 2007-2016 by Apple Inc.
+# Copyright 1997-2007 by Easy Software Products, all rights reserved.
#
-# Copyright 2007-2010 by Apple Inc.
-# Copyright 1997-2007 by Easy Software Products, all rights reserved.
+# These coded instructions, statements, and computer programs are the
+# property of Apple Inc. and are protected by Federal copyright
+# law. Distribution and use rights are outlined in the file "LICENSE.txt"
+# which should have been included with this file. If this file is
+# file is missing or damaged, see the license at "http://www.cups.org/".
#
-# These coded instructions, statements, and computer programs are the
-# property of Apple Inc. and are protected by Federal copyright
-# law. Distribution and use rights are outlined in the file "LICENSE.txt"
-# which should have been included with this file. If this file is
-# file is missing or damaged, see the license at "http://www.cups.org/".
-#
-# This file is subject to the Apple OS-Developed Software exception.
+# This file is subject to the Apple OS-Developed Software exception.
#
include ../Makedefs
# Object files...
#
-RBACKENDS = ipp lpd $(DNSSD_BACKEND)
-UBACKENDS = $(LEGACY_BACKENDS) serial snmp socket usb
-UNITTESTS = test1284 testbackend testsupplies
-TARGETS = libbackend.a $(RBACKENDS) $(UBACKENDS)
-LIBOBJS = ieee1284.o network.o runloop.o snmp-supplies.o
-OBJS = ipp.o lpd.o dnssd.o parallel.o serial.o snmp.o \
- socket.o test1284.o testbackend.o testsupplies.o usb.o
+# RBACKENDS are installed mode 0700 so cupsd will run them as root...
+#
+# UBACKENDS and ULBACKENDS are installed mode 0755 so cupsd will run them as
+# an unprivileged user...
+#
+# See http://www.cups.org/documentation.php/api-filter.html for more info...
+RBACKENDS = \
+ ipp \
+ lpd \
+ $(DNSSD_BACKEND)
+UBACKENDS = \
+ snmp \
+ socket
+ULBACKENDS = \
+ usb
+UNITTESTS = \
+ test1284 \
+ testbackend \
+ testsupplies
+TARGETS = \
+ libbackend.a \
+ $(RBACKENDS) \
+ $(UBACKENDS) \
+ $(ULBACKENDS)
+LIBOBJS = \
+ ieee1284.o \
+ network.o \
+ runloop.o \
+ snmp-supplies.o
+OBJS = \
+ ipp.o \
+ lpd.o \
+ dnssd.o \
+ snmp.o \
+ socket.o \
+ test1284.o \
+ testbackend.o \
+ testsupplies.o \
+ usb.o
#
# Make library targets...
#
-libs:
+libs: $(ULBACKENDS)
#
#
clean:
- $(RM) $(OBJS) $(TARGETS) $(UNITTESTS) $(LIBOBJS) http mdns
+ $(RM) $(OBJS) $(TARGETS) $(UNITTESTS) $(LIBOBJS) http https ipps mdns socket-static
#
#
depend:
- makedepend -Y -I.. -fDependencies $(OBJS:.o=.c) >/dev/null 2>&1
+ $(CC) -MM $(ALL_CFLAGS) $(OBJS:.o=.c) >Dependencies
#
#
install-data:
+ if test "x$(USBQUIRKS)" != x; then \
+ echo Installing USB quirks in $(USBQUIRKS); \
+ $(INSTALL_DIR) -m 755 $(USBQUIRKS); \
+ $(INSTALL_DATA) org.cups.usb-quirks $(USBQUIRKS); \
+ fi
#
# Install programs...
#
-install-exec:
+install-exec: $(INSTALLXPC)
+ echo Installing backends in $(SERVERBIN)/backend
$(INSTALL_DIR) -m 755 $(SERVERBIN)/backend
for file in $(RBACKENDS); do \
$(LIBTOOL) $(INSTALL_BIN) -m 700 $$file $(SERVERBIN)/backend; \
for file in $(UBACKENDS); do \
$(INSTALL_BIN) $$file $(SERVERBIN)/backend; \
done
- $(RM) $(SERVERBIN)/backend/http
- $(LN) ipp $(SERVERBIN)/backend/http
- if test "x$(DNSSD_BACKEND)" != x; then \
+ for file in $(IPPALIASES); do \
+ $(RM) $(SERVERBIN)/backend/$$file; \
+ $(LN) ipp $(SERVERBIN)/backend/$$file; \
+ done
+ if test "x$(DNSSD_BACKEND)" != x -a `uname` = Darwin; then \
$(RM) $(SERVERBIN)/backend/mdns; \
$(LN) $(DNSSD_BACKEND) $(SERVERBIN)/backend/mdns; \
fi
if test "x$(SYMROOT)" != "x"; then \
$(INSTALL_DIR) $(SYMROOT); \
- for file in $(TARGETS); do \
+ for file in $(RBACKENDS) $(UBACKENDS); do \
cp $$file $(SYMROOT); \
+ dsymutil $(SYMROOT)/$$file; \
done \
fi
+install-xpc: ipp
+ echo Installing XPC backends in $(SERVERBIN)/apple
+ $(INSTALL_DIR) -m 755 $(SERVERBIN)/apple
+ $(LIBTOOL) $(INSTALL_BIN) ipp $(SERVERBIN)/apple
+ for file in $(IPPALIASES); do \
+ $(RM) $(SERVERBIN)/apple/$$file; \
+ $(LN) ipp $(SERVERBIN)/apple/$$file; \
+ done
+
#
# Install headers...
#
install-libs:
+ echo Installing backends in $(SERVERBIN)/backend
+ $(INSTALL_DIR) -m 755 $(SERVERBIN)/backend
+ for file in $(ULBACKENDS); do \
+ $(INSTALL_BIN) $$file $(SERVERBIN)/backend; \
+ done
+ if test "x$(SYMROOT)" != "x"; then \
+ $(INSTALL_DIR) $(SYMROOT); \
+ for file in $(ULBACKENDS); do \
+ cp $$file $(SYMROOT); \
+ dsymutil $(SYMROOT)/$$file; \
+ done \
+ fi
#
#
uninstall:
- for file in $(RBACKENDS) $(UBACKENDS); do \
+ $(RM) $(SERVERBIN)/apple/ipp
+ for file in $(IPPALIASES); do \
+ $(RM) $(SERVERBIN)/apple/$$file; \
+ done
+ -$(RMDIR) $(SERVERBIN)/apple
+ for file in $(RBACKENDS) $(UBACKENDS) $(ULBACKENDS); do \
+ $(RM) $(SERVERBIN)/backend/$$file; \
+ done
+ for file in $(IPPALIASES); do \
$(RM) $(SERVERBIN)/backend/$$file; \
done
- $(RM) $(SERVERBIN)/backend/http
-$(RMDIR) $(SERVERBIN)/backend
-$(RMDIR) $(SERVERBIN)
dnssd: dnssd.o ../cups/$(LIBCUPS) libbackend.a
echo Linking $@...
$(CC) $(LDFLAGS) -o dnssd dnssd.o libbackend.a $(LIBS)
- $(RM) mdns
- $(LN) dnssd mdns
+ if test `uname` = Darwin; then \
+ $(RM) mdns; \
+ $(LN) dnssd mdns; \
+ fi
#
$(CC) $(LDFLAGS) -o lpd lpd.o libbackend.a $(LIBS)
-#
-# parallel
-#
-
-parallel: parallel.o ../cups/$(LIBCUPS) libbackend.a
- echo Linking $@...
- $(CC) $(LDFLAGS) -o parallel parallel.o libbackend.a $(LIBS)
-
-
-#
-# serial
-#
-
-serial: serial.o ../cups/$(LIBCUPS) libbackend.a
- echo Linking $@...
- $(CC) $(LDFLAGS) -o serial serial.o libbackend.a $(BACKLIBS) $(LIBS)
-
-
#
# snmp
#
echo Linking $@...
$(CC) $(LDFLAGS) -o socket socket.o libbackend.a $(LIBS)
+socket-static: socket.o ../cups/$(LIBCUPSSTATIC) libbackend.a
+ echo Linking $@...
+ $(CC) $(LDFLAGS) -o socket-static socket.o libbackend.a \
+ ../cups/$(LIBCUPSSTATIC) $(LIBGSSAPI) $(SSLLIBS) $(DNSSDLIBS) \
+ $(COMMONLIBS) $(LIBZ)
+
#
# usb
usb: usb.o ../cups/$(LIBCUPS) libbackend.a
echo Linking $@...
- $(CC) $(LDFLAGS) -o usb usb.o libbackend.a $(LIBUSB) \
+ $(CC) $(ARCHFLAGS) $(LDFLAGS) -o usb usb.o libbackend.a $(LIBUSB) \
$(BACKLIBS) $(LIBS)
usb.o: usb.c usb-darwin.c usb-libusb.c usb-unix.c
#
include Dependencies
-
-
-#
-# End of "$Id: Makefile 7924 2008-09-10 17:36:13Z mike $".
-#