GNUmakefile
1.9 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
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: