import of ftp.dlink.com/GPL/DSMG-600_reB/ppclinux.tar.gz
[linux-2.4.21-pre4.git] / arch / ppc / boot / prep / Makefile
1 # BK Id: SCCS/s.Makefile 1.30 11/19/01 09:04:20 trini
2 #
3 # arch/ppc/boot/Makefile
4 #
5 # This file is subject to the terms and conditions of the GNU General Public
6 # License.  See the file "COPYING" in the main directory of this archive
7 # for more details.
8 #
9 # Tom Rini      January 2001
10 #
11 # Originally:
12 # arch/ppc/boot/Makefile
13 # Copyright (C) 1994 by Linus Torvalds
14 # Adapted for PowerPC by Gary Thomas
15 # modified by Cort (cort@cs.nmt.edu)
16 #
17
18 USE_STANDARD_AS_RULE            := true
19
20 TFTPIMAGE                       = /tftpboot/zImage.prep
21 ifeq ($(CONFIG_SMP),y)
22 TFTPIMAGE                       = $(TFTPBOOT).smp
23 endif
24
25 LD_ARGS                         = -T ../ld.script -Ttext 0x00800000 -Bstatic
26 obj-y                           := head.o ../simple/legacy.o misc.o \
27                                         ../common/util.o ../common/string.o \
28                                         ../common/misc-common.o \
29                                         ../common/mpc10x_memory.o \
30                                         ../common/serial_stub.o
31 OBJCOPY_ARGS                    = -O elf32-powerpc
32 LIBS                            = ../lib/zlib.a
33
34 obj-$(CONFIG_SERIAL_CONSOLE)    += ../common/ns16550.o
35 obj-$(CONFIG_VGA_CONSOLE)       += vreset.o kbd.o
36
37 # Tools
38 MKPREP                          := ../utils/mkprep
39 SIZE                            := ../utils/size
40 OFFSET                          := ../utils/offset
41
42 # Extra include search dirs
43 CFLAGS_kbd.o                    += -I$(TOPDIR)/drivers/char
44
45 all: zImage
46
47 zImage: $(obj-y) $(LIBS) ../ld.script ../images/vmlinux.gz ../common/dummy.o \
48                 $(MKPREP)
49         $(OBJCOPY) $(OBJCOPY_ARGS) -R .comment \
50                 --add-section=.image=../images/vmlinux.gz \
51                 --set-section-flags=.image=contents,alloc,load,readonly,data \
52                 ../common/dummy.o image.o
53         $(LD) $(LD_ARGS) -o $@ $(obj-y) image.o $(LIBS)
54         $(OBJCOPY) $(OBJCOPY_ARGS) $@ $@ -R .comment -R .stab -R .stabstr
55         $(MKPREP) -pbp $@ ../images/$@.prep
56         rm -f $@
57
58 zImage.initrd: $(obj-y) $(LIBS) ../ld.script ../images/vmlinux.gz $(MKPREP) \
59                 ../common/dummy.o
60         $(OBJCOPY) $(OBJCOPY_ARGS) -R .comment \
61                 --add-section=.ramdisk=../images/ramdisk.image.gz \
62                 --set-section-flags=.ramdisk=contents,alloc,load,readonly,data \
63                 --add-section=.image=../images/vmlinux.gz \
64                 --set-section-flags=.image=contents,alloc,load,readonly,data \
65                 ../common/dummy.o image.o
66         $(LD) $(LD_ARGS) -o $@ $(obj-y) image.o $(LIBS)
67         $(OBJCOPY) $(OBJCOPY_ARGS) $@ $@ -R .comment -R .stab -R .stabstr
68         $(MKPREP) -pbp $@ ../images/$@.prep
69         rm -f $@
70
71 floppy: zImage
72         dd if=../images/zImage.prep of=/dev/fd0H1440 bs=64b
73
74 znetboot : zImage
75         cp ../images/zImage.prep $(TFTPIMAGE)
76
77 znetboot.initrd : zImage.initrd
78         cp ../images/zImage.initrd.prep $(TFTPIMAGE)
79
80 include $(TOPDIR)/Rules.make