#
# 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)
EXPORTS =
ifeq (1,$(CONFIG_SND_MPU401_UART))
TARGETS += $(TOPDIR)/modules/snd-mpu401-uart.o
EXPORTS += mpu401_uart.o
endif
ifeq (1,$(CONFIG_SND_OPL3))
TARGETS += $(TOPDIR)/modules/snd-opl3.o
EXPORTS += opl3.o
endif
ifeq (1,$(CONFIG_SND_AC97_CODEC))
TARGETS += $(TOPDIR)/modules/snd-ac97-codec.o
EXPORTS += ac97_codec.o
endif
ifeq (1,$(CONFIG_SND_AK4531_CODEC))
TARGETS += $(TOPDIR)/modules/snd-ak4531-codec.o
EXPORTS += ak4531_codec.o
endif
ifeq (1,$(CONFIG_SND_UART16550))
TARGETS += $(TOPDIR)/modules/snd-uart16550.o
EXPORTS += uart16550.o
endif

MPU401   	= mpu401_uart.o
OPL3	 	= opl3.o
AC97_CODEC	= ac97_codec.o
AK4531_CODEC	= ak4531_codec.o
UART16550	= uart16550.o uart16550_seq.o

include  $(TOPDIR)/Rules.make

all: $(TARGETS)

include  $(TOPDIR)/Rules1.make

$(TOPDIR)/modules/snd-mpu401-uart.o: .depend $(SNDVERSIONS) $(MPU401)
	$(LINKER) -o $@ $(MPU401)

$(TOPDIR)/modules/snd-opl3.o: .depend $(SNDVERSIONS) $(OPL3)
	$(LINKER) -o $@ $(OPL3)

$(TOPDIR)/modules/snd-ac97-codec.o: .depend $(SNDVERSIONS) $(AC97_CODEC)
	$(LINKER) -o $@ $(AC97_CODEC)

$(TOPDIR)/modules/snd-ak4531-codec.o: .depend $(SNDVERSIONS) $(AK4531_CODEC)
	$(LINKER) -o $@ $(AK4531_CODEC)

$(TOPDIR)/modules/snd-uart16550.o: .depend $(SNDVERSIONS) $(UART16550)
	$(LINKER) -o $@ $(UART16550)

gcompile: $(TARGETS)

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