O_TARGET := rtai_driver.o

export-objs :=

# Select the chosen scheduler.
# Notice that we do not use '+=' constructs here. This makes sure that we
# compile at most one scheduler. (or should we allow multiple schedulers??)
rtai-scheduler-$(CONFIG_RTAI_SCHED_UP) 		= upscheduler
rtai-scheduler-$(CONFIG_RTAI_SCHED_MUP)		= mupscheduler
rtai-scheduler-$(CONFIG_RTAI_SCHED_SMP_APIC)	= smpscheduler
rtai-scheduler-$(CONFIG_RTAI_SCHED_SMP_8254)	= smpscheduler

obj-$(CONFIG_RTAI)		+= rtaidir/rtai.o
obj-$(CONFIG_RTAI_SCHED)	+= $(rtai-scheduler-y)/rtai_sched.o
obj-$(CONFIG_RTAI_FIFOS)	+= fifos/rtai_fifos_sta.o
obj-$(CONFIG_RTAI_DYN_MM)	+= rt_mem_mgr/rt_mem_mgr_sta.o
obj-$(CONFIG_RTAI_RTCOM)	+= rt_com/rt_com_sta.o
obj-$(CONFIG_RTAI_POSIX)	+= posix/src/rtai_posix.o
ifeq ($(CONFIG_RTAI_TRACE),y)
  obj-$(CONFIG_TRACE)	+= trace/rtai_trace_sta.o
endif
obj-$(CONFIG_RTAI_LXRT)		+= lxrt/rtai_lxrt.o
obj-$(CONFIG_RTAI)		+= shmem/rtai_shm_sta.o
obj-$(CONFIG_RTAI_TASKLETS)	+= tasklets/rtai_tasklets_sta.o
obj-$(CONFIG_RTAI_RTCOM_LXRT)	+= rt_com_lxrt/rt_com_lxrt_sta.o
ifeq ($(CONFIG_RTAI_FPU_SUPPORT), y)
  obj-$(CONFIG_RTAI)		+= libm/rtai_libm.o
endif

# prevent the kernel compiler from copying modules twice (but we need obj-y
# for the O_TARGET directive)
obj-m =

subdir-$(CONFIG_RTAI)		+= rtaidir
subdir-$(CONFIG_RTAI_SCHED)	+= $(rtai-scheduler-y)
subdir-$(CONFIG_RTAI_FIFOS)	+= fifos
subdir-$(CONFIG_RTAI_DYN_MM)	+= rt_mem_mgr
subdir-$(CONFIG_RTAI_RTCOM)	+= rt_com
subdir-$(CONFIG_RTAI_POSIX)	+= posix/src
ifeq ($(CONFIG_RTAI_TRACE),y)
  subdir-$(CONFIG_TRACE)	+= trace
endif
subdir-$(CONFIG_RTAI_LXRT)	+= lxrt
subdir-$(CONFIG_RTAI)		+= shmem
subdir-$(CONFIG_RTAI_TASKLETS)	+= tasklets
subdir-$(CONFIG_RTAI_RTCOM_LXRT)+= rt_com_lxrt
ifeq ($(CONFIG_RTAI_FPU_SUPPORT), y)
  subdir-$(CONFIG_RTAI)		+= libm
endif

include Makefile.inc

include $(TOPDIR)/Rules.make

%.o: %.c
