#
# 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 = $(SNDVERSIONS)
ifeq (1,$(CONFIG_SND_S3_86C617))
TARGETS += $(TOPDIR)/modules/snd-s3-86c617.o
EXPORTS += s3_86c617.o
endif
ifeq (1,$(CONFIG_SND_ENS1370))
TARGETS += $(TOPDIR)/modules/snd-ens1370.o
EXPORTS += ens1370.o
endif
ifeq (1,$(CONFIG_SND_ENS1371))
TARGETS += $(TOPDIR)/modules/snd-ens1371.o
EXPORTS += ens1371.o
endif
ifeq (1,$(CONFIG_SND_ES1938))
TARGETS += $(TOPDIR)/modules/snd-es1938.o
EXPORTS += es1938.o
endif
ifeq (1,$(CONFIG_SND_TRIDENT))
TARGETS += $(TOPDIR)/modules/snd-trident.o
EXPORTS += trident.o
endif
ifeq (1,$(CONFIG_SND_TRIDENT_SYNTH))
ifeq (1,$(CONFIG_SND_SEQUENCER))
TARGETS += $(TOPDIR)/modules/snd-synth-trident.o
endif
endif
ifeq (1,$(CONFIG_SND_CS461X))
TARGETS += $(TOPDIR)/modules/snd-cs461x.o
EXPORTS += cs461x.o
endif
ifeq (1,$(CONFIG_SND_FM801))
TARGETS += $(TOPDIR)/modules/snd-fm801.o
EXPORTS += fm801.o
endif

SONICVIBES	= s3_86c617.o
ENS1370		= ens1370.o
ENS1371		= ens1371.o
ES1938		= es1938.o
TRIDENT		= trident.o
TRIDENTSYNTH	= trident_synth.o
CS461X		= cs461x.o
FM801		= fm801.o

include  $(TOPDIR)/Rules.make

all: $(TARGETS)

include  $(TOPDIR)/Rules1.make

$(TOPDIR)/modules/snd-s3-86c617.o: .depend $(SNDVERSIONS) $(SONICVIBES)
	$(LINKER) -o $@ $(SONICVIBES)

$(TOPDIR)/modules/snd-ens1370.o: .depend $(SNDVERSIONS) $(ENS1370)
	$(LINKER) -o $@ $(ENS1370)

$(TOPDIR)/modules/snd-ens1371.o: .depend $(SNDVERSIONS) $(ENS1371)
	$(LINKER) -o $@ $(ENS1371)

$(TOPDIR)/modules/snd-es1938.o: .depend $(SNDVERSIONS) $(ES1938)
	$(LINKER) -o $@ $(ES1938)

$(TOPDIR)/modules/snd-trident.o: .depend $(SNDVERSIONS) $(TRIDENT)
	$(LINKER) -o $@ $(TRIDENT)

$(TOPDIR)/modules/snd-synth-trident.o: .depend $(SNDVERSIONS) $(TRIDENTSYNTH)
	$(LINKER) -o $@ $(TRIDENTSYNTH)

$(TOPDIR)/modules/snd-cs461x.o: .depend $(SNDVERSIONS) $(CS461X)
	$(LINKER) -o $@ $(CS461X)

$(TOPDIR)/modules/snd-fm801.o: .depend $(SNDVERSIONS) $(FM801)
	$(LINKER) -o $@ $(FM801)

gcompile: $(TARGETS)

clean:
	rm -f .depend *.o *.orig snd.map snd.map? *~
	rm -f core $(SNDVERSIONS) $(SYMFILES)

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

dep:	.depend

dummy:

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