#
# 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_AD1848))
TARGETS += $(TOPDIR)/modules/snd-ad1848.o
EXPORTS += ad1848.o
endif
ifeq (1,$(CONFIG_SND_CS4231))
TARGETS += $(TOPDIR)/modules/snd-cs4231.o
EXPORTS += cs4231.o
endif
ifeq (1,$(CONFIG_SND_CS4236))
TARGETS += $(TOPDIR)/modules/snd-cs4236.o
EXPORTS += cs4236.o
endif
ifeq (1,$(CONFIG_SND_ES1688))
TARGETS += $(TOPDIR)/modules/snd-es1688.o
EXPORTS += es1688.o
endif
ifeq (1,$(CONFIG_SND_ES18XX))
TARGETS += $(TOPDIR)/modules/snd-es18xx.o
EXPORTS += es18xx.o
endif
ifeq (1,$(CONFIG_SND_WAVEFRONT_SYNTH))
TARGETS += $(TOPDIR)/modules/snd-wavefront-synth.o
TARGETS += $(TOPDIR)/modules/snd-wavefront-fx.o
EXPORTS += wavefront.o wavefront_fx.o
endif

AD1848          = ad1848.o
CS4231          = cs4231.o
CS4236          = cs4236.o
ES1688          = es1688.o
ES18XX          = es18xx.o
WAVEFRONT-SYNTH = wavefront.o wavefront_midi.o
WAVEFRONT-FX    = wavefront_fx.o

include  $(TOPDIR)/Rules.make

all: $(TARGETS)

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)

$(TOPDIR)/modules/snd-wavefront-synth.o: .depend $(SNDVERSIONS) $(WAVEFRONT-SYNTH)
	$(LINKER) -o $@ $(WAVEFRONT-SYNTH)

$(TOPDIR)/modules/snd-wavefront-fx.o: .depend $(SNDVERSIONS) $(WAVEFRONT-FX)
	$(LINKER) -o $@ $(WAVEFRONT-FX)

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
