CC=sparc-rtems-gcc
CPP=sparc-rtems-c++
CC_NOCFLAGS=sparc-rtems-gcc
LD=sparc-rtems-ld

CCOPT = -O2
CFLAGS= -I../.. -I.. -I. -O0 -g3 -Wall
OUTDIR=

CONFIG_DEPS=../../config*.c

all: test test_ngmp

# build options for different systems

#CFLAGS+=-msoft-float -qleon2

clean:
	rm -f *.o core test test_ngmp > /dev/null

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

spwrouter_custom_config.o: spwrouter_custom_config.c
	$(CC) $(CFLAGS) -c spwrouter_custom_config.c -o spwrouter_custom_config.o

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

test: $(CONFIG_DEPS) test.c spwrouter_custom_config.o grspw_router_lib.o grspw_pkt_lib.o
	$(CC) $(CFLAGS) test.c -o test spwrouter_custom_config.o grspw_router_lib.o grspw_pkt_lib.o

# Same as test, but linked against RAM address 0x00000000
test_ngmp: $(CONFIG_DEPS) test.c spwrouter_custom_config.o grspw_router_lib.o grspw_pkt_lib.o
	$(CC) $(CFLAGS) -qngmp test.c -o test_ngmp spwrouter_custom_config.o grspw_router_lib.o grspw_pkt_lib.o
