Merge branch 'for-3.12-fixes' of git://git.kernel.org/pub/scm/linux/kernel/git/tj...
[linux-2.6-block.git] / arch / mips / lasat / image / Makefile
CommitLineData
1f21d2bd
BM
1#
2# MAKEFILE FOR THE MIPS LINUX BOOTLOADER AND ROM DEBUGGER
3#
4# i-data Networks
5#
6# Author: Thomas Horsten <thh@i-data.com>
7#
8
9ifndef Version
10 Version = "$(USER)-test"
11endif
12
13MKLASATIMG = mklasatimg
14MKLASATIMG_ARCH = mq2,mqpro,sp100,sp200
778bc145 15KERNEL_IMAGE = vmlinux
1f21d2bd 16
778bc145 17LDSCRIPT= -L$(srctree)/$(src) -Tromscript.normal
1f21d2bd 18
3185557d
JH
19HEAD_DEFINES := -D_kernel_start=$(VMLINUX_LOAD_ADDRESS) \
20 -D_kernel_entry=$(VMLINUX_ENTRY_ADDRESS) \
1f21d2bd
BM
21 -D VERSION="\"$(Version)\"" \
22 -D TIMESTAMP=$(shell date +%s)
23
24$(obj)/head.o: $(obj)/head.S $(KERNEL_IMAGE)
778bc145 25 $(CC) -fno-pic $(HEAD_DEFINES) $(LINUXINCLUDE) -c -o $@ $<
1f21d2bd
BM
26
27OBJECTS = head.o kImage.o
28
70342287 29rom.sw: $(obj)/rom.sw
1f21d2bd
BM
30rom.bin: $(obj)/rom.bin
31
32$(obj)/rom.sw: $(obj)/rom.bin
33 $(MKLASATIMG) -o $@ -k $^ -m $(MKLASATIMG_ARCH)
34
35$(obj)/rom.bin: $(obj)/rom
36 $(OBJCOPY) -O binary -S $^ $@
37
38# Rule to make the bootloader
39$(obj)/rom: $(addprefix $(obj)/,$(OBJECTS))
40 $(LD) $(LDFLAGS) $(LDSCRIPT) -o $@ $^
41
42$(obj)/%.o: $(obj)/%.gz
43 $(LD) -r -o $@ -b binary $<
44
45$(obj)/%.gz: $(obj)/%.bin
46 gzip -cf -9 $< > $@
47
48$(obj)/kImage.bin: $(KERNEL_IMAGE)
49 $(OBJCOPY) -O binary -S $^ $@
50
51clean:
52 rm -f rom rom.bin rom.sw kImage.bin kImage.o