# 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_OBJS :=

ifdef CONFIG_SCSI

SCSI_OBJS := hosts.o scsi.o scsi_ioctl.o constants.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
endif

ifdef CONFIG_A2091_SCSI
SCSI_OBJS := $(SCSI_OBJS) a2091_scsi.o
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) scsi.a
	$(AR) ruv scsi.a $(SCSI_OBJS)
	$(RANLIB) scsi.a

else

scsi.a:
	$(RM) scsi.a
	@echo "No SCSI drivers configured"
	@touch dummy.o
	@$(AR) ruv scsi.a dummy.o
	@$(RM) dummy.o
	@$(RANLIB) scsi.a

endif

constants.o: constants.c
	$(CC) $(CFLAGS) -c constants.c

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
