#
# Makefile for the linux kernel.
#
# Note! Dependencies are done automagically by 'make dep', which also
# removes any old dependencies. DON'T put your own dependencies here
# unless it's something special (ie not a .c file).

USE_STANDARD_AS_RULE := true

O_TARGET		:= sa1100.o

# Object file lists.

obj-y			:= arch.o hw.o dma-sa1100.o hwtimer.o # mm.o
obj-m			:= gpio.o
obj-n			:=
obj-			:=

export-objs		:= hw.o dma-sa1100.o dma-sa1111.o leds.o hwtimer.o

obj-$(CONFIG_SA1111)	+= dma-sa1111.o
obj-$(CONFIG_LEDS)	+= leds.o
obj-$(CONFIG_SA1100_FREQUENCY_SCALE) += cpu-scale.o

obj-$(CONFIG_SA1100_RTC) += sa1100-rtc.o

obj-$(CONFIG_SA1100_SLEEP)       += sa1100-sleep-mode.o sa1100-sleep.o

obj-$(CONFIG_SA1100_USB) += sa1100_usbd.o
  
SA1100_USBD_OBJS = usb_ctl.o usb_ep0.o usb_recv.o usb_send.o usb-eth.o

# Files that are both resident and modular; remove from modular.

obj-m		:= $(filter-out $(obj-y), $(obj-m))

# Translate to Rules.make lists.

O_OBJS		:= $(filter-out $(export-objs), $(obj-y))
OX_OBJS 	:= $(filter	$(export-objs), $(obj-y))
M_OBJS		:= $(sort $(filter-out $(export-objs), $(obj-m)))
MX_OBJS 	:= $(sort $(filter     $(export-objs), $(obj-m)))

include $(TOPDIR)/Rules.make

sa1100_usbd.o: $(SA1100_USBD_OBJS)
	$(LD) $(LD_RFLAG) -r -o $@ $(SA1100_USBD_OBJS)

