#
# 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_SYNTH_EMU8000))
ifeq (1,$(CONFIG_SND_SEQUENCER))
TARGETS += $(TOPDIR)/modules/snd-synth-emu8000.o
endif
endif
ifeq (1,$(CONFIG_SND_SB8_DSP))
TARGETS += $(TOPDIR)/modules/snd-sb8-dsp.o
EXPORTS += sb8_init.o
endif
ifeq (1,$(CONFIG_SND_SB16_DSP))
TARGETS += $(TOPDIR)/modules/snd-sb16-dsp.o
EXPORTS += sb16_init.o 
endif
ifeq (1,$(CONFIG_SND_SB16_CSP))
TARGETS += $(TOPDIR)/modules/snd-sb16-csp.o
EXPORTS += sb16_csp.o
endif

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

include  $(TOPDIR)/Rules.make

all: $(TARGETS)

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-sb16-csp.o: .depend $(SNDVERSIONS) $(SB16CSP)
	$(LINKER) -o $@ $(SB16CSP)

$(TOPDIR)/modules/snd-synth-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
