aboutsummaryrefslogtreecommitdiffstats
path: root/arch/ppc/boot/openfirmware/Makefile
diff options
context:
space:
mode:
Diffstat (limited to 'arch/ppc/boot/openfirmware/Makefile')
-rw-r--r--arch/ppc/boot/openfirmware/Makefile96
1 files changed, 9 insertions, 87 deletions
diff --git a/arch/ppc/boot/openfirmware/Makefile b/arch/ppc/boot/openfirmware/Makefile
index 83a6433459ce..2a411ec2e650 100644
--- a/arch/ppc/boot/openfirmware/Makefile
+++ b/arch/ppc/boot/openfirmware/Makefile
@@ -21,26 +21,16 @@ bootlib := $(boot)/lib
21of1275 := $(boot)/of1275 21of1275 := $(boot)/of1275
22images := $(boot)/images 22images := $(boot)/images
23 23
24OBJCOPY_ARGS := -O aixcoff-rs6000 -R .stab -R .stabstr -R .comment
25COFF_LD_ARGS := -T $(srctree)/$(boot)/ld.script -e _start -Ttext 0x00500000 \
26 -Bstatic
27CHRP_LD_ARGS := -T $(srctree)/$(boot)/ld.script -e _start -Ttext 0x00800000 24CHRP_LD_ARGS := -T $(srctree)/$(boot)/ld.script -e _start -Ttext 0x00800000
28NEWWORLD_LD_ARGS:= -T $(srctree)/$(boot)/ld.script -e _start -Ttext 0x01000000
29 25
30COMMONOBJS := start.o misc.o common.o 26COMMONOBJS := start.o misc.o common.o
31COFFOBJS := coffcrt0.o $(COMMONOBJS) coffmain.o
32CHRPOBJS := crt0.o $(COMMONOBJS) chrpmain.o 27CHRPOBJS := crt0.o $(COMMONOBJS) chrpmain.o
33NEWWORLDOBJS := crt0.o $(COMMONOBJS) newworldmain.o
34 28
35targets := $(COFFOBJS) $(CHRPOBJS) $(NEWWORLDOBJS) dummy.o 29targets := $(CHRPOBJS) dummy.o
36COFFOBJS := $(addprefix $(obj)/, $(COFFOBJS))
37CHRPOBJS := $(addprefix $(obj)/, $(CHRPOBJS)) 30CHRPOBJS := $(addprefix $(obj)/, $(CHRPOBJS))
38NEWWORLDOBJS := $(addprefix $(obj)/, $(NEWWORLDOBJS))
39 31
40LIBS := lib/lib.a $(bootlib)/lib.a $(of1275)/lib.a $(common)/lib.a 32LIBS := lib/lib.a $(bootlib)/lib.a $(of1275)/lib.a $(common)/lib.a
41 33
42HACKCOFF := $(utils)/hack-coff
43
44ifdef CONFIG_SMP 34ifdef CONFIG_SMP
45END := .smp 35END := .smp
46endif 36endif
@@ -72,56 +62,11 @@ targets += image.initrd.o
72$(obj)/image.initrd.o: $(obj)/image.o $(images)/ramdisk.image.gz FORCE 62$(obj)/image.initrd.o: $(obj)/image.o $(images)/ramdisk.image.gz FORCE
73 $(call if_changed,genimage-initrd) 63 $(call if_changed,genimage-initrd)
74 64
75# Create the note section for New-World PowerMacs.
76quiet_cmd_mknote = MKNOTE $@
77 cmd_mknote = $(utils)/mknote > $@
78targets += note
79$(obj)/note: $(utils)/mknote FORCE
80 $(call if_changed,mknote)
81
82 65
83$(obj)/coffcrt0.o: EXTRA_AFLAGS := -DXCOFF 66targets += crt0.o
84targets += coffcrt0.o crt0.o 67$(obj)/crt0.o: $(common)/crt0.S FORCE
85$(obj)/coffcrt0.o $(obj)/crt0.o: $(common)/crt0.S FORCE
86 $(call if_changed_dep,as_o_S) 68 $(call if_changed_dep,as_o_S)
87 69
88quiet_cmd_gencoffb = COFF $@
89 cmd_gencoffb = $(LD) -o $@ $(COFF_LD_ARGS) $(COFFOBJS) $< $(LIBS) && \
90 $(OBJCOPY) $@ $@ -R .comment $(del-ramdisk-sec)
91targets += coffboot
92$(obj)/coffboot: $(obj)/image.o $(COFFOBJS) $(LIBS) $(srctree)/$(boot)/ld.script FORCE
93 $(call if_changed,gencoffb)
94targets += coffboot.initrd
95$(obj)/coffboot.initrd: $(obj)/image.initrd.o $(COFFOBJS) $(LIBS) \
96 $(srctree)/$(boot)/ld.script FORCE
97 $(call if_changed,gencoffb)
98
99
100quiet_cmd_gen-coff = COFF $@
101 cmd_gen-coff = $(OBJCOPY) $(OBJCOPY_ARGS) $< $@ && \
102 $(HACKCOFF) $@ && \
103 ln -sf $(notdir $@) $(images)/zImage$(initrd).pmac
104
105$(images)/vmlinux.coff: $(obj)/coffboot
106 $(call cmd,gen-coff)
107
108$(images)/vmlinux.initrd.coff: $(obj)/coffboot.initrd
109 $(call cmd,gen-coff)
110
111quiet_cmd_gen-elf-pmac = ELF $@
112 cmd_gen-elf-pmac = $(LD) $(NEWWORLD_LD_ARGS) -o $@ \
113 $(NEWWORLDOBJS) $(LIBS) $< && \
114 $(OBJCOPY) $@ $@ --add-section=.note=$(obj)/note \
115 -R .comment $(del-ramdisk-sec)
116
117$(images)/vmlinux.elf-pmac: $(obj)/image.o $(NEWWORLDOBJS) $(LIBS) \
118 $(obj)/note $(srctree)/$(boot)/ld.script
119 $(call cmd,gen-elf-pmac)
120$(images)/vmlinux.initrd.elf-pmac: $(obj)/image.initrd.o $(NEWWORLDOBJS) \
121 $(LIBS) $(obj)/note \
122 $(srctree)/$(boot)/ld.script
123 $(call cmd,gen-elf-pmac)
124
125quiet_cmd_gen-chrp = CHRP $@ 70quiet_cmd_gen-chrp = CHRP $@
126 cmd_gen-chrp = $(LD) $(CHRP_LD_ARGS) -o $@ $(CHRPOBJS) $< $(LIBS) && \ 71 cmd_gen-chrp = $(LD) $(CHRP_LD_ARGS) -o $@ $(CHRPOBJS) $< $(LIBS) && \
127 $(OBJCOPY) $@ $@ -R .comment $(del-ramdisk-sec) 72 $(OBJCOPY) $@ $@ -R .comment $(del-ramdisk-sec)
@@ -139,46 +84,23 @@ $(images)/zImage.chrp-rs6k $(images)/zImage.initrd.chrp-rs6k: \
139 %-rs6k: % 84 %-rs6k: %
140 $(call cmd,addnote) 85 $(call cmd,addnote)
141 86
142quiet_cmd_gen-miboot = GEN $@
143 cmd_gen-miboot = $(OBJCOPY) $(OBJCOPY_ARGS) \
144 --add-section=$1=$(word 2, $^) $< $@
145$(images)/miboot.image: $(obj)/dummy.o $(images)/vmlinux.gz
146 $(call cmd,gen-miboot,image)
147
148$(images)/miboot.initrd.image: $(images)/miboot.image $(images)/ramdisk.image.gz
149 $(call cmd,gen-miboot,initrd)
150
151# The targets used on the make command-line 87# The targets used on the make command-line
152 88
153.PHONY: zImage zImage.initrd 89.PHONY: zImage zImage.initrd
154zImage: $(images)/vmlinux.coff \ 90zImage: $(images)/zImage.chrp \
155 $(images)/vmlinux.elf-pmac \ 91 $(images)/zImage.chrp-rs6k
156 $(images)/zImage.chrp \
157 $(images)/zImage.chrp-rs6k \
158 $(images)/miboot.image
159 @echo ' kernel: $@ is ready ($<)' 92 @echo ' kernel: $@ is ready ($<)'
160zImage.initrd: $(images)/vmlinux.initrd.coff \ 93zImage.initrd: $(images)/zImage.initrd.chrp \
161 $(images)/vmlinux.initrd.elf-pmac \ 94 $(images)/zImage.initrd.chrp-rs6k
162 $(images)/zImage.initrd.chrp \
163 $(images)/zImage.initrd.chrp-rs6k \
164 $(images)/miboot.initrd.image
165 @echo ' kernel: $@ is ready ($<)' 95 @echo ' kernel: $@ is ready ($<)'
166 96
167TFTPIMAGE := /tftpboot/zImage 97TFTPIMAGE := /tftpboot/zImage
168 98
169.PHONY: znetboot znetboot.initrd 99.PHONY: znetboot znetboot.initrd
170znetboot: $(images)/vmlinux.coff \ 100znetboot: $(images)/zImage.chrp
171 $(images)/vmlinux.elf-pmac \
172 $(images)/zImage.chrp
173 cp $(images)/vmlinux.coff $(TFTPIMAGE).pmac$(END)
174 cp $(images)/vmlinux.elf-pmac $(TFTPIMAGE).pmac$(END).elf
175 cp $(images)/zImage.chrp $(TFTPIMAGE).chrp$(END) 101 cp $(images)/zImage.chrp $(TFTPIMAGE).chrp$(END)
176 @echo ' kernel: $@ is ready ($<)' 102 @echo ' kernel: $@ is ready ($<)'
177znetboot.initrd:$(images)/vmlinux.initrd.coff \ 103znetboot.initrd:$(images)/zImage.initrd.chrp
178 $(images)/vmlinux.initrd.elf-pmac \
179 $(images)/zImage.initrd.chrp
180 cp $(images)/vmlinux.initrd.coff $(TFTPIMAGE).pmac$(END)
181 cp $(images)/vmlinux.initrd.elf-pmac $(TFTPIMAGE).pmac$(END).elf
182 cp $(images)/zImage.initrd.chrp $(TFTPIMAGE).chrp$(END) 104 cp $(images)/zImage.initrd.chrp $(TFTPIMAGE).chrp$(END)
183 @echo ' kernel: $@ is ready ($<)' 105 @echo ' kernel: $@ is ready ($<)'
184 106