
#
# 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_MPU401_UART))
TARGETS += $(TOPDIR)/modules/snd-mpu401-uart.o
SYMFILES += mpu401_uart_export.c
endif
ifeq (1,$(CONFIG_SND_OPL3))
TARGETS += $(TOPDIR)/modules/snd-opl3.o
SYMFILES += opl3_export.c
endif
ifeq (1,$(CONFIG_SND_AC97_CODEC))
TARGETS += $(TOPDIR)/modules/snd-ac97-codec.o
SYMFILES += ac97_codec_export.c
endif
ifeq (1,$(CONFIG_SND_AK4531_CODEC))
TARGETS += $(TOPDIR)/modules/snd-ak4531-codec.o
SYMFILES += ak4531_codec_export.c
endif
ifeq (1,$(CONFIG_SND_UART16550))
TARGETS += $(TOPDIR)/modules/snd-uart16550.o
SYMFILES += uart16550_export.c
endif

MPU401   	= mpu401_uart.o mpu401_uart_export.o
OPL3	 	= opl3.o opl3_export.o
AC97_CODEC	= ac97_codec.o ac97_codec_export.o
AK4531_CODEC	= ak4531_codec.o ak4531_codec_export.o
UART16550	= uart16550.o uart16550_seq.o uart16550_export.o

include  $(TOPDIR)/Rules.make

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

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
