Import 2.3.18pre1
[davej-history.git] / arch / ppc / boot / Makefile
blob9e637aa7b44b8aae48f228b8538132553873fe30
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
6 # for more details.
8 # Copyright (C) 1994 by Linus Torvalds
9 # Adapted for PowerPC by Gary Thomas
10 # modified by Cort (cort@cs.nmt.edu)
12 .c.s:
13 $(CC) $(CFLAGS) -S -o $*.s $<
14 .s.o:
15 $(AS) -o $*.o $<
16 .c.o:
17 $(CC) $(CFLAGS) -DINITRD_OFFSET=$(IOFF) -DINITRD_SIZE=$(ISZ) -DZIMAGE_OFFSET=$(ZOFF) -DZIMAGE_SIZE=$(ZSZ) -c -o $*.o $<
18 .S.s:
19 $(CC) -D__ASSEMBLY__ -traditional -E -o $*.o $<
20 .S.o:
21 $(CC) -D__ASSEMBLY__ -traditional -c -o $*.o $<
23 ZOFF = 0
24 ZSZ = 0
25 IOFF = 0
26 ISZ = 0
28 ifeq ($(CONFIG_SMP),y)
29 TFTPIMAGE=/tftpboot/zImage.prep.smp$(MSIZE)
30 else
31 TFTPIMAGE=/tftpboot/zImage.prep$(MSIZE)
32 endif
34 ifeq ($(CONFIG_PPC64),y)
35 MSIZE=.64
36 else
37 MSIZE=
38 endif
40 ZLINKFLAGS = -T ../vmlinux.lds -Ttext 0x00800000
42 GZIP_FLAGS = -v9
44 OBJECTS := head.o misc.o ../coffboot/zlib.o
45 CFLAGS = -O2 -DSTDC_HEADERS -fno-builtin -I$(TOPDIR)/include
46 OBJCOPY = $(CROSS_COMPILE)objcopy
47 OBJCOPY_ARGS = -O elf32-powerpc
49 OBJECTS += vreset.o kbd.o of1275.o
50 ifeq ($(CONFIG_SERIAL_CONSOLE),y)
51 OBJECTS += ns16550.o
52 endif
54 all: zImage
56 zvmlinux.initrd: zvmlinux
57 $(LD) $(ZLINKFLAGS) -o zvmlinux.initrd.tmp $(OBJECTS)
58 $(OBJCOPY) $(OBJCOPY_ARGS) -R .comment \
59 --add-section=initrd=ramdisk.image.gz \
60 --add-section=image=../coffboot/vmlinux.gz \
61 zvmlinux.initrd.tmp zvmlinux.initrd
62 $(CC) $(CFLAGS) -DINITRD_OFFSET=`sh offset $(OBJDUMP) zvmlinux.initrd initrd` \
63 -DINITRD_SIZE=`sh size $(OBJDUMP) zvmlinux.initrd initrd` \
64 -DZIMAGE_OFFSET=`sh offset $(OBJDUMP) zvmlinux.initrd image` \
65 -DZIMAGE_SIZE=`sh size $(OBJDUMP) zvmlinux.initrd image` \
66 -c -o misc.o misc.c
67 $(LD) $(ZLINKFLAGS) -o zvmlinux.initrd.tmp $(OBJECTS)
68 $(OBJCOPY) $(OBJCOPY_ARGS) -R .comment \
69 --add-section=initrd=ramdisk.image.gz \
70 --add-section=image=../coffboot/vmlinux.gz \
71 zvmlinux.initrd.tmp $@
72 rm zvmlinux.initrd.tmp
74 zImage: zvmlinux mkprep sImage
75 ./mkprep -pbp zvmlinux zImage
77 sImage: ../../../vmlinux
78 ifdef CONFIG_GEMINI
79 $(OBJCOPY) -I elf32-powerpc -O binary ../../../vmlinux sImage
80 else
81 endif
83 zImage.initrd: zvmlinux.initrd mkprep
84 ./mkprep -pbp zvmlinux.initrd zImage.initrd
86 zvmlinux: $(OBJECTS) ../coffboot/vmlinux.gz
88 # build the boot loader image and then compute the offset into it
89 # for the kernel image
91 $(LD) $(ZLINKFLAGS) -o zvmlinux.tmp $(OBJECTS)
92 $(OBJCOPY) $(OBJCOPY_ARGS) -R .comment --add-section=image=../coffboot/vmlinux.gz \
93 zvmlinux.tmp $@
95 # then with the offset rebuild the bootloader so we know where the kernel is
97 $(CC) $(CFLAGS) -DINITRD_OFFSET=0 -DINITRD_SIZE=0 \
98 -DZIMAGE_OFFSET=`sh offset $(OBJDUMP) zvmlinux image` \
99 -DZIMAGE_SIZE=`sh size $(OBJDUMP) zvmlinux image` \
100 -c -o misc.o misc.c
101 $(LD) $(ZLINKFLAGS) -o zvmlinux.tmp $(OBJECTS)
102 $(OBJCOPY) $(OBJCOPY_ARGS) -R .comment --add-section=image=../coffboot/vmlinux.gz \
103 zvmlinux.tmp $@
104 rm zvmlinux.tmp
106 floppy: $(TOPDIR)/vmlinux zImage
107 dd if=zImage of=/dev/fd0H1440 bs=64b
109 mkprep : mkprep.c
110 $(HOSTCC) -o mkprep mkprep.c
112 znetboot : zImage
113 cp zImage $(TFTPIMAGE)
114 ifdef CONFIG_GEMINI
115 cp sImage /tftpboot/
116 endif
118 znetboot.initrd : zImage.initrd
119 cp zImage.initrd $(TFTPIMAGE)
121 clean:
122 rm -f vmlinux* zvmlinux* mkprep zImage*
124 fastdep:
125 $(TOPDIR)/scripts/mkdep *.[Sch] > .depend
127 dep:
128 $(CPP) -M *.S *.c > .depend
130 # just here to match coffboot/Makefile
131 vmlinux.coff:
133 vmlinux.coff.initrd: