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

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

SUB_DIRS     := instr
MOD_SUB_DIRS :=
ALL_SUB_DIRS := $(SUB_DIRS) instr oss

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

SEQX	     := seq.o
SEQ1         := seq_lock.o seq_clientmgr.o seq_memory.o seq_queue.o \
                seq_fifo.o seq_prioq.o seq_timer.o \
                seq_system.o seq_ports.o seq_info.o

ifeq ($(CONFIG_SND_OSSEMUL),y)
  ifeq ($(CONFIG_SND_SEQUENCER),y)
    SUB_DIRS += oss
  else
    MOD_SUB_DIRS += oss
  endif
endif

ifeq ($(CONFIG_SND),y)
  LX_OBJS += $(SEQX)
  L_OBJS += $(SEQ1)
else
  ifeq ($(CONFIG_SND),m)
    M_OBJS += snd-seq.o
    MIX_OBJS += $(SEQX)
  endif
endif

ifeq ($(CONFIG_SND_SEQ_DEVICE),y)
  LX_OBJS += seq_device.o
else
  ifeq ($(CONFIG_SND_SEQ_DEVICE),m)
    M_OBJS += snd-seq-device.o
    MIX_OBJS += seq_device.o
  endif
endif

ifeq ($(CONFIG_SND_SEQ_MIDI),y)
  LX_OBJS += seq_midi.o
else
  ifeq ($(CONFIG_SND_SEQ_MIDI),m)
    M_OBJS += snd-seq-midi.o
    MIX_OBJS += seq_midi.o
  endif
endif

ifeq ($(CONFIG_SND_SEQ_MIDI_EMUL),y)
  LX_OBJS += seq_midi_emul.o
else
  ifeq ($(CONFIG_SND_SEQ_MIDI_EMUL),m)
    M_OBJS += snd-seq-midi-emul.o
    MIX_OBJS += seq_midi_emul.o
  endif
endif

ifeq ($(CONFIG_SND_SEQ_INSTR),y)
  LX_OBJS += seq_instr.o
else
  ifeq ($(CONFIG_SND_SEQ_INSTR),m)
    M_OBJS += snd-seq-instr.o
    MIX_OBJS += seq_instr.o
  endif
endif

include $(TOPDIR)/Rules.make

snd-seq.o: $(SEQX) $(SEQ1)
	$(LD) $(LD_RFLAG) -r -o $@ $(SEQX) $(SEQ1)

snd-seq-device.o: seq_device.o
	$(LD) $(LD_RFLAG) -r -o $@ seq_device.o

snd-seq-midi.o: seq_midi.o
	$(LD) $(LD_RFLAG) -r -o $@ seq_midi.o

snd-seq-midi-emul.o: seq_midi_emul.o
	$(LD) $(LD_RFLAG) -r -o $@ seq_midi_emul.o

snd-seq-instr.o: seq_instr.o
	$(LD) $(LD_RFLAG) -r -o $@ seq_instr.o
