#
# Makefile for ALSA
# Copyright (c) 1999 by Jaroslav Kysela <perex@suse.cz>
#

EXTRA_CFLAGS := -I../../include

SUB_DIRS     :=
MOD_SUB_DIRS :=
ALL_SUB_DIRS :=

L_TARGET     := snd_sb.a
M_OBJS	     :=
L_OBJS       :=
LX_OBJS      :=
MIX_OBJS     :=

EMU8000X     := emu8000.o
EMU8000      := emu8000_equalizer.o emu8000_seq.o emu8000_synth.o \
                emu8000_oss.o emu8000_patch.o soundfont.o emu8000_init.o \
		emu8000_proc.o emu8000_nrpn.o
SB8X	     := sb8_init.o
SB8	     := sb8.o mixer8.o midi8.o
SB16X	     := sb16_init.o
SB16	     := sb16.o mixer16.o

ifeq ($(CONFIG_SND_SEQUENCER),y)
  ifeq ($(CONFIG_SND_SYNTH_EMU8000),y)
    LX_OBJS += $(EMU8000X)
    L_OBJS += $(EMU8000)
  else
    ifeq ($(CONFIG_SND_SYNTH_EMU8000),m)
      M_OBJS += snd-synth-emu8000.o
      MIX_OBJS += $(EMU8000X)
    endif
  endif
endif

ifeq ($(CONFIG_SND_SB8_DSP),y)
  LX_OBJS += $(SB8X)
  L_OBJS += $(SB8)
else
  ifeq ($(CONFIG_SND_SB8_DSP),m)
    M_OBJS += snd-sb8-dsp.o
    MIX_OBJS += $(SB8X)
  endif
endif

ifeq ($(CONFIG_SND_SB16_DSP),y)
  LX_OBJS += $(SB16X)
  L_OBJS += $(SB16)
else
  ifeq ($(CONFIG_SND_SB16_DSP),m)
    M_OBJS += snd-sb16-dsp.o
    MIX_OBJS += $(SB16X)
  endif
endif

ifeq ($(CONFIG_SND_SB16_CSP),y)
  LX_OBJS += sb16_csp.o
else
  ifeq ($(CONFIG_SND_SB16_CSP),m)
    M_OBJS += snd-sb16-csp.o
    MIX_OBJS += sb16_csp.o
  endif
endif

include $(TOPDIR)/Rules.make

snd-synth-emu8000.o: $(EMU8000X) $(EMU8000)
	$(LD) $(LD_RFLAG) -r -o $@ $(EMU8000X) $(EMU8000)

snd-sb8-dsp.o: $(SB8X) $(SB8)
	$(LD) $(LD_RFLAG) -r -o $@ $(SB8X) $(SB8)

snd-sb16-dsp.o: $(SB16X) $(SB16)
	$(LD) $(LD_RFLAG) -r -o $@ $(SB16X) $(SB16)

snd-sb16-csp.o: sb16_csp.o
	$(LD) $(LD_RFLAG) -r -o $@ sb16_csp.o
