#
# "$Id: Makefile,v 1.1.1.1 2007-05-25 09:35:56 jick_nan Exp $"
#
#   Backend makefile for the Common UNIX Printing System (CUPS).
#
#   Copyright 1997-2002 by Easy Software Products, all rights reserved.
#
#   These coded instructions, statements, and computer programs are the
#   property of Easy Software Products 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 missing or damaged please contact Easy Software Products
#   at:
#
#       Attn: CUPS Licensing Information
#       Easy Software Products
#       44141 Airport View Drive, Suite 204
#       Hollywood, Maryland 20636-3111 USA
#
#       Voice: (301) 373-9603
#       EMail: cups-info@cups.org
#         WWW: http://www.cups.org
#
#   This file is subject to the Apple OS-Developed Software exception.
#

#-----------------------------------------------------
TOPDIR  :=  $(shell /bin/pwd)
TOPDIR  :=  $(TOPDIR)/../..

include $(TOPDIR)/prerules.mk
#-----------------------------------------------------
include ../Makedefs
BUILDROOT      =       ../../../ramdisk

#BACKENDS =	ipp lpd parallel scsi serial socket usb
BACKENDS =	ipp lpd

# Printer interface defined in $(TOPDIR)/diff.mk
ifeq ($(PARALLEL_PRINTER), 1)
BACKENDS +=     parallel
endif

ifeq ($(USB_PRINTER), 1)
BACKENDS +=     usb
endif

TARGETS	=	betest $(BACKENDS)
#OBJS	=	betest.o ipp.o lpd.o parallel.o scsi.o serial.o socket.o usb.o
OBJS	=	betest.o ipp.o lpd.o
ifeq ($(PARALLEL_PRINTER), 1)
OBJS    +=      parallel.o
endif

ifeq ($(USB_PRINTER), 1)
OBJS    +=      usb.o
endif


#
# Make all targets...
#

all:	$(TARGETS)


#
# Clean all object files...
#

clean:
	$(RM) $(OBJS) $(TARGETS) http


#
# Update dependencies (without system header dependencies...)
#

depend:
	makedepend -Y -I.. -fDependencies $(OBJS:.o=.c) >/dev/null 2>&1


#
# Install all targets...
#

install:	all
	$(INSTALL_DIR) $(SERVERBIN)/backend
	for file in $(BACKENDS); do \
		$(STRIP) $$file;	\
		cp $$file $(SERVERBIN)/backend/ -f; \
                chmod 755 $$file; \
	done
	$(RM) $(SERVERBIN)/backend/http
	$(LN) ipp $(SERVERBIN)/backend/http


#
# betest
#

betest:	betest.o ../cups/$(LIBCUPS)
	echo Linking $@...
	$(CC) $(LDFLAGS) -o betest betest.o $(LIBS)


#
# ipp
#

ipp:	ipp.o ../cups/$(LIBCUPS)
	echo Linking $@...
	$(CC) $(LDFLAGS) -o ipp ipp.o $(LIBS)
	$(RM) http
	$(LN) ipp http


#
# lpd
#

lpd:	lpd.o ../cups/$(LIBCUPS)
	echo Linking $@...
	$(CC) $(LDFLAGS) -o lpd lpd.o $(LIBS)


#
# parallel
#

parallel:	parallel.o ../cups/$(LIBCUPS)
	echo Linking $@...
	$(CC) $(LDFLAGS) -o parallel parallel.o $(LIBS)


#
# scsi
#

scsi:	scsi.o ../cups/$(LIBCUPS)
	echo Linking $@...
	$(CC) $(LDFLAGS) -o scsi scsi.o $(LIBS)

scsi.o:	scsi.c scsi-irix.c scsi-linux.c


#
# serial
#

serial:	serial.o ../cups/$(LIBCUPS)
	echo Linking $@...
	$(CC) $(LDFLAGS) -o serial serial.o $(LIBS)


#
# socket
#

socket:	socket.o ../cups/$(LIBCUPS)
	echo Linking $@...
	$(CC) $(LDFLAGS) -o socket socket.o $(LIBS)


#
# usb
#

usb:	usb.o ../cups/$(LIBCUPS)
	echo Linking $@...
	$(CC) $(LDFLAGS) -o usb usb.o $(LIBS)


#
# Dependencies...
#

include Dependencies
#-----------------------------------------------------
include ../../rules.mk
#-----------------------------------------------------

#
# End of "$Id: Makefile,v 1.1.1.1 2007-05-25 09:35:56 jick_nan Exp $".
#
