#
# 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_EMU8000))
ifeq (1,$(CONFIG_SND_SEQUENCER))
TARGETS += $(TOPDIR)/modules/snd-emu8000.o
endif
endif
ifeq (1,$(CONFIG_SND_SB8_DSP))
TARGETS += $(TOPDIR)/modules/snd-sb8-dsp.o
endif
ifeq (1,$(CONFIG_SND_SB16_DSP))
TARGETS += $(TOPDIR)/modules/snd-sb16-dsp.o
endif

SYMFILES = sb8_export.c sb16_export.c
ifeq (1,$(CONFIG_SND_EMU8000))
ifeq (1,$(CONFIG_SND_SEQUENCER))
SYMFILES += emu8000_export.c
endif
endif

SB8DSP   = sb8_init.o sb8.o mixer8.o midi8.o sb8_export.o
SB16DSP  = sb16_init.o sb16.o mixer16.o sb16_export.o
EMU8000  = emu8000_equalizer.o \
	   emu8000_seq.o \
	   emu8000_synth.o \
	   emu8000_oss.o \
	   emu8000_patch.o soundfont.o \
	   emu8000.o emu8000_export.o emu8000_init.o \
	   emu8000_proc.o emu8000_nrpn.o

include  $(TOPDIR)/Rules.make

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

install: all
	cp $(TOPDIR)/modules/snd-sb-dsp.o $(TOPDIR)/modules/snd-emu8000.o \
		/lib/modules/`uname -r`/misc

include  $(TOPDIR)/Rules1.make

$(TOPDIR)/modules/snd-sb8-dsp.o: .depend $(SNDVERSIONS) $(SB8DSP)
	$(LINKER) -o $@ $(SB8DSP)

$(TOPDIR)/modules/snd-sb16-dsp.o: .depend $(SNDVERSIONS) $(SB16DSP)
	$(LINKER) -o $@ $(SB16DSP)

$(TOPDIR)/modules/snd-emu8000.o: .depend $(SNDVERSIONS) $(EMU8000)
	$(LINKER) -o $@ $(EMU8000)

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:

README: $(HOME)/websrc/alsa/index.mm
	HERE=$$PWD; cd $(HOME)/websrc/alsa;\
	mmtext -o $$HERE/README ../text.mm index.mm

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