#
# Makefile for ALSA low level driver (Linux version)
# Copyright (c) 1994-98 by Jaroslav Kysela <perex@jcu.cz>
#

TOPDIR  = ..

include $(TOPDIR)/Makefile.conf

TARGETS = $(SNDVERSIONS) \
	  $(TOPDIR)/modules/persist.o \
          $(TOPDIR)/modules/snd.o $(TOPDIR)/modules/snd-mixer.o \
          $(TOPDIR)/modules/snd-pcm.o $(TOPDIR)/modules/snd-pcm-oss.o \
          $(TOPDIR)/modules/snd-midi.o
SYMFILES= persistexport.c sndexport.c mixerexport.c pcmexport.c midiexport.c
PERSIST = persist.o persistexport.o
OBJECTS = sound.o init.o isadma.o memory.o info.o control.o pci.o \
          sndexport.o
MIXER   = mixer.o mixerexport.o
PCM	= pcm.o pcm_proc.o ulaw.o pcmexport.o
PCM_OSS	= pcm_oss.o
MIDI    = midi.o rawmidi.o midiexport.o

include $(TOPDIR)/Rules.make

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

include $(TOPDIR)/Rules1.make

$(TOPDIR)/modules/persist.o: .depend $(SNDVERSIONS) $(PERSIST)
	$(LINKER) -o $@ $(PERSIST)

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

$(TOPDIR)/modules/snd-control.o: .depend $(SNDVERSIONS) $(CONTROL)
	$(LINKER) -o $@ $(CONTROL)

$(TOPDIR)/modules/snd-mixer.o: .depend $(SNDVERSIONS) $(MIXER)
	$(LINKER) -o $@ $(MIXER)

$(TOPDIR)/modules/snd-pcm.o: .depend $(SNDVERSIONS) $(PCM)
	$(LINKER) -o $@ $(PCM)

$(TOPDIR)/modules/snd-pcm-oss.o: .depend $(SNDVERSIONS) $(PCM_OSS)
	$(LINKER) -o $@ $(PCM_OSS)

$(TOPDIR)/modules/snd-midi.o: .depend $(SNDVERSIONS) $(MIDI)
	$(LINKER) -o $@ $(MIDI)

gcompile: $(TARGETS)

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