GNUmakefile
1.27 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
include $(ROOT)/usr/include/make/commondefs
include $(ROOT)/usr/include/make/PRdefs
OBJCOPY = mips-linux-objcopy
REMOVE_SECTS = -R .reginfo -R .note -R .comment -R .mdebug
TARGETS = rom.bin
ifndef DEV_SHORTCUT
ASFILES = entry.s bootu.s bootc.s handler.s
else
ASFILES = dev.s
endif
CFILES = skload.c
OPTIMIZER=
#LCOPTS += -mcpu=4300 -mips3 -Os
#LCOPTS += -mips3 -Os
#LASOPTS += -mips3 -Os
LCOPTS += -mcpu=4300 -mips3 -O2
LASOPTS += -mcpu=4300 -mips3 -O2
ifdef DEV_SHORTCUT
LCOPTS += -DDEV_SHORTCUT
endif
ifdef _DEBUG
LCOPTS += -D_DEBUG
LASOPTS += -D_DEBUG
endif
ifndef DEV_SHORTCUT
LLDOPTS += -Wl,-T rom.lk -N
else
LLDOPTS += -Ttext 0xbfc00000 -N
endif
LDIRT += handler[123].o rom.elf rom.sim
# SUBDIRS used for testing
SUBDIRS = psk
default : $(TARGETS)
rom.bin: $(OBJECTS)
ln -s -f handler.o handler1.o
ln -s -f handler.o handler2.o
ln -s -f handler.o handler3.o
$(CCF) -o rom.elf $(OBJECTS) $(LDFLAGS)
rm -f handler1.o handler2.o handler3.o
$(OBJCOPY) -O binary -S $(REMOVE_SECTS) rom.elf rom.bin
od -v -w4 -An -tx1 rom.bin | tr -d " " > rom.sim
test: default copy_sim
$(SUBDIRS_MAKERULE)
cd $(BBROOT)/hw/chip/vsim; sim.cpu +vcs+lic+wait +cbus_mon +cpu_mon +io_mon
exports install:
include $(COMMONRULES)
copy_sim:
cp -f rom.sim $(BBROOT)/hw/chip/vsim/tests/brom.dat