* added 0.99 linux version
[mascara-docs.git] / i386 / linux / linux-2.3.21 / arch / ppc / boot / Makefile
blob8709e3729aeed98fa3db21d397585d9acf17e69d
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_ALL_PPC),y)
29 CONFIG_PREP=y
30 endif
32 ifeq ($(CONFIG_SMP),y)
33 TFTPIMAGE=/tftpboot/zImage.prep.smp$(MSIZE)
34 else
35 TFTPIMAGE=/tftpboot/zImage.prep$(MSIZE)
36 endif
38 ifeq ($(CONFIG_PPC64),y)
39 MSIZE=.64
40 else
41 MSIZE=
42 endif
44 ZLINKFLAGS = -T ../vmlinux.lds -Ttext 0x00800000
46 GZIP_FLAGS = -v9
48 OBJECTS := head.o misc.o ../coffboot/zlib.o
49 CFLAGS = -O2 -DSTDC_HEADERS -fno-builtin -I$(TOPDIR)/include
50 OBJCOPY = $(CROSS_COMPILE)objcopy
51 OBJCOPY_ARGS = -O elf32-powerpc
53 OBJECTS += vreset.o kbd.o of1275.o
54 ifeq ($(CONFIG_SERIAL_CONSOLE),y)
55 OBJECTS += ns16550.o
56 endif
58 all: zImage
60 zvmlinux.initrd: zvmlinux
61 $(LD) $(ZLINKFLAGS) -o zvmlinux.initrd.tmp $(OBJECTS)
62 $(OBJCOPY) $(OBJCOPY_ARGS) -R .comment \
63 --add-section=initrd=ramdisk.image.gz \
64 --add-section=image=../coffboot/vmlinux.gz \
65 zvmlinux.initrd.tmp zvmlinux.initrd
66 $(CC) $(CFLAGS) -DINITRD_OFFSET=`sh offset $(OBJDUMP) zvmlinux.initrd initrd` \
67 -DINITRD_SIZE=`sh size $(OBJDUMP) zvmlinux.initrd initrd` \
68 -DZIMAGE_OFFSET=`sh offset $(OBJDUMP) zvmlinux.initrd image` \
69 -DZIMAGE_SIZE=`sh size $(OBJDUMP) zvmlinux.initrd image` \
70 -c -o misc.o misc.c
71 $(LD) $(ZLINKFLAGS) -o zvmlinux.initrd.tmp $(OBJECTS)
72 $(OBJCOPY) $(OBJCOPY_ARGS) -R .comment \
73 --add-section=initrd=ramdisk.image.gz \
74 --add-section=image=../coffboot/vmlinux.gz \
75 zvmlinux.initrd.tmp $@
76 rm zvmlinux.initrd.tmp
78 zImage: zvmlinux mkprep sImage
79 ifdef CONFIG_PREP
80 ./mkprep -pbp zvmlinux zImage
81 endif
83 sImage: ../../../vmlinux
84 ifdef CONFIG_GEMINI
85 $(OBJCOPY) -I elf32-powerpc -O binary ../../../vmlinux sImage
86 endif
88 zImage.initrd: zvmlinux.initrd mkprep
89 ifdef CONFIG_PREP
90 ./mkprep -pbp zvmlinux.initrd zImage.initrd
91 endif
93 zvmlinux: $(OBJECTS) ../coffboot/vmlinux.gz
95 # build the boot loader image and then compute the offset into it
96 # for the kernel image
98 $(LD) $(ZLINKFLAGS) -o zvmlinux.tmp $(OBJECTS)
99 $(OBJCOPY) $(OBJCOPY_ARGS) -R .comment --add-section=image=../coffboot/vmlinux.gz \
100 zvmlinux.tmp $@
102 # then with the offset rebuild the bootloader so we know where the kernel is
104 $(CC) $(CFLAGS) -DINITRD_OFFSET=0 -DINITRD_SIZE=0 \
105 -DZIMAGE_OFFSET=`sh offset $(OBJDUMP) zvmlinux image` \
106 -DZIMAGE_SIZE=`sh size $(OBJDUMP) zvmlinux image` \
107 -c -o misc.o misc.c
108 $(LD) $(ZLINKFLAGS) -o zvmlinux.tmp $(OBJECTS)
109 $(OBJCOPY) $(OBJCOPY_ARGS) -R .comment --add-section=image=../coffboot/vmlinux.gz \
110 zvmlinux.tmp $@
111 rm zvmlinux.tmp
113 floppy: $(TOPDIR)/vmlinux zImage
114 dd if=zImage of=/dev/fd0H1440 bs=64b
116 mkprep : mkprep.c
117 $(HOSTCC) -o mkprep mkprep.c
119 znetboot : zImage
120 ifdef CONFIG_PREP
121 cp zImage $(TFTPIMAGE)
122 endif
123 ifdef CONFIG_GEMINI
124 cp sImage /tftpboot/
125 endif
127 znetboot.initrd : zImage.initrd
128 cp zImage.initrd $(TFTPIMAGE)
130 clean:
131 rm -f vmlinux* zvmlinux* mkprep zImage*
133 fastdep:
134 $(TOPDIR)/scripts/mkdep *.[Sch] > .depend
136 dep:
137 $(CPP) -M *.S *.c > .depend
139 # just here to match coffboot/Makefile
140 vmlinux.coff:
142 vmlinux.coff.initrd: