#
# 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

ifeq (1,$(CONFIG_SND_CARD_DUMMY))
TARGETS += $(TOPDIR)/modules/snd-card-dummy.o
endif
ifeq (1,$(CONFIG_SND_CARD_INTERWAVE))
TARGETS += $(TOPDIR)/modules/snd-card-interwave.o
endif
ifeq (1,$(CONFIG_SND_CARD_INTERWAVE_STB))
TARGETS += $(TOPDIR)/modules/snd-card-interwave-stb.o
endif
ifeq (1,$(CONFIG_SND_CARD_GUSMAX))
TARGETS += $(TOPDIR)/modules/snd-card-gusmax.o
endif
ifeq (1,$(CONFIG_SND_CARD_GUSEXTREME))
TARGETS += $(TOPDIR)/modules/snd-card-gusextreme.o
endif
ifeq (1,$(CONFIG_SND_CARD_GUSCLASSIC))
TARGETS += $(TOPDIR)/modules/snd-card-gusclassic.o
endif
ifeq (1,$(CONFIG_SND_CARD_ES1688))
TARGETS += $(TOPDIR)/modules/snd-card-es1688.o
endif
ifeq (1,$(CONFIG_SND_CARD_ES18XX))
TARGETS += $(TOPDIR)/modules/snd-card-es18xx.o
endif
ifeq (1,$(CONFIG_SND_CARD_SB8))
TARGETS += $(TOPDIR)/modules/snd-card-sb8.o
endif
ifeq (1,$(CONFIG_SND_CARD_SB16))
TARGETS += $(TOPDIR)/modules/snd-card-sb16.o
endif
ifeq (1,$(CONFIG_SND_CARD_SBAWE))
TARGETS += $(TOPDIR)/modules/snd-card-sbawe.o
endif
ifeq (1,$(CONFIG_SND_CARD_OPL3SA2))
TARGETS += $(TOPDIR)/modules/snd-card-opl3sa2.o
endif
ifeq (1,$(CONFIG_SND_CARD_MOZART))
TARGETS += $(TOPDIR)/modules/snd-card-mozart.o
endif
ifeq (1,$(CONFIG_SND_CARD_OPTI9XX))
TARGETS += $(TOPDIR)/modules/snd-card-opti9xx.o
endif
ifeq (1,$(CONFIG_SND_CARD_AD1848))
TARGETS += $(TOPDIR)/modules/snd-card-ad1848.o
endif
ifeq (1,$(CONFIG_SND_CARD_ALS100))
TARGETS += $(TOPDIR)/modules/snd-card-als100.o
endif
ifeq (1,$(CONFIG_SND_CARD_AZT2320))
TARGETS += $(TOPDIR)/modules/snd-card-azt2320.o
endif
ifeq (1,$(CONFIG_SND_CARD_CS4231))
TARGETS += $(TOPDIR)/modules/snd-card-cs4231.o
endif
ifeq (1,$(CONFIG_SND_CARD_CS4232))
TARGETS += $(TOPDIR)/modules/snd-card-cs4232.o
endif
ifeq (1,$(CONFIG_SND_CARD_CS4236))
TARGETS += $(TOPDIR)/modules/snd-card-cs4236.o
endif
ifeq (1,$(CONFIG_SND_CARD_DT0197H))
TARGETS += $(TOPDIR)/modules/snd-card-dt0197h.o
endif
ifeq (1,$(CONFIG_SND_CARD_SERIAL))
TARGETS += $(TOPDIR)/modules/snd-card-serial.o
endif
ifeq (1,$(CONFIG_SND_CARD_SGALAXY))
TARGETS += $(TOPDIR)/modules/snd-card-sgalaxy.o
endif
ifeq (1,$(CONFIG_SND_CARD_WAVEFRONT))
TARGETS += $(TOPDIR)/modules/snd-card-wavefront.o
endif
ifeq (1,$(CONFIG_SND_CARD_CMI8330))
TARGETS += $(TOPDIR)/modules/snd-card-cmi8330.o
endif
ifeq (1,$(CONFIG_SND_CARD_ES968))
TARGETS += $(TOPDIR)/modules/snd-card-es968.o
endif
  
ifeq (1,$(CONFIG_SND_PCI))
ifeq (1,$(CONFIG_SND_CARD_SONICVIBES))
TARGETS += $(TOPDIR)/modules/snd-card-sonicvibes.o
endif
ifeq (1,$(CONFIG_SND_CARD_ENS1370))
TARGETS += $(TOPDIR)/modules/snd-card-ens1370.o
endif
ifeq (1,$(CONFIG_SND_CARD_ENS1371))
TARGETS += $(TOPDIR)/modules/snd-card-ens1371.o
endif
ifeq (1,$(CONFIG_SND_CARD_ES1938))
TARGETS += $(TOPDIR)/modules/snd-card-es1938.o	   
endif
ifeq (1,$(CONFIG_SND_CARD_TRIDENT))
TARGETS += $(TOPDIR)/modules/snd-card-trident.o
endif
ifeq (1,$(CONFIG_SND_CARD_CS461X))
TARGETS += $(TOPDIR)/modules/snd-card-cs461x.o
endif
ifeq (1,$(CONFIG_SND_CARD_FM801))
TARGETS += $(TOPDIR)/modules/snd-card-fm801.o
endif
endif

CARD_DUMMY	 = card-dummy.o
CARD_INTERWAVE	 = card-interwave.o
CARD_INTERWAVE_STB = card-interwave-stb.o
CARD_GUSMAX	 = card-gusmax.o
CARD_GUSEXTREME	 = card-gusextreme.o
CARD_GUSCLASSIC	 = card-gusclassic.o
CARD_ES1688	 = card-es1688.o
CARD_ES18XX	 = card-es18xx.o
CARD_SB8	 = card-sb8.o
CARD_SB16	 = card-sb16.o
CARD_SBAWE	 = card-sbawe.o
CARD_OPL3SA2	 = card-opl3sa2.o
CARD_MOZART	 = card-mozart.o
CARD_OPTI9XX	 = card-opti9xx.o
CARD_SONICVIBES	 = card-sonicvibes.o
CARD_ENS1370	 = card-ens1370.o
CARD_ENS1371	 = card-ens1371.o
CARD_AD1848	 = card-ad1848.o
CARD_ALS100	 = card-als100.o
CARD_AZT2320	 = card-azt2320.o
CARD_CS4231	 = card-cs4231.o
CARD_CS4232	 = card-cs4232.o
CARD_CS4236	 = card-cs4236.o
CARD_CS461X	 = card-cs461x.o
CARD_DT0197H	 = card-dt0197h.o
CARD_FM801	 = card-fm801.o
CARD_ES968	 = card-es968.o
CARD_ES1938	 = card-es1938.o
CARD_SERIAL	 = card-serial.o
CARD_TRIDENT	 = card-trident.o
CARD_SGALAXY	 = card-sgalaxy.o
CARD_WAVEFRONT	 = card-wavefront.o
CARD_CMI8330     = card-cmi8330.o

include $(TOPDIR)/Rules.make

all: $(TARGETS)
	@if [ "$(CONFIG_SND_SGI)" = "1" ]; then if ! $(MAKE) -C hal2; then exit 1; fi; fi

$(TOPDIR)/modules/snd-card-dummy.o: .depend $(CARD_DUMMY)
	$(LINKER) -o $@ $(CARD_DUMMY)

$(TOPDIR)/modules/snd-card-wavefront.o: .depend $(CARD_WAVEFRONT)
	$(LINKER) -o $@ $(CARD_WAVEFRONT)

$(TOPDIR)/modules/snd-card-interwave.o: .depend $(CARD_INTERWAVE)
	$(LINKER) -o $@ $(CARD_INTERWAVE)

$(TOPDIR)/modules/snd-card-interwave-stb.o: .depend $(CARD_INTERWAVE_STB)
	$(LINKER) -o $@ $(CARD_INTERWAVE_STB)

$(TOPDIR)/modules/snd-card-gusmax.o: .depend $(CARD_GUSMAX)
	$(LINKER) -o $@ $(CARD_GUSMAX)

$(TOPDIR)/modules/snd-card-gusextreme.o: .depend $(CARD_GUSEXTREME)
	$(LINKER) -o $@ $(CARD_GUSEXTREME)

$(TOPDIR)/modules/snd-card-gusclassic.o: .depend $(CARD_GUSCLASSIC)
	$(LINKER) -o $@ $(CARD_GUSCLASSIC)

$(TOPDIR)/modules/snd-card-es1688.o: .depend $(CARD_ES1688)
	$(LINKER) -o $@ $(CARD_ES1688)

$(TOPDIR)/modules/snd-card-es18xx.o: .depend $(CARD_ES18XX)
	$(LINKER) -o $@ $(CARD_ES18XX)

$(TOPDIR)/modules/snd-card-sb8.o: .depend $(CARD_SB8)
	$(LINKER) -o $@ $(CARD_SB8)

$(TOPDIR)/modules/snd-card-sb16.o: .depend $(CARD_SB16)
	$(LINKER) -o $@ $(CARD_SB16)

$(TOPDIR)/modules/snd-card-sbawe.o: .depend $(CARD_SBAWE)
	$(LINKER) -o $@ $(CARD_SBAWE)

$(TOPDIR)/modules/snd-card-opl3sa2.o: .depend $(CARD_OPL3SA2)
	$(LINKER) -o $@ $(CARD_OPL3SA2)

$(TOPDIR)/modules/snd-card-mozart.o: .depend $(CARD_MOZART)
	$(LINKER) -o $@ $(CARD_MOZART)

$(TOPDIR)/modules/snd-card-opti9xx.o: .depend $(CARD_OPTI9XX)
	$(LINKER) -o $@ $(CARD_OPTI9XX)

$(TOPDIR)/modules/snd-card-sonicvibes.o: .depend $(CARD_SONICVIBES)
	$(LINKER) -o $@ $(CARD_SONICVIBES)

$(TOPDIR)/modules/snd-card-ens1370.o: .depend $(CARD_ENS1370)
	$(LINKER) -o $@ $(CARD_ENS1370)

$(TOPDIR)/modules/snd-card-ens1371.o: .depend $(CARD_ENS1371)
	$(LINKER) -o $@ $(CARD_ENS1371)

$(TOPDIR)/modules/snd-card-ad1848.o: .depend $(CARD_AD1848)
	$(LINKER) -o $@ $(CARD_AD1848)

$(TOPDIR)/modules/snd-card-als100.o: .depend $(CARD_ALS100)
	$(LINKER) -o $@ $(CARD_ALS100)

$(TOPDIR)/modules/snd-card-azt2320.o: .depend $(CARD_AZT2320)
	$(LINKER) -o $@ $(CARD_AZT2320)

$(TOPDIR)/modules/snd-card-cs4231.o: .depend $(CARD_CS4231)
	$(LINKER) -o $@ $(CARD_CS4231)

$(TOPDIR)/modules/snd-card-cs4232.o: .depend $(CARD_CS4232)
	$(LINKER) -o $@ $(CARD_CS4232)

$(TOPDIR)/modules/snd-card-cs4236.o: .depend $(CARD_CS4236)
	$(LINKER) -o $@ $(CARD_CS4236)

$(TOPDIR)/modules/snd-card-cs461x.o: .depend $(CARD_CS461X)
	$(LINKER) -o $@ $(CARD_CS461X)

$(TOPDIR)/modules/snd-card-dt0197h.o: .depend $(CARD_DT0197H)
	$(LINKER) -o $@ $(CARD_DT0197H)

$(TOPDIR)/modules/snd-card-es968.o: .depend $(CARD_ES968)
	$(LINKER) -o $@ $(CARD_ES968)

$(TOPDIR)/modules/snd-card-fm801.o: .depend $(CARD_FM801)
	$(LINKER) -o $@ $(CARD_FM801)

$(TOPDIR)/modules/snd-card-es1938.o: .depend $(CARD_ES1938)
	$(LINKER) -o $@ $(CARD_ES1938)

$(TOPDIR)/modules/snd-card-serial.o: .depend $(CARD_SERIAL)
	$(LINKER) -o $@ $(CARD_SERIAL)

$(TOPDIR)/modules/snd-card-trident.o: .depend $(CARD_TRIDENT)
	$(LINKER) -o $@ $(CARD_TRIDENT)

$(TOPDIR)/modules/snd-card-sgalaxy.o: .depend $(CARD_SGALAXY)
	$(LINKER) -o $@ $(CARD_SGALAXY)

$(TOPDIR)/modules/snd-card-cmi8330.o: .depend $(CARD_CMI8330)
	$(LINKER) -o $@ $(CARD_CMI8330)

gcompile: $(TARGETS)

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

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

clean:
	@if [ "$(CONFIG_SND_SGI)" = "1" ]; then if ! $(MAKE) -C hal2 clean; then exit 1; fi; fi
	rm -f core .depend *.o *.orig snd.map snd.map? *~

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

dep:	.depend

dummy:

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