1 # Makefile for making XCOFF bootable images for booting on PowerMacs
4 # Paul Mackerras January 1997
7 HOSTCFLAGS
= -O
-I
$(TOPDIR
)/include
9 CC
= $(CROSS_COMPILE
)gcc
10 LD
= $(CROSS_COMPILE
)ld
11 CFLAGS
= -O
-fno-builtin
-I
$(TOPDIR
)/include
12 OBJCOPY
= $(CROSS_COMPILE
)objcopy
13 OBJCOPY_ARGS
= -O aixcoff-rs6000
-R .stab
-R .stabstr
-R .comment \
14 --add-section
=image
=vmlinux.gz
15 LD_ARGS
= -e _start
-T
ld.script
-Ttext
500000 -Tdata
510000 -Bstatic
18 OBJS
= crt0.o start.o main.o misc.o string.o zlib.o
19 LIBS
= $(TOPDIR
)/lib
/lib.a
21 ifeq ($(CONFIG_ALL_PPC
),y
)
22 # yes, we want to build pmac stuff
26 ifeq ($(CONFIG_PPC64
),y
)
32 ifeq ($(CONFIG_SMP
),y
)
33 TFTPIMAGE
=/tftpboot
/zImage.pmac.smp
$(MSIZE
)
35 TFTPIMAGE
=/tftpboot
/zImage.pmac
$(MSIZE
)
38 ifeq ($(CONFIG_PMAC
),y
)
39 hack-coff
: hack-coff.c
40 $(HOSTCC
) $(HOSTCFLAGS
) -o hack-coff hack-coff.c
43 # mount -t hfs /dev/fd0 /mnt
44 # cp vmlinux.coff /mnt
47 znetboot
: vmlinux.coff
48 cp vmlinux.coff
$(TFTPIMAGE
)
50 znetboot.initrd
: vmlinux.coff.initrd
51 cp vmlinux.coff.initrd
$(TFTPIMAGE
)
53 coffboot
: $(OBJS
) ld.script
54 $(LD
) -o coffboot
$(LD_ARGS
) $(OBJS
) $(LIBS
)
58 zImage.initrd
: vmlinux.coff.initrd
60 vmlinux.coff
: coffboot hack-coff vmlinux.gz
61 $(OBJCOPY
) $(OBJCOPY_ARGS
) coffboot
$@
63 ln
-sf vmlinux.coff zImage
65 vmlinux.coff.initrd
: coffboot hack-coff vmlinux.gz ramdisk.image.gz
66 $(OBJCOPY
) $(OBJCOPY_ARGS
) --add-section
=initrd
=ramdisk.image.gz \
73 znetboot.initrd
: vmlinux.gz
79 zImage.initrd
: vmlinux.gz
81 vmlinux.coff
: vmlinux.gz
83 vmlinux.coff.initrd
: vmlinux.gz
89 vmlinux.gz
: $(TOPDIR
)/vmlinux
90 $(OBJCOPY
) -S
-O binary
$(TOPDIR
)/vmlinux vmlinux
94 rm -f hack-coff coffboot zImage vmlinux.coff vmlinux.gz