GNUmakefile
3.29 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
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
PRDEPTH = ../..
include $(PRDEPTH)/PRdefs
LASINCS = -I../include -I$(ROOT)/usr/include/sys -I$(ROOT)/usr/include/PR
#TM_DMEM_LDFLAGS = -coff -allow_jump_at_eop -n -N -T 84000000 -G 0
#TM_IMEM_LDFLAGS = -coff -allow_jump_at_eop -n -N -T 84001000 -G 0
#RAMROM_BOOT_LDFLAGS = -coff -allow_jump_at_eop -n -N -T b0000400 -G 0
#RDRAM_LDFLAGS = -coff -allow_jump_at_eop -n -N -T 80000000 -G 0
#PIF2DIAGBOOT_LDFLAGS = -allow_jump_at_eop -coff -N -T b0001000 -G 0
TM_DMEM_LDFLAGS = -N -Ttext 84000000 -G 0
TM_IMEM_LDFLAGS = -N -Ttext 84001000 -G 0
RAMROM_BOOT_LDFLAGS = -N -Ttext b0000400 -G 0
RDRAM_LDFLAGS = -N -Ttext 80000000 -G 0
PIF2DIAGBOOT_LDFLAGS = -N -Ttext b0001000 -G 0
CVT = mips-linux-objcopy -O ecoff-bigmips -R .mdebug -R .reginfo
LCFLAGS = -D_HW_VERSION_1
#LLDFLAGS = -coff -allow_jump_at_eop -nN -T bfc00000 -G 0
LLDFLAGS = -N -Ttext bfc00000 -G 0
LASOPTS = -non_shared -G 0
LDV= ${LD} ${LLDFLAGS} ${VLDFLAGS}
ASFILES = pifdebug1.s pifdebug2.s pifmon.s tinymon_pif.s tm_rdram_boot.s \
tm_rdram.s tm_imem_boot.s tm_dmem_boot.s pif2DiagBoot.s
TARGETS = pifdebug1 pifdebug2 pifmon pif2DiagBoot $(UCODE_TARGETS)
UCODE_TARGETS = tinymon_pif.rom tm_rdram_boot tm_rdram.rom \
tm_imem.rom tm_imem_boot tm_dmem.rom tm_dmem_boot
LDIRT_TARGETS = fakerom tm_rdram tm_imem tm_dmem tinymon_pif
LDIRT = $(OBJECTS) $(LDIRT_TARGETS) $(TARGETS:=.elf) $(LDIRT_TARGETS:=.elf)
OBJECTS = $(ASFILES:.s=.o)
include $(PRDEPTH)/PRrules
default all: $(TARGETS)
install: default
$(INSTALL) -m 444 -F /usr/diags/ucode $(UCODE_TARGETS)
pifdebug1: pifdebug1.o
$(LDV) pifdebug1.o -o pifdebug1.elf
$(CVT) pifdebug1.elf pifdebug1
pifdebug2: pifdebug2.o
$(LDV) pifdebug2.o -o pifdebug2.elf
$(CVT) pifdebug2.elf pifdebug2
pifmon: pifmon.o
$(LDV) pifmon.o -o pifmon.elf
$(CVT) pifmon.elf pifmon
tinymon_pif: tinymon_pif.o
${LD} ${RAMROM_BOOT_LDFLAGS} ${VLDFLAGS} tinymon_pif.o -o tinymon_pif.elf
$(CVT) tinymon_pif.elf tinymon_pif
tinymon_pif.rom: tinymon_pif fakerom
./fakerom tinymon_pif tinymon_pif
tm_rdram: tm_rdram.o
${LD} ${RDRAM_LDFLAGS} ${VLDFLAGS} tm_rdram.o \
-o tm_rdram.elf
$(CVT) tm_rdram.elf tm_rdram
tm_rdram.rom: tm_rdram tm_rdram_boot fakerom
./fakerom tm_rdram_boot tm_rdram
tm_rdram_boot: tm_rdram_boot.o
${LD} ${RAMROM_BOOT_LDFLAGS} ${VLDFLAGS} tm_rdram_boot.o \
-o tm_rdram_boot.elf
$(CVT) tm_rdram_boot.elf tm_rdram_boot
fakerom: fakerom.c
# $(CCF) -g $(LASINCS) -nostdlib -L $(ROOT)/usr/lib -o fakerom fakerom.c -lmld
$(HOST_CCF) -I$(ROOT)/host_include/coff -g $(LASINCS) -L $(ROOT)/usr/lib -o fakerom fakerom.c
tm_imem: tm_rspmem.o
${LD} ${TM_IMEM_LDFLAGS} ${VLDFLAGS} tm_rspmem.o -o tm_imem.elf
$(CVT) tm_imem.elf tm_imem
tm_imem.rom: tm_imem_boot tm_imem fakerom
./fakerom tm_imem_boot tm_imem
tm_imem_boot: tm_imem_boot.o
${LD} ${RAMROM_BOOT_LDFLAGS} ${VLDFLAGS} tm_imem_boot.o \
-o tm_imem_boot.elf
$(CVT) tm_imem_boot.elf tm_imem_boot
tm_dmem: tm_rspmem.o
${LD} ${TM_DMEM_LDFLAGS} ${VLDFLAGS} tm_rspmem.o -o tm_dmem.elf
$(CVT) tm_dmem.elf tm_dmem
tm_dmem.rom: tm_dmem_boot tm_dmem fakerom
./fakerom tm_dmem_boot tm_dmem
tm_dmem_boot: tm_dmem_boot.o
${LD} ${RAMROM_BOOT_LDFLAGS} ${VLDFLAGS} tm_dmem_boot.o \
-o tm_dmem_boot.elf
$(CVT) tm_dmem_boot.elf tm_dmem_boot
pif2DiagBoot: $(OBJECTS) Makefile
$(LD) $(PIF2DIAGBOOT_LDFLAGS) pif2DiagBoot.o -o pif2DiagBoot.elf
$(CVT) pif2DiagBoot.elf pif2DiagBoot