# Makefile for 680x0 Linux scsi source directory
#
# Copyright 1993 by Hamish Macdonald
#
# This file is subject to the terms and conditions of the GNU General Public
# License.  See the file "README.legal" in the main directory of this archive
# for more details.

include ../../../MakeVars
include ../../../.config

#CFLAGS += -DDEBUG -DWDEBUG

SCSI_HOSTS := 0
SCSI_OBJS :=

ifdef CONFIG_SCSI
SCSI_OBJS := hosts.o scsi.o scsi_ioctl.o

ifdef CONFIG_BLK_DEV_ST
SCSI_OBJS := $(SCSI_OBJS) st.o
endif

ifdef CONFIG_BLK_DEV_SD
SCSI_OBJS := $(SCSI_OBJS) sd.o sd_ioctl.o
endif

ifdef CONFIG_BLK_DEV_SR
SCSI_OBJS := $(SCSI_OBJS) sr.o sr_ioctl.o
endif

ifdef CONFIG_A3000_SCSI
SCSI_OBJS := $(SCSI_OBJS) a3000_scsi.o
SCSI_HOSTS := 1+$(SCSI_HOSTS)
endif

ifdef CONFIG_A2091_SCSI
SCSI_OBJS := $(SCSI_OBJS) a2091_scsi.o
SCSI_HOSTS := 1+$(SCSI_HOSTS)
endif

ifdef CONFIG_A3000_SCSI
SCSI_OBJS := $(SCSI_OBJS) wd33c93.o
else
ifdef CONFIG_A2091_SCSI
SCSI_OBJS := $(SCSI_OBJS) wd33c93.o
else
ifdef CONFIG_GVPII_SCSI
SCSI_OBJS := $(SCSI_OBJS) wd33c93.o
endif
endif
endif

scsi.a: $(SCSI_OBJS)
	rm -f scsi.a
	$(AR) ruv scsi.a $(SCSI_OBJS)
	ranlib scsi.a

else

scsi.a:
	rm -f scsi.a
	@echo "No SCSI drivers configured"
	@touch dummy.o
	@ar ruv scsi.a dummy.o
	@$(RM) dummy.o
	@ranlib scsi.a

endif

CFLAGS := $(CFLAGS) "-DMAX_SCSI_HOSTS=($(SCSI_HOSTS))"

clean:
	$(RM) $(RMFLAGS) *.o *.a

dep:
	$(CPP) -M $(INCFLAGS) *.c > .depend

#
# include a dependency file if one exists
#
ifeq (.depend,$(wildcard .depend))
include .depend
endif
