1 # Makefile for making bootable images on various OpenFirmware machines.
3 # This file is included by the global makefile so that you can add your own
4 # architecture-specific flags and dependencies.
6 # Paul Mackerras January 1997
7 # XCOFF bootable images for PowerMacs
8 # Geert Uytterhoeven September 1997
9 # ELF bootable iamges for CHRP machines.
10 # Tom Rini January 2001
11 # Cleaned up, moved into arch/ppc/boot/pmac
12 # Tom Rini July/August 2002
13 # Merged 'chrp' and 'pmac' into 'openfirmware', and cleaned up the
16 zImage.initrd znetboot.initrd
: del-ramdisk-sec
:= -R .ramdisk
17 zImage.initrd znetboot.initrd
: initrd
:= .initrd
21 common
:= $(boot
)/common
22 utils
:= $(boot
)/utils
23 bootlib
:= $(boot
)/lib
24 of1275
:= $(boot
)/of1275
25 images
:= $(boot
)/images
27 CHRP_LD_ARGS
:= -T
$(srctree
)/$(boot
)/ld.script
-e _start
-Ttext
0x00800000
29 COMMONOBJS
:= start.o misc.o common.o
30 CHRPOBJS
:= crt0.o
$(COMMONOBJS
) chrpmain.o
32 targets
:= $(CHRPOBJS
) dummy.o
33 CHRPOBJS
:= $(addprefix $(obj
)/, $(CHRPOBJS
))
35 LIBS
:= lib
/lib.a
$(bootlib
)/lib.a
$(of1275
)/lib.a
$(common
)/lib.a
40 ifdef CONFIG_PPC64BRIDGE
45 $(images
)/ramdisk.image.gz
:
47 @echo
' RAM disk image must be provided separately'
50 quiet_cmd_genimage
= GEN
$@
51 cmd_genimage
= $(OBJCOPY
) -R .comment \
52 --add-section
=.image
=$(images
)/vmlinux.gz \
53 --set-section-flags
=.image
=contents
,alloc
,load
,readonly
,data
$< $@
56 $(obj
)/image.o
: $(obj
)/dummy.o
$(images
)/vmlinux.gz FORCE
57 $(call if_changed
,genimage
)
59 # Place the ramdisk in the initrd image.
60 quiet_cmd_genimage-initrd
= GEN
$@
61 cmd_genimage-initrd
= $(OBJCOPY
) $< $@ \
62 --add-section
=.ramdisk
=$(images
)/ramdisk.image.gz \
63 --set-section-flags
=.ramdisk
=contents
,alloc
,load
,readonly
,data
64 targets
+= image.initrd.o
65 $(obj
)/image.initrd.o
: $(obj
)/image.o
$(images
)/ramdisk.image.gz FORCE
66 $(call if_changed
,genimage-initrd
)
70 $(obj
)/crt0.o
: $(common
)/crt0.S FORCE
71 $(call if_changed_dep
,as_o_S
)
73 quiet_cmd_gen-chrp
= CHRP
$@
74 cmd_gen-chrp
= $(LD
) $(CHRP_LD_ARGS
) -o
$@
$(CHRPOBJS
) $< $(LIBS
) && \
75 $(OBJCOPY
) $@
$@
-R .comment
$(del-ramdisk-sec
)
77 $(images
)/zImage.chrp
: $(obj
)/image.o
$(CHRPOBJS
) $(LIBS
) \
78 $(srctree
)/$(boot
)/ld.script
80 $(images
)/zImage.initrd.chrp
: $(obj
)/image.initrd.o
$(CHRPOBJS
) $(LIBS
) \
81 $(srctree
)/$(boot
)/ld.script
84 quiet_cmd_addnote
= ADDNOTE
$@
85 cmd_addnote
= cat
$< > $@
&& $(utils
)/addnote
$@
86 $(images
)/zImage.chrp-rs6k
$(images
)/zImage.initrd.chrp-rs6k
: \
90 # The targets used on the make command-line
92 PHONY
+= zImage zImage.initrd
93 zImage
: $(images
)/zImage.chrp \
94 $(images
)/zImage.chrp-rs6k
95 @echo
' kernel: $@ is ready ($<)'
96 zImage.initrd
: $(images
)/zImage.initrd.chrp \
97 $(images
)/zImage.initrd.chrp-rs6k
98 @echo
' kernel: $@ is ready ($<)'
100 TFTPIMAGE
:= /tftpboot
/zImage
102 PHONY
+= znetboot znetboot.initrd
103 znetboot
: $(images
)/zImage.chrp
104 cp
$(images
)/zImage.chrp
$(TFTPIMAGE
).chrp
$(END
)
105 @echo
' kernel: $@ is ready ($<)'
106 znetboot.initrd
:$(images
)/zImage.initrd.chrp
107 cp
$(images
)/zImage.initrd.chrp
$(TFTPIMAGE
).chrp
$(END
)
108 @echo
' kernel: $@ is ready ($<)'