2 # MAKEFILE FOR THE MIPS LINUX BOOTLOADER AND ROM DEBUGGER
6 # Author: Thomas Horsten <thh@i-data.com>
10 Version
= "$(USER)-test"
13 MKLASATIMG
= mklasatimg
14 MKLASATIMG_ARCH
= mq2
,mqpro
,sp100
,sp200
15 KERNEL_IMAGE
= vmlinux
17 LDSCRIPT
= -L
$(srctree
)/$(src
) -Tromscript.normal
19 HEAD_DEFINES
:= -D_kernel_start
=$(VMLINUX_LOAD_ADDRESS
) \
20 -D_kernel_entry
=$(VMLINUX_ENTRY_ADDRESS
) \
21 -D VERSION
="\"$(Version)\"" \
22 -D TIMESTAMP
=$(shell date
+%s
)
24 $(obj
)/head.o
: $(obj
)/head.S
$(KERNEL_IMAGE
)
25 $(CC
) -fno-pic
$(HEAD_DEFINES
) $(LINUXINCLUDE
) -c
-o
$@
$<
27 OBJECTS
= head.o kImage.o
30 rom.bin
: $(obj
)/rom.bin
32 $(obj
)/rom.sw
: $(obj
)/rom.bin
33 $(MKLASATIMG
) -o
$@
-k
$^
-m
$(MKLASATIMG_ARCH
)
35 $(obj
)/rom.bin
: $(obj
)/rom
36 $(OBJCOPY
) -O binary
-S
$^
$@
38 # Rule to make the bootloader
39 $(obj
)/rom
: $(addprefix $(obj
)/,$(OBJECTS
))
40 $(LD
) $(LDFLAGS
) $(LDSCRIPT
) -o
$@
$^
42 $(obj
)/%.o
: $(obj
)/%.gz
43 $(LD
) -r
-o
$@
-b binary
$<
45 $(obj
)/%.gz
: $(obj
)/%.bin
48 $(obj
)/kImage.bin
: $(KERNEL_IMAGE
)
49 $(OBJCOPY
) -O binary
-S
$^
$@
52 rm -f rom rom.bin rom.sw kImage.bin kImage.o