2 # arch/ppc/boot/Makefile
4 # This file is subject to the terms and conditions of the GNU General Public
5 # License. See the file "COPYING" in the main directory of this archive
8 # Copyright (C) 1994 by Linus Torvalds
9 # Adapted for PowerPC by Gary Thomas
10 # modified by Cort (cort@cs.nmt.edu)
13 $(CC
) $(CFLAGS
) -S
-o
$*.s
$<
17 $(CC
) $(CFLAGS
) -DINITRD_OFFSET
=$(IOFF
) -DINITRD_SIZE
=$(ISZ
) -DZIMAGE_OFFSET
=$(ZOFF
) -DZIMAGE_SIZE
=$(ZSZ
) -c
-o
$*.o
$<
19 $(CC
) -D__ASSEMBLY__
-traditional
-E
-o
$*.o
$<
21 $(CC
) -D__ASSEMBLY__
-traditional
-c
-o
$*.o
$<
28 ifeq ($(CONFIG_SMP
),y
)
29 TFTPIMAGE
=/tftpboot
/zImage.prep.smp
$(MSIZE
)
31 TFTPIMAGE
=/tftpboot
/zImage.prep
$(MSIZE
)
34 ifeq ($(CONFIG_PPC64
),y
)
40 ZLINKFLAGS
= -T ..
/vmlinux.lds
-Ttext
0x00800000
44 OBJECTS
:= head.o misc.o ..
/coffboot
/zlib.o
45 CFLAGS
= -O2
-DSTDC_HEADERS
-fno-builtin
-I
$(TOPDIR
)/include
46 OBJCOPY
= $(CROSS_COMPILE
)objcopy
47 OBJCOPY_ARGS
= -O elf32-powerpc
49 OBJECTS
+= vreset.o kbd.o of1275.o
50 ifeq ($(CONFIG_SERIAL_CONSOLE
),y
)
56 zvmlinux.initrd
: zvmlinux
57 $(LD
) $(ZLINKFLAGS
) -o zvmlinux.initrd.tmp
$(OBJECTS
)
58 $(OBJCOPY
) $(OBJCOPY_ARGS
) -R .comment \
59 --add-section
=initrd
=ramdisk.image.gz \
60 --add-section
=image
=..
/coffboot
/vmlinux.gz \
61 zvmlinux.initrd.tmp zvmlinux.initrd
62 $(CC
) $(CFLAGS
) -DINITRD_OFFSET
=`sh offset $(OBJDUMP) zvmlinux.initrd initrd` \
63 -DINITRD_SIZE
=`sh size $(OBJDUMP) zvmlinux.initrd initrd` \
64 -DZIMAGE_OFFSET
=`sh offset $(OBJDUMP) zvmlinux.initrd image` \
65 -DZIMAGE_SIZE
=`sh size $(OBJDUMP) zvmlinux.initrd image` \
67 $(LD
) $(ZLINKFLAGS
) -o zvmlinux.initrd.tmp
$(OBJECTS
)
68 $(OBJCOPY
) $(OBJCOPY_ARGS
) -R .comment \
69 --add-section
=initrd
=ramdisk.image.gz \
70 --add-section
=image
=..
/coffboot
/vmlinux.gz \
71 zvmlinux.initrd.tmp
$@
72 rm zvmlinux.initrd.tmp
74 zImage
: zvmlinux mkprep sImage
75 .
/mkprep
-pbp zvmlinux zImage
77 sImage
: ..
/..
/..
/vmlinux
79 $(OBJCOPY
) -I elf32-powerpc
-O binary ..
/..
/..
/vmlinux sImage
83 zImage.initrd
: zvmlinux.initrd mkprep
84 .
/mkprep
-pbp zvmlinux.initrd zImage.initrd
86 zvmlinux
: $(OBJECTS
) ..
/coffboot
/vmlinux.gz
88 # build the boot loader image and then compute the offset into it
89 # for the kernel image
91 $(LD
) $(ZLINKFLAGS
) -o zvmlinux.tmp
$(OBJECTS
)
92 $(OBJCOPY
) $(OBJCOPY_ARGS
) -R .comment
--add-section
=image
=..
/coffboot
/vmlinux.gz \
95 # then with the offset rebuild the bootloader so we know where the kernel is
97 $(CC
) $(CFLAGS
) -DINITRD_OFFSET
=0 -DINITRD_SIZE
=0 \
98 -DZIMAGE_OFFSET
=`sh offset $(OBJDUMP) zvmlinux image` \
99 -DZIMAGE_SIZE
=`sh size $(OBJDUMP) zvmlinux image` \
101 $(LD
) $(ZLINKFLAGS
) -o zvmlinux.tmp
$(OBJECTS
)
102 $(OBJCOPY
) $(OBJCOPY_ARGS
) -R .comment
--add-section
=image
=..
/coffboot
/vmlinux.gz \
106 floppy
: $(TOPDIR
)/vmlinux zImage
107 dd if
=zImage of
=/dev
/fd0H1440 bs
=64b
110 $(HOSTCC
) -o mkprep mkprep.c
113 cp zImage
$(TFTPIMAGE
)
118 znetboot.initrd
: zImage.initrd
119 cp zImage.initrd
$(TFTPIMAGE
)
122 rm -f vmlinux
* zvmlinux
* mkprep zImage
*
125 $(TOPDIR
)/scripts
/mkdep
*.
[Sch
] > .depend
128 $(CPP
) -M
*.S
*.c
> .depend
130 # just here to match coffboot/Makefile