#
# Makefile for ALSA low level driver (Linux version)
# Copyright (c) 1994-98 by Jaroslav Kysela <perex@suse.cz>
#

TOPDIR  = ..

include $(TOPDIR)/Makefile.conf
include $(TOPDIR)/cards.config

TARGETS = $(TOPDIR)/modules/snd-detect.o
OBJECTS = detect.o

ifeq (1,$(CONFIG_SND_GUS))
OBJECTS += gus.o
endif
ifeq (1,$(CONFIG_SND_ES1688))
OBJECTS += es1688.o
endif
ifeq (1,$(CONFIG_SND_SB8_DSP))
OBJECTS += sb.o
else
ifeq (1,$(CONFIG_SND_SB16_DSP))
OBJECTS += sb.o
endif
endif
ifeq (1,$(CONFIG_SND_CARD_OPTI9XX))
OBJECTS += opti9xx.o
endif

include $(TOPDIR)/Rules.make

all: $(TARGETS)

$(TOPDIR)/modules/snd-detect.o: .depend $(OBJECTS)
	$(LINKER) -o $@ $(OBJECTS)

gcompile: $(TARGETS)

insert: $(TARGETS) remove
	sync		# for sure - debug versions may hang
	/sbin/insmod snd-detect.o
	/sbin/lsmod

remove:
	sync		# for sure - debug versions may hang
	- /sbin/rmmod snd-detect
	- /sbin/lsmod

clean:
	rm -f core .depend *.o *.orig snd.map snd.map? *~

.depend:
	$(CPP) $(COPTS) $(INCLUDE) -M *.c > .depend

dep:	.depend

dummy:

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