#
# 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)
TARGETS = $(SNDVERSIONS)
ifeq (1,$(CONFIG_SND_AD1848))
TARGETS += $(TOPDIR)/modules/snd-ad1848.o
SYMFILES += ad1848_export.c
endif
ifeq (1,$(CONFIG_SND_CS4231))
TARGETS += $(TOPDIR)/modules/snd-cs4231.o
SYMFILES += cs4231_export.c
endif
ifeq (1,$(CONFIG_SND_CS4236))
TARGETS += $(TOPDIR)/modules/snd-cs4236.o
SYMFILES += cs4236_export.c
endif
ifeq (1,$(CONFIG_SND_ES1688))
TARGETS += $(TOPDIR)/modules/snd-es1688.o
SYMFILES += es1688_export.c
endif
ifeq (1,$(CONFIG_SND_ES18XX))
TARGETS += $(TOPDIR)/modules/snd-es18xx.o
SYMFILES += es18xx_export.c
endif

AD1848   = ad1848.o ad1848_export.o
CS4231   = cs4231.o cs4231_export.o
CS4236   = cs4236.o cs4236_export.o
ES1688   = es1688.o es1688_export.o
ES18XX   = es18xx.o es18xx_export.o

include  $(TOPDIR)/Rules.make

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

include  $(TOPDIR)/Rules1.make

$(TOPDIR)/modules/snd-ad1848.o: .depend $(SNDVERSIONS) $(AD1848)
	$(LINKER) -o $@ $(AD1848)

$(TOPDIR)/modules/snd-cs4231.o: .depend $(SNDVERSIONS) $(CS4231)
	$(LINKER) -o $@ $(CS4231)

$(TOPDIR)/modules/snd-cs4236.o: .depend $(SNDVERSIONS) $(CS4236)
	$(LINKER) -o $@ $(CS4236)

$(TOPDIR)/modules/snd-es1688.o: .depend $(SNDVERSIONS) $(ES1688)
	$(LINKER) -o $@ $(ES1688)

$(TOPDIR)/modules/snd-es18xx.o: .depend $(SNDVERSIONS) $(ES18XX)
	$(LINKER) -o $@ $(ES18XX)

gcompile: $(TARGETS)

clean:
	rm -f .depend *.o *.orig ultra.map ultra.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
