# --------------------------------------------------------------------------
#  --  This file is a part of GAISLER RESEARCH source code.
#  --  Copyright (C) 2009, Gaisler Research AB - all rights reserved.
#  --
#  -- ANY USE OR REDISTRIBUTION IN PART OR IN WHOLE MUST BE HANDLED IN
#  -- ACCORDANCE WITH THE GAISLER LICENSE AGREEMENT AND MUST BE APPROVED
#  -- IN ADVANCE IN WRITING.
#  --
#  -- BY DEFAULT, DISTRIBUTION OR DISCLOSURE IS NOT PERMITTED.
#  -------------------------------------------------------------------------- 
#
APPS= \
	rtems-ascs \
	rtems-satcan \
	rtems-slink

LIBS=/opt/rtems-4.10/sparc-rtems/leon3/lib/*.a

# Make the examples be recompiled after toolchain has been updated
TOOLCHAIN_DEP=$(LIBS)

CFLAGS=-O0 -g3 -Wall
CC=sparc-rtems-gcc


all: $(APPS)


rtems-ascs: rtems-ascs.c $(TOOLCHAIN_DEP)
	$(CC) $(CFLAGS) -o rtems-ascs rtems-ascs.c

rtems-satcan: occan_lib.o rtems-satcan.c  $(TOOLCHAIN_DEP)
	$(CC) $(CFLAGS) -o rtems-satcan rtems-satcan.c occan_lib.o

occan_lib.o: ../occan_lib.c ../occan_lib.h $(TOOLCHAIN_DEP)
	$(CC) $(CFLAGS) -c ../occan_lib.c -o occan_lib.o

rtems-slink: rtems-slink.c  $(TOOLCHAIN_DEP)
	$(CC) $(CFLAGS) -o rtems-slink rtems-slink.c

clean:
	-rm -f *.o $(APPS)
