# (C) Finite State Machine Labs Inc. 2000 business@fsmlabs.com
#
# Released under the terms of GPL 2.
# Open RTLinux makes use of a patented process described in
# US Patent 5,995,745. Use of this process is governed
# by the Open RTLinux Patent License which can be obtained from
# www.fsmlabs.com/PATENT or by sending email to
# licensequestions@fsmlabs.com

#LDFLAGS= -Os -g -fomit-frame-pointer -fno-common -Wall   -mno-xl-soft-mul -mxl-barrel-shift -mno-xl-soft-div -Dlinux -D__linux__ -Dunix -D__uClinux__ -DEMBED -nostdinc -fno-builtin -Wl,-elf2flt -L/home/UCLINUX_FEB_2006/uClinux-dist/lib/uClibc/lib -lc

#LDFLAGS= -Wl,-elf2flt -L/home/UCLINUX_FEB_2006/uClinux-dist/lib/uClibc/lib -lc

ALL = periodic_test.o oneshot_test.o fifo_module.o thread_time.o hello.o 

all : $(ALL)
	make -C linux_apps

ifneq ($(wildcard ../rtl.mk),)
include ../rtl.mk
endif

install: all
	@echo "Installing regression tests to" $(INSTDIR)/regression
	@mkdir -p $(INSTDIR)/regression
	@for head in $(ALL); do \
	   cp $$head $(INSTDIR)/regression; \
	done

clean: dummy
	rm -f *.o periodic_monitor modules.dep oneshot_monitor \
	linuxtime \
	rtlgethrtime_test \
	fp_test.o hello.o  \
	rt_process.o
	make -C linux_apps clean

thread_time.o: thread_time.c
	$(CC) ${INCLUDE} ${CFLAGS} -c thread_time.c

fp_test.o: fp_test.c
	$(CC) ${INCLUDE} ${CFLAGS} -c fp_test.c

state_test.o: state_test.c state_common.h
	$(CC) ${INCLUDE} ${CFLAGS} -c state_test.c

fifo_module.o: fifo_module.c
	$(CC) ${INCLUDE} ${CFLAGS} -c fifo_module.c

rt_process.o: rt_process.c
	$(CC) ${CFLAGS} -c rt_process.c

hello.o: hello.c
	$(CC) ${INCLUDE} ${CFLAGS} -c hello.c

switch_module.o: switch_module.c
	$(CC) ${INCLUDE} ${CFLAGS} -c switch_module.c

periodic_test.o: periodic_test.c
	$(CC) ${INCLUDE} ${CFLAGS} -c periodic_test.c

oneshot_test.o: oneshot_test.c
	$(CC) ${INCLUDE} ${CFLAGS} -c oneshot_test.c

.PHONY: dummy

include $(RTL_DIR)/Rules.make
