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

TOPDIR	= ..

include $(TOPDIR)/Makefile.conf

TARGETS = $(TOPDIR)/modules/snd-interwave.o \
	  $(TOPDIR)/modules/snd-gusmax.o \
	  $(TOPDIR)/modules/snd-gusextreme.o \
	  $(TOPDIR)/modules/snd-gusclassic.o \
          $(TOPDIR)/modules/snd-audiodrive1688.o \
	  $(TOPDIR)/modules/snd-sb8.o \
          $(TOPDIR)/modules/snd-sb16.o \
	  $(TOPDIR)/modules/snd-mozart.o

INTERWAVE        = interwave.o
GUSMAX           = gusmax.o
GUSEXTREME       = gusextreme.o
GUSCLASSIC       = gusclassic.o
AUDIODRIVE1688   = audiodrive1688.o
SB8              = sb8.o
SB16             = sb16.o
OPL3SA           = opl3-sa.o
MOZART		 = mozart.o

include $(TOPDIR)/Rules.make

all: $(TARGETS)
	@echo
	@echo "ALSA soundcard specific modules were sucessfully compiled."
	@echo

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

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

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

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

$(TOPDIR)/modules/snd-audiodrive1688.o: .depend $(AUDIODRIVE1688)
	$(LINKER) -o $@ $(AUDIODRIVE1688)

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

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

$(TOPDIR)/modules/snd-opl3sa.o: .depend $(OPL3SA)
	$(LINKER) -o $@ $(OPL3SA)

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

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