1#
2# arch/ppc/boot/Makefile
3#
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
6# for more details.
7#
8# Tom Rini	January 2001
9#
10# Originally:
11# arch/ppc/boot/Makefile
12# Copyright (C) 1994 by Linus Torvalds
13# Adapted for PowerPC by Gary Thomas
14# modified by Cort (cort@cs.nmt.edu)
15#
16
17USE_STANDARD_AS_RULE		:= true
18
19TFTPIMAGE			= /tftpboot/zImage.prep
20ifeq ($(CONFIG_SMP),y)
21TFTPIMAGE			:= $(TFTPIMAGE).smp
22endif
23
24LD_ARGS				= -T ../ld.script -Ttext 0x00800000 -Bstatic
25obj-y				:= head.o ../simple/legacy.o misc.o \
26					../common/util.o ../common/string.o \
27					../common/misc-common.o \
28					../common/serial_stub.o
29OBJCOPY_ARGS			= -O elf32-powerpc
30LIBS 				= ../lib/zlib.a ../of1275/of1275.a
31
32obj-$(CONFIG_SERIAL_CONSOLE)	+= ../common/ns16550.o
33obj-$(CONFIG_VGA_CONSOLE)	+= vreset.o kbd.o
34
35# Tools
36MKPREP				:= ../utils/mkprep
37SIZE				:= ../utils/size
38OFFSET				:= ../utils/offset
39
40# Extra include search dirs
41CFLAGS_kbd.o			+= -I$(TOPDIR)/drivers/char
42
43all: zImage
44
45zImage: $(obj-y) $(LIBS) ../ld.script ../images/vmlinux.gz ../common/dummy.o \
46		$(MKPREP)
47	$(OBJCOPY) $(OBJCOPY_ARGS) -R .comment \
48		--add-section=.image=../images/vmlinux.gz \
49		--set-section-flags=.image=contents,alloc,load,readonly,data \
50		../common/dummy.o image.o
51	$(LD) $(LD_ARGS) -o $@ $(obj-y) image.o $(LIBS)
52	$(OBJCOPY) $(OBJCOPY_ARGS) $@ $@ -R .comment -R .stab -R .stabstr
53	$(MKPREP) -pbp $@ ../images/$@.prep
54	rm -f $@
55
56zImage.initrd: $(obj-y) $(LIBS) ../ld.script ../images/vmlinux.gz $(MKPREP) \
57		../common/dummy.o
58	$(OBJCOPY) $(OBJCOPY_ARGS) -R .comment \
59		--add-section=.ramdisk=../images/ramdisk.image.gz \
60		--set-section-flags=.ramdisk=contents,alloc,load,readonly,data \
61		--add-section=.image=../images/vmlinux.gz \
62		--set-section-flags=.image=contents,alloc,load,readonly,data \
63		../common/dummy.o image.o
64	$(LD) $(LD_ARGS) -o $@ $(obj-y) image.o $(LIBS)
65	$(OBJCOPY) $(OBJCOPY_ARGS) $@ $@ -R .comment -R .stab -R .stabstr
66	$(MKPREP) -pbp $@ ../images/$@.prep
67	rm -f $@
68
69floppy: zImage
70	dd if=../images/zImage.prep of=/dev/fd0H1440 bs=64b
71
72znetboot : zImage
73	cp ../images/zImage.prep $(TFTPIMAGE)
74
75znetboot.initrd : zImage.initrd
76	cp ../images/zImage.initrd.prep $(TFTPIMAGE)
77
78include $(TOPDIR)/Rules.make
79