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_ALL_PPC
),y
)
32 ifeq ($(CONFIG_SMP
),y
)
33 TFTPIMAGE
=/tftpboot
/zImage.prep.smp
$(MSIZE
)
35 TFTPIMAGE
=/tftpboot
/zImage.prep
$(MSIZE
)
38 ifeq ($(CONFIG_PPC64
),y
)
44 ZLINKFLAGS
= -T ..
/vmlinux.lds
-Ttext
0x00800000
48 OBJECTS
:= head.o misc.o ..
/coffboot
/zlib.o
49 CFLAGS
= -O2
-DSTDC_HEADERS
-fno-builtin
-I
$(TOPDIR
)/include
50 OBJCOPY
= $(CROSS_COMPILE
)objcopy
51 OBJCOPY_ARGS
= -O elf32-powerpc
53 OBJECTS
+= vreset.o kbd.o of1275.o
54 ifeq ($(CONFIG_SERIAL_CONSOLE
),y
)
60 zvmlinux.initrd
: zvmlinux
61 $(LD
) $(ZLINKFLAGS
) -o zvmlinux.initrd.tmp
$(OBJECTS
)
62 $(OBJCOPY
) $(OBJCOPY_ARGS
) -R .comment \
63 --add-section
=initrd
=ramdisk.image.gz \
64 --add-section
=image
=..
/coffboot
/vmlinux.gz \
65 zvmlinux.initrd.tmp zvmlinux.initrd
66 $(CC
) $(CFLAGS
) -DINITRD_OFFSET
=`sh offset $(OBJDUMP) zvmlinux.initrd initrd` \
67 -DINITRD_SIZE
=`sh size $(OBJDUMP) zvmlinux.initrd initrd` \
68 -DZIMAGE_OFFSET
=`sh offset $(OBJDUMP) zvmlinux.initrd image` \
69 -DZIMAGE_SIZE
=`sh size $(OBJDUMP) zvmlinux.initrd image` \
71 $(LD
) $(ZLINKFLAGS
) -o zvmlinux.initrd.tmp
$(OBJECTS
)
72 $(OBJCOPY
) $(OBJCOPY_ARGS
) -R .comment \
73 --add-section
=initrd
=ramdisk.image.gz \
74 --add-section
=image
=..
/coffboot
/vmlinux.gz \
75 zvmlinux.initrd.tmp
$@
76 rm zvmlinux.initrd.tmp
78 zImage
: zvmlinux mkprep sImage
80 .
/mkprep
-pbp zvmlinux zImage
83 sImage
: ..
/..
/..
/vmlinux
85 $(OBJCOPY
) -I elf32-powerpc
-O binary ..
/..
/..
/vmlinux sImage
88 zImage.initrd
: zvmlinux.initrd mkprep
90 .
/mkprep
-pbp zvmlinux.initrd zImage.initrd
93 zvmlinux
: $(OBJECTS
) ..
/coffboot
/vmlinux.gz
95 # build the boot loader image and then compute the offset into it
96 # for the kernel image
98 $(LD
) $(ZLINKFLAGS
) -o zvmlinux.tmp
$(OBJECTS
)
99 $(OBJCOPY
) $(OBJCOPY_ARGS
) -R .comment
--add-section
=image
=..
/coffboot
/vmlinux.gz \
102 # then with the offset rebuild the bootloader so we know where the kernel is
104 $(CC
) $(CFLAGS
) -DINITRD_OFFSET
=0 -DINITRD_SIZE
=0 \
105 -DZIMAGE_OFFSET
=`sh offset $(OBJDUMP) zvmlinux image` \
106 -DZIMAGE_SIZE
=`sh size $(OBJDUMP) zvmlinux image` \
108 $(LD
) $(ZLINKFLAGS
) -o zvmlinux.tmp
$(OBJECTS
)
109 $(OBJCOPY
) $(OBJCOPY_ARGS
) -R .comment
--add-section
=image
=..
/coffboot
/vmlinux.gz \
113 floppy
: $(TOPDIR
)/vmlinux zImage
114 dd if
=zImage of
=/dev
/fd0H1440 bs
=64b
117 $(HOSTCC
) -o mkprep mkprep.c
121 cp zImage
$(TFTPIMAGE
)
127 znetboot.initrd
: zImage.initrd
128 cp zImage.initrd
$(TFTPIMAGE
)
131 rm -f vmlinux
* zvmlinux
* mkprep zImage
*
134 $(TOPDIR
)/scripts
/mkdep
*.
[Sch
] > .depend
137 $(CPP
) -M
*.S
*.c
> .depend
139 # just here to match coffboot/Makefile