Ok. I didn't make 2.4.0 in 2000. Tough. I tried, but we had some
[davej-history.git] / arch / ppc / boot / Makefile
blob26961e8ea5ac2da533d616611673369dfa75333c
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) -D__BOOTER__ -c -o $*.o $<
18 .S.s:
19 $(CPP) $(AFLAGS) -traditional -o $*.o $<
20 .S.o:
21 $(CC) $(AFLAGS) -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_SMP),y)
39 TFTPSIMAGE=/tftpboot/sImage.smp
40 else
41 TFTPSIMAGE=/tftpboot/sImage
42 endif
44 ifeq ($(CONFIG_PPC64BRIDGE),y)
45 MSIZE=.64
46 else
47 MSIZE=
48 endif
50 ZLINKFLAGS = -T ../vmlinux.lds -Ttext 0x00800000
52 GZIP_FLAGS = -v9f
54 OBJECTS := head.o misc.o ../coffboot/zlib.o
55 CFLAGS = $(CPPFLAGS) -O2 -DSTDC_HEADERS -fno-builtin
56 OBJCOPY_ARGS = -O elf32-powerpc
58 OBJECTS += vreset.o kbd.o of1275.o
59 ifeq ($(CONFIG_SERIAL_CONSOLE),y)
60 OBJECTS += ns16550.o
61 endif
63 all: zImage
65 zvmlinux.initrd: zvmlinux
66 $(LD) $(ZLINKFLAGS) -o zvmlinux.initrd.tmp $(OBJECTS)
67 $(OBJCOPY) $(OBJCOPY_ARGS) -R .comment \
68 --add-section=initrd=ramdisk.image.gz \
69 --add-section=image=../coffboot/vmlinux.gz \
70 zvmlinux.initrd.tmp zvmlinux.initrd
71 $(CC) $(CFLAGS) -DINITRD_OFFSET=`sh offset $(OBJDUMP) zvmlinux.initrd initrd` \
72 -DINITRD_SIZE=`sh size $(OBJDUMP) zvmlinux.initrd initrd` \
73 -DZIMAGE_OFFSET=`sh offset $(OBJDUMP) zvmlinux.initrd image` \
74 -DZIMAGE_SIZE=`sh size $(OBJDUMP) zvmlinux.initrd image` \
75 -D__BOOTER__ \
76 -c -o misc.o misc.c
77 $(LD) $(ZLINKFLAGS) -o zvmlinux.initrd.tmp $(OBJECTS)
78 $(OBJCOPY) $(OBJCOPY_ARGS) -R .comment \
79 --add-section=initrd=ramdisk.image.gz \
80 --add-section=image=../coffboot/vmlinux.gz \
81 zvmlinux.initrd.tmp $@
82 rm zvmlinux.initrd.tmp
84 zImage: zvmlinux mkprep sImage
85 ifdef CONFIG_PREP
86 ./mkprep -pbp zvmlinux zImage
87 endif
88 ifdef CONFIG_APUS
89 $(STRIP) ../../../vmlinux -o vmapus
90 gzip $(GZIP_FLAGS) vmapus
91 endif
93 sImage: ../../../vmlinux
94 ifdef CONFIG_GEMINI
95 $(OBJCOPY) -I elf32-powerpc -O binary ../../../vmlinux sImage
96 endif
98 zImage.initrd: zvmlinux.initrd mkprep
99 ifdef CONFIG_PREP
100 ./mkprep -pbp zvmlinux.initrd zImage.initrd
101 endif
103 zvmlinux: $(OBJECTS) ../coffboot/vmlinux.gz
105 # build the boot loader image and then compute the offset into it
106 # for the kernel image
108 $(LD) $(ZLINKFLAGS) -o zvmlinux.tmp $(OBJECTS)
109 $(OBJCOPY) $(OBJCOPY_ARGS) -R .comment --add-section=image=../coffboot/vmlinux.gz \
110 zvmlinux.tmp $@
112 # then with the offset rebuild the bootloader so we know where the kernel is
114 $(CC) $(CFLAGS) -DINITRD_OFFSET=0 -DINITRD_SIZE=0 \
115 -DZIMAGE_OFFSET=`sh offset $(OBJDUMP) zvmlinux image` \
116 -DZIMAGE_SIZE=`sh size $(OBJDUMP) zvmlinux image` \
117 -D__BOOTER__ \
118 -c -o misc.o misc.c
119 $(LD) $(ZLINKFLAGS) -o zvmlinux.tmp $(OBJECTS)
120 $(OBJCOPY) $(OBJCOPY_ARGS) -R .comment --add-section=image=../coffboot/vmlinux.gz \
121 zvmlinux.tmp $@
122 rm zvmlinux.tmp
124 floppy: $(TOPDIR)/vmlinux zImage
125 dd if=zImage of=/dev/fd0H1440 bs=64b
127 mkprep : mkprep.c
128 $(HOSTCC) -o mkprep mkprep.c
130 znetboot : zImage
131 ifdef CONFIG_PREP
132 cp zImage $(TFTPIMAGE)
133 endif
134 ifdef CONFIG_GEMINI
135 cp sImage $(TFTPSIMAGE)
136 endif
138 znetboot.initrd : zImage.initrd
139 cp zImage.initrd $(TFTPIMAGE)
141 clean:
142 rm -f vmlinux* zvmlinux* mkprep zImage* sImage*
144 fastdep:
145 $(TOPDIR)/scripts/mkdep *.[Sch] > .depend
147 dep:
148 $(CPP) $(CPPFLAGS) -M *.S *.c > .depend
150 # just here to match coffboot/Makefile
151 vmlinux.coff:
153 vmlinux.coff.initrd: