X-Git-Url: http://git.ipfire.org/?p=thirdparty%2Fcups.git;a=blobdiff_plain;f=backend%2FMakefile;h=a4017bf77ef67f6fe4fe3ef10e99ef34de8c80cd;hp=3dccd1a53762642f02b4f26d785aa3730286bdd8;hb=503b54c9302c8de6207e079a80a89a787eb612ea;hpb=91c84a3551145559de2956179661e111e373db95 diff --git a/backend/Makefile b/backend/Makefile index 3dccd1a53..a4017bf77 100644 --- a/backend/Makefile +++ b/backend/Makefile @@ -1,28 +1,63 @@ # -# "$Id: Makefile 6778 2007-08-08 19:27:51Z mike $" +# Backend makefile for CUPS. # -# Backend makefile for the Common UNIX Printing System (CUPS). +# Copyright 2007-2014 by Apple Inc. +# Copyright 1997-2007 by Easy Software Products, all rights reserved. # -# Copyright 2007-2008 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 -RBACKENDS = ipp lpd -UBACKENDS = $(PAP) $(LEGACY_BACKENDS) serial snmp socket usb -TARGETS = betest test1284 libbackend.a $(RBACKENDS) $(UBACKENDS) -LIBOBJS = ieee1284.o runloop.o -OBJS = betest.o ipp.o lpd.o pap.o parallel.o scsi.o \ - serial.o snmp.o socket.o test1284.o usb.o +# +# Object files... +# + +# 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 # @@ -32,12 +67,26 @@ OBJS = betest.o ipp.o lpd.o pap.o parallel.o scsi.o \ all: $(TARGETS) +# +# Make library targets... +# + +libs: $(ULBACKENDS) + + +# +# Make unit tests... +# + +unittests: $(UNITTESTS) + + # # Clean all object files... # clean: - $(RM) $(OBJS) $(TARGETS) $(LIBOBJS) http + $(RM) $(OBJS) $(TARGETS) $(UNITTESTS) $(LIBOBJS) http https ipps mdns # @@ -45,130 +94,186 @@ clean: # depend: - makedepend -Y -I.. -fDependencies $(OBJS:.o=.c) >/dev/null 2>&1 + $(CC) -MM $(ALL_CFLAGS) $(OBJS:.o=.c) >Dependencies # # Install all targets... # -install: all +install: all install-data install-headers install-libs install-exec + + +# +# Install data files... +# + +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: $(INSTALLXPC) + echo Installing backends in $(SERVERBIN)/backend $(INSTALL_DIR) -m 755 $(SERVERBIN)/backend for file in $(RBACKENDS); do \ - $(LIBTOOL) $(INSTALL) -m 700 $$file $(SERVERBIN)/backend; \ + $(LIBTOOL) $(INSTALL_BIN) -m 700 $$file $(SERVERBIN)/backend; \ done for file in $(UBACKENDS); do \ $(INSTALL_BIN) $$file $(SERVERBIN)/backend; \ done - $(RM) $(SERVERBIN)/backend/http - $(LN) ipp $(SERVERBIN)/backend/http + 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 + # -# Uninstall all targets... +# Install headers... # -uninstall: - for file in $(RBACKENDS) $(UBACKENDS); do \ - $(RM) $(SERVERBIN)/backend/$$file; \ - done - $(RM) $(SERVERBIN)/backend/http - -$(RMDIR) $(SERVERBIN)/backend - -$(RMDIR) $(SERVERBIN) +install-headers: # -# betest +# Install libraries... # -betest: betest.o ../cups/$(LIBCUPS) - echo Linking $@... - $(CC) $(LDFLAGS) -o betest betest.o $(LIBS) +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 # -# test1284 +# Uninstall all targets... # -test1284: test1284.o ../cups/libcups.a - echo Linking $@... - $(CC) $(LDFLAGS) -o test1284 test1284.o ../cups/libcups.a \ - $(SSLLIBS) $(COMMONLIBS) $(LIBZ) +uninstall: + $(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 + -$(RMDIR) $(SERVERBIN)/backend + -$(RMDIR) $(SERVERBIN) # -# libbackend.a +# test1284 # -libbackend.a: $(LIBOBJS) - echo Archiving $@... - $(RM) $@ - $(AR) $(ARFLAGS) $@ $(LIBOBJS) - $(RANLIB) $@ +test1284: test1284.o ../cups/$(LIBCUPSSTATIC) + echo Linking $@... + $(CC) $(LDFLAGS) -o test1284 test1284.o ../cups/$(LIBCUPSSTATIC) \ + $(LIBGSSAPI) $(SSLLIBS) $(DNSSDLIBS) $(COMMONLIBS) $(LIBZ) # -# ipp +# testbackend # -ipp: ipp.o ../cups/$(LIBCUPS) +testbackend: testbackend.o ../cups/$(LIBCUPSSTATIC) echo Linking $@... - $(CC) $(LDFLAGS) -o ipp ipp.o $(LIBS) - $(RM) http - $(LN) ipp http + $(CC) $(LDFLAGS) -o testbackend testbackend.o ../cups/$(LIBCUPSSTATIC) \ + $(LIBGSSAPI) $(SSLLIBS) $(DNSSDLIBS) $(COMMONLIBS) $(LIBZ) # -# lpd +# testsupplies # -lpd: lpd.o ../cups/$(LIBCUPS) +testsupplies: testsupplies.o libbackend.a ../cups/$(LIBCUPSSTATIC) echo Linking $@... - $(CC) $(LDFLAGS) -o lpd lpd.o $(LIBS) + $(CC) $(LDFLAGS) -o testsupplies testsupplies.o libbackend.a \ + ../cups/$(LIBCUPSSTATIC) $(LIBGSSAPI) $(SSLLIBS) $(DNSSDLIBS) \ + $(COMMONLIBS) $(LIBZ) # -# pap +# libbackend.a # -pap: pap.o ../cups/$(LIBCUPS) - echo Linking $@... - $(CC) $(LDFLAGS) -o pap pap.o $(BACKLIBS) $(LIBS) -framework AppleTalk +libbackend.a: $(LIBOBJS) + echo Archiving $@... + $(RM) $@ + $(AR) $(ARFLAGS) $@ $(LIBOBJS) + $(RANLIB) $@ # -# parallel +# dnssd # -parallel: parallel.o ../cups/$(LIBCUPS) libbackend.a +dnssd: dnssd.o ../cups/$(LIBCUPS) libbackend.a echo Linking $@... - $(CC) $(LDFLAGS) -o parallel parallel.o libbackend.a $(LIBS) + $(CC) $(LDFLAGS) -o dnssd dnssd.o libbackend.a $(LIBS) + if test `uname` = Darwin; then \ + $(RM) mdns; \ + $(LN) dnssd mdns; \ + fi # -# scsi +# ipp # -scsi: scsi.o ../cups/$(LIBCUPS) +ipp: ipp.o ../cups/$(LIBCUPS) libbackend.a echo Linking $@... - $(CC) $(LDFLAGS) -o scsi scsi.o $(LIBS) - -scsi.o: scsi.c scsi-irix.c scsi-linux.c + $(CC) $(LDFLAGS) -o ipp ipp.o libbackend.a $(LIBS) + $(RM) http + $(LN) ipp http # -# serial +# lpd # -serial: serial.o ../cups/$(LIBCUPS) libbackend.a +lpd: lpd.o ../cups/$(LIBCUPS) libbackend.a echo Linking $@... - $(CC) $(LDFLAGS) -o serial serial.o libbackend.a $(BACKLIBS) $(LIBS) + $(CC) $(LDFLAGS) -o lpd lpd.o libbackend.a $(LIBS) # @@ -195,8 +300,9 @@ socket: socket.o ../cups/$(LIBCUPS) libbackend.a usb: usb.o ../cups/$(LIBCUPS) libbackend.a echo Linking $@... - $(CC) $(LDFLAGS) -o usb usb.o libbackend.a $(BACKLIBS) $(LIBS) -usb.o: usb.c usb-darwin.c usb-unix.c + $(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 # @@ -204,8 +310,3 @@ usb.o: usb.c usb-darwin.c usb-unix.c # include Dependencies - - -# -# End of "$Id: Makefile 6778 2007-08-08 19:27:51Z mike $". -#