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
) -D__BOOTER__
-c
-o
$*.o
$<
19 $(CPP
) $(AFLAGS
) -traditional
-o
$*.o
$<
21 $(CC
) $(AFLAGS
) -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_SMP
),y
)
39 TFTPSIMAGE
=/tftpboot
/sImage.smp
41 TFTPSIMAGE
=/tftpboot
/sImage
44 ifeq ($(CONFIG_PPC64BRIDGE
),y
)
50 ZLINKFLAGS
= -T ..
/vmlinux.lds
-Ttext
0x00800000
54 OBJECTS
:= head.o misc.o ..
/coffboot
/zlib.o
55 CFLAGS
= $(CPPFLAGS
) -O2
-DSTDC_HEADERS
-fno-builtin
56 OBJCOPY_ARGS
= -O elf32-powerpc
58 OBJECTS
+= vreset.o kbd.o of1275.o
59 ifeq ($(CONFIG_SERIAL_CONSOLE
),y
)
65 zvmlinux.initrd
: zvmlinux
66 $(LD
) $(ZLINKFLAGS
) -o zvmlinux.initrd.tmp
$(OBJECTS
)
67 $(OBJCOPY
) $(OBJCOPY_ARGS
) -R .comment \
68 --add-section
=initrd
=ramdisk.image.gz \
69 --add-section
=image
=..
/coffboot
/vmlinux.gz \
70 zvmlinux.initrd.tmp zvmlinux.initrd
71 $(CC
) $(CFLAGS
) -DINITRD_OFFSET
=`sh offset $(OBJDUMP) zvmlinux.initrd initrd` \
72 -DINITRD_SIZE
=`sh size $(OBJDUMP) zvmlinux.initrd initrd` \
73 -DZIMAGE_OFFSET
=`sh offset $(OBJDUMP) zvmlinux.initrd image` \
74 -DZIMAGE_SIZE
=`sh size $(OBJDUMP) zvmlinux.initrd image` \
77 $(LD
) $(ZLINKFLAGS
) -o zvmlinux.initrd.tmp
$(OBJECTS
)
78 $(OBJCOPY
) $(OBJCOPY_ARGS
) -R .comment \
79 --add-section
=initrd
=ramdisk.image.gz \
80 --add-section
=image
=..
/coffboot
/vmlinux.gz \
81 zvmlinux.initrd.tmp
$@
82 rm zvmlinux.initrd.tmp
84 zImage
: zvmlinux mkprep sImage
86 .
/mkprep
-pbp zvmlinux zImage
89 $(STRIP
) ..
/..
/..
/vmlinux
-o vmapus
90 gzip
$(GZIP_FLAGS
) vmapus
93 sImage
: ..
/..
/..
/vmlinux
95 $(OBJCOPY
) -I elf32-powerpc
-O binary ..
/..
/..
/vmlinux sImage
98 zImage.initrd
: zvmlinux.initrd mkprep
100 .
/mkprep
-pbp zvmlinux.initrd zImage.initrd
103 zvmlinux
: $(OBJECTS
) ..
/coffboot
/vmlinux.gz
105 # build the boot loader image and then compute the offset into it
106 # for the kernel image
108 $(LD
) $(ZLINKFLAGS
) -o zvmlinux.tmp
$(OBJECTS
)
109 $(OBJCOPY
) $(OBJCOPY_ARGS
) -R .comment
--add-section
=image
=..
/coffboot
/vmlinux.gz \
112 # then with the offset rebuild the bootloader so we know where the kernel is
114 $(CC
) $(CFLAGS
) -DINITRD_OFFSET
=0 -DINITRD_SIZE
=0 \
115 -DZIMAGE_OFFSET
=`sh offset $(OBJDUMP) zvmlinux image` \
116 -DZIMAGE_SIZE
=`sh size $(OBJDUMP) zvmlinux image` \
119 $(LD
) $(ZLINKFLAGS
) -o zvmlinux.tmp
$(OBJECTS
)
120 $(OBJCOPY
) $(OBJCOPY_ARGS
) -R .comment
--add-section
=image
=..
/coffboot
/vmlinux.gz \
124 floppy
: $(TOPDIR
)/vmlinux zImage
125 dd if
=zImage of
=/dev
/fd0H1440 bs
=64b
128 $(HOSTCC
) -o mkprep mkprep.c
132 cp zImage
$(TFTPIMAGE
)
135 cp sImage
$(TFTPSIMAGE
)
138 znetboot.initrd
: zImage.initrd
139 cp zImage.initrd
$(TFTPIMAGE
)
142 rm -f vmlinux
* zvmlinux
* mkprep zImage
* sImage
*
145 $(TOPDIR
)/scripts
/mkdep
*.
[Sch
] > .depend
148 $(CPP
) $(CPPFLAGS
) -M
*.S
*.c
> .depend
150 # just here to match coffboot/Makefile