import of ftp.dlink.com/GPL/DSMG-600_reB/ppclinux.tar.gz
[linux-2.4.21-pre4.git] / arch / ppc / boot / chrp / Makefile
1 # BK Id: SCCS/s.Makefile 1.24 03/12/02 16:14:59 paulus
2 #
3 # Makefile for making ELF bootable images for booting on CHRP
4 # using Open Firmware.
5 #
6 # Geert Uytterhoeven    September 1997
7 #
8 # Based on coffboot by Paul Mackerras
9
10 USE_STANDARD_AS_RULE := true
11
12 LD_ARGS = -T ../ld.script -Ttext 0x00400000
13
14 OBJS = ../common/crt0.o start.o main.o misc.o ../common/string.o image.o \
15         ../common/ofcommon.o
16 LIBS = $(TOPDIR)/lib/lib.a ../lib/zlib.a
17 ADDNOTE = ../utils/addnote
18 PIGGYBACK = ../utils/piggyback
19
20 ifeq ($(CONFIG_PPC64BRIDGE),y)
21 END += .64
22 AFLAGS += -Wa,-mppc64bridge
23 endif
24 ifeq ($(CONFIG_SMP),y)
25 END += .smp
26 endif
27
28 TFTPIMAGE=/tftpboot/zImage.chrp$(END)
29
30 AFLAGS_../common/crt0.o         += -I$(TOPDIR)/arch/$(ARCH)/kernel
31
32 all: zImage
33
34 znetboot: zImage
35         cp -f $(TOPDIR)/vmlinux /tftpboot/vmlinux$(END)
36         cp ../images/zImage.chrp $(TFTPIMAGE)
37
38 znetboot.initrd: zImage.initrd
39         cp ../images/zImage.initrd.chrp $(TFTPIMAGE)
40
41 floppy: zImage
42         mcopy zImage a:zImage
43
44 image.o: ../images/vmlinux.gz ../common/dummy.o
45         $(OBJCOPY) ../common/dummy.o $@ \
46                 --add-section=.image=../images/vmlinux.gz \
47                 --set-section-flags=.image=contents,alloc,load,readonly,data
48 ifdef CONFIG_XMON
49         $(OBJCOPY) $@ $@ \
50                 --add-section=.sysmap=$(TOPDIR)/System.map \
51                 --set-section-flags=.sysmap=contents,alloc,load,readonly,data
52 endif
53
54 zImage: $(OBJS) $(LIBS) $(ADDNOTE)
55         $(LD) $(LD_ARGS) -o ../images/$@.chrp $(OBJS) $(LIBS)
56         $(OBJCOPY) ../images/$@.chrp ../images/$@.chrp -R .comment -R .ramdisk
57         cp ../images/$@.chrp ../images/$@.chrp-rs6k
58         $(ADDNOTE) ../images/$@.chrp-rs6k
59
60 zImage.initrd: $(OBJS) $(LIBS) $(ADDNOTE) ../images/ramdisk.image.gz
61         $(OBJCOPY) image.o image.o \
62                 --add-section=.ramdisk=../images/ramdisk.image.gz \
63                 --set-section-flags=.ramdisk=contents,alloc,load,readonly,data
64         $(LD) $(LD_ARGS) -o ../images/$@.chrp $(OBJS) $(LIBS)
65         $(OBJCOPY) ../images/$@.chrp ../images/$@.chrp -R .comment
66         cp ../images/$@.chrp ../images/$@.chrp-rs6k
67         $(ADDNOTE) ../images/$@.chrp-rs6k
68
69 include $(TOPDIR)/Rules.make