PREFIX= xscale_be-
CC =$(PREFIX)gcc
AR =$(PREFIX)ar
STRIP =$(PREFIX)strip
RM =/bin/rm -f
#CFLAGS =
CFLAGS = -DDEBUG

all: libredboot.a rbctest.c setswid.c rbcdump.c rbcrm.c
	$(CC) rbcdump.c -lredboot -L. -o rbcdump
	$(CC) rbctest.c -lredboot -L. -o rbctest
	$(CC) rbcrm.c -lredboot -L. -o rbcrm
	$(CC) rbcswlock.c -lredboot -L. -o rbcswlock
	$(CC) setswid.c -o setswid
	$(STRIP) rbctest rbcdump rbcrm rbcswlock setswid

libredboot.a: redboot_config.c
	$(CC) redboot_config.c -c $(CFLAGS)
	$(AR) crv libredboot.a redboot_config.o

clean:
	$(RM) rbcswlock rbctest rbcdump rbcrm libredboot.a redboot_config.o setswid
