GNUmakefile 1.9 KB

BBDEPTH = ../..
include $(BBDEPTH)/BBdefs

LASINCS = -I$(ROOT)/usr/include/PR -I..
LCINCS = -I$(ROOT)/usr/include/PR -I..
OPTIMIZER = -O -g
LCFLAGS += -Wall

LCFLAGS += -DDBG_JTAG

VPATH=..

LDFLAGS = -Ttext 0xbfc00000 -N

TARGETS= flread.dat flwrite.dat flaes.dat fldma.dat flatb.dat flatbs.dat \
	flatbpio.dat flwr.dat

LDIRT += $(TARGETS:.dat=.bin) $(TARGETS:.dat=.elf)

.SUFFIXES: .bin .dat .elf

include $(BBDEPTH)/BBrules

default: $(TARGETS)

.s.elf:
	$(ASF) -o $*.o $<
	$(LD) $(LDFLAGS) crt0.o $*.o -o $*.elf

.elf.bin:
	mips-linux-objcopy -O binary -R .mdebug -R .reginfo $*.elf $*.bin

.bin.dat:
	od -v -w4 -An -tx1 $*.bin | tr -d " " > $*.dat

.c.elf:
	$(CCF) -c -o $*.o $<
	$(LD) $(LDFLAGS) crt0.o $*.o -o $*.elf

fldma.elf: fldma.o cache.o
	$(LD) $(LDFLAGS) crt0.o $^ -o $*.elf

flatb.elf: flatb.o cache.o
	$(LD) $(LDFLAGS) crt0.o $^ -o $*.elf

flatbs.elf: flatbs.o cache.o
	$(LD) $(LDFLAGS) crt0.o $^ -o $*.elf

flatbpio.elf: flatbpio.o cache.o
	$(LD) $(LDFLAGS) crt0.o $^ -o $*.elf

$(TARGETS) : crt0.o ../cpusim.h

flread.fl:
	dd if=/dev/urandom count=32 | $(ROOT)/usr/sbin/mkflash -a -c -o flread.fl 2> flread.sum

flaes.fl:
	dd if=/dev/urandom count=32 > flaes.raw
	sum flaes.raw > flaes.sum
	cat flaes.raw | $(ROOT)/usr/sbin/aes_encode \
		-k babecafefeedbeefbad22daddeadd00d \
		-i deadd00ddad22baddeadbeefcafebabe |\
	$(ROOT)/usr/sbin/mkflash -a -o flaes.fl
	$(ROOT)/usr/sbin/aes_encode -D -p \
			-k babecafefeedbeefbad22daddeadd00d \
	                -i deadd00ddad22baddeadbeefcafebabe 2> flaes.key
flatb.fl:
	cat flaes.raw flaes.raw > flatb.raw
	sum flatb.raw > flatb.sum
	cat flatb.raw | $(ROOT)/usr/sbin/aes_encode \
		-k babecafefeedbeefbad22daddeadd00d \
		-i deadd00ddad22baddeadbeefcafebabe |\
	$(ROOT)/usr/sbin/mkflash -a -o flatb.fl
	cat /dev/null | $(ROOT)/usr/sbin/aes_encode -D -p \
			-k babecafefeedbeefbad22daddeadd00d \
	                -i deadd00ddad22baddeadbeefcafebabe 2> flatb.key

install exports: