#
# Makefile for ALSA low level driver (Linux version)
# Copyright (c) 1994-98 by Jaroslav Kysela <perex@jcu.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
SYMFILES += s3_86c617_export.c
endif
ifeq (1,$(CONFIG_SND_ENS1370))
TARGETS += $(TOPDIR)/modules/snd-ens1370.o
SYMFILES += ens1370_export.c
endif
ifeq (1,$(CONFIG_SND_ES1938))
TARGETS += $(TOPDIR)/modules/snd-es1938.o
SYMFILES += ess_solo1_export.c
endif

SONICVIBES = s3_86c617.o s3_86c617_export.o
AUDIOPCI = ens1370.o ens1370_export.o
ESSSOLO1 = ess_solo1.o ess_solo1_export.o

include  $(TOPDIR)/Rules.make

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

include  $(TOPDIR)/Rules1.make

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

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

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

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
