summaryrefslogtreecommitdiffstats
path: root/arch/ppc/boot/Makefile
diff options
context:
space:
mode:
authorRalf Baechle <ralf@linux-mips.org>1998-03-17 22:05:47 +0000
committerRalf Baechle <ralf@linux-mips.org>1998-03-17 22:05:47 +0000
commit27cfca1ec98e91261b1a5355d10a8996464b63af (patch)
tree8e895a53e372fa682b4c0a585b9377d67ed70d0e /arch/ppc/boot/Makefile
parent6a76fb7214c477ccf6582bd79c5b4ccc4f9c41b1 (diff)
Look Ma' what I found on my harddisk ...
o New faster syscalls for 2.1.x, too o Upgrade to 2.1.89. Don't try to run this. It's flaky as hell. But feel free to debug ...
Diffstat (limited to 'arch/ppc/boot/Makefile')
-rw-r--r--arch/ppc/boot/Makefile128
1 files changed, 76 insertions, 52 deletions
diff --git a/arch/ppc/boot/Makefile b/arch/ppc/boot/Makefile
index a731ec2a0..02f95f577 100644
--- a/arch/ppc/boot/Makefile
+++ b/arch/ppc/boot/Makefile
@@ -9,94 +9,118 @@
# Adapted for PowerPC by Gary Thomas
# modified by Cort (cort@cs.nmt.edu)
#
-
.c.s:
$(CC) $(CFLAGS) -S -o $*.s $<
.s.o:
$(AS) -o $*.o $<
.c.o:
- $(CC) $(CFLAGS) -c -o $*.o $<
+ $(CC) $(CFLAGS) -DINITRD_OFFSET=$(IOFF) -DINITRD_SIZE=$(ISZ) -DZIMAGE_OFFSET=$(ZOFF) -DZIMAGE_SIZE=$(ZSZ) -DKERNELBASE=$(KERNELBASE) -c -o $*.o $<
.S.s:
$(CC) -D__ASSEMBLY__ -traditional -E -o $*.o $<
.S.o:
$(CC) -D__ASSEMBLY__ -traditional -c -o $*.o $<
-ZLINKFLAGS = -T ../vmlinux.lds -Ttext 0x00800000
+ZOFF = 0
+ZSZ = 0
+IOFF = 0
+ISZ = 0
+#ZLINKFLAGS = -T ../vmlinux.lds -Ttext 0x00800000
+ZLINKFLAGS = -T ../vmlinux.lds -Ttext 0x00600000
GZIP_FLAGS = -v9
-SYSTEM = $(TOPDIR)/vmlinux
-OBJECTS := head.o inflate.o unzip.o misc.o vreset.o kbd.o
-CFLAGS = -O2 -DSTDC_HEADERS -I$(TOPDIR)/include
+OBJECTS := head.o misc.o vreset.o kbd.o ../coffboot/zlib.o # inflate.o unzip.o
+#OBJECTS := crt0.o start.o vreset.o
+CFLAGS = -O2 -DSTDC_HEADERS -fno-builtin -I$(TOPDIR)/include
OBJCOPY = $(CROSS_COMPILE)objcopy
OBJCOPY_ARGS = -O elf32-powerpc
+all: zImage
-all: $(TOPDIR)/zImage
+ifeq ($(CONFIG_PREP),y)
mkprep : mkprep.c
- $(HOSTCC) $(CFLAGSINC) -o mkprep mkprep.c
-
-piggyback : piggyback.c
- $(HOSTCC) $(CFLAGSINC) -o piggyback piggyback.c
-
-find_name : find_name.c
- $(HOSTCC) $(CFLAGSINC) -o find_name find_name.c
-
-floppy: $(TOPDIR)/vmlinux zImage
- dd if=$(TOPDIR)/zImage of=/dev/fd0H1440 bs=64b
+ $(HOSTCC) -DKERNELBASE=$(KERNELBASE) -o mkprep mkprep.c
-floppy.initrd: $(TOPDIR)/vmlinux zImage
- dd if=$(TOPDIR)/zImage.initrd of=/dev/fd0H1440 bs=64b
+floppy: $(TOPDIR)/vmlinux zImage
+ dd if=zImage of=/dev/fd0H1440 bs=64b
-znetboot : zImage mkprep
- cp $(TOPDIR)/zImage /usr/local/tftpboot/vmlinux
+znetboot : zImage
+ cp zImage /tftpboot/zImage.prep
-znetboot.initrd : zImage.initrd mkprep
- cp $(TOPDIR)/zImage.initrd /usr/local/tftpboot/vmlinux
+znetboot.initrd : zImage.initrd
+ cp zImage.initrd /tftpboot/zImage.prep
+zvmlinux: $(OBJECTS) ../coffboot/vmlinux.gz
#
-# This really needs to go away. Perhaps a
-# zImage.prep and zImage.chrp might be better.
-# Once we're able to get a lilo-ish program
-# on prep systems this won't be a problem.
-# -- Cort
+# build the boot loader image and then compute the offset into it
+# for the kernel image
+#
+ $(LD) $(ZLINKFLAGS) -o zvmlinux.tmp $(OBJECTS)
+ $(OBJCOPY) $(OBJCOPY_ARGS) -R .comment --add-section=image=../coffboot/vmlinux.gz \
+ zvmlinux.tmp $@
#
-ifdef CONFIG_CHRP
-zImage: zvmlinux
- cp zvmlinux $(TOPDIR)/zImage
+# then with the offset rebuild the bootloader so we know where the kernel is
+#
+ $(CC) $(CFLAGS) -DINITRD_OFFSET=0 -DINITRD_SIZE=0 \
+ -DZIMAGE_OFFSET=`./offset zvmlinux image` \
+ -DZIMAGE_SIZE=`./size zvmlinux image` -DKERNELBASE=$(KERNELBASE) \
+ -c -o misc.o misc.c
+ $(LD) $(ZLINKFLAGS) -o zvmlinux.tmp $(OBJECTS)
+ $(OBJCOPY) $(OBJCOPY_ARGS) -R .comment --add-section=image=../coffboot/vmlinux.gz \
+ zvmlinux.tmp $@
+ rm zvmlinux.tmp
-zImage.initrd: zvmlinux.initrd
- cp zvmlinux.initrd $(TOPDIR)/zImage.initrd
+zvmlinux.initrd: zvmlinux
+ $(LD) $(ZLINKFLAGS) -o zvmlinux.initrd.tmp $(OBJECTS)
+ $(OBJCOPY) $(OBJCOPY_ARGS) -R .comment \
+ --add-section=initrd=ramdisk.image.gz \
+ --add-section=image=../coffboot/vmlinux.gz \
+ zvmlinux.initrd.tmp zvmlinux.initrd
+ $(CC) $(CFLAGS) -DINITRD_OFFSET=`./offset zvmlinux.initrd initrd` \
+ -DINITRD_SIZE=`./size zvmlinux.initrd initrd` \
+ -DZIMAGE_OFFSET=`./offset zvmlinux.initrd image` \
+ -DZIMAGE_SIZE=`./size zvmlinux.initrd image` \
+ -DKERNELBASE=$(KERNELBASE) -c -o misc.o misc.c
+ $(LD) $(ZLINKFLAGS) -o zvmlinux.initrd.tmp $(OBJECTS)
+ $(OBJCOPY) $(OBJCOPY_ARGS) -R .comment \
+ --add-section=initrd=ramdisk.image.gz \
+ --add-section=image=../coffboot/vmlinux.gz \
+ zvmlinux.initrd.tmp $@
+ rm zvmlinux.initrd.tmp
-zvmlinux: $(OBJECTS) $(SYSTEM) find_name vmlinux.gz piggyback
- ./piggyback < vmlinux.gz | $(AS) -o piggy.o
- $(LD) $(ZLINKFLAGS) -o $@ $(OBJECTS) piggy.o
- rm -f piggy.o
-else
zImage: zvmlinux mkprep
- mkprep -pbp zvmlinux $(TOPDIR)/zImage
+ ./mkprep -pbp zvmlinux zImage
zImage.initrd: zvmlinux.initrd mkprep
- mkprep -pbp zvmlinux.initrd $(TOPDIR)/zImage.initrd
+ ./mkprep -pbp zvmlinux.initrd zImage.initrd
+else
+mkprep:
-zvmlinux: $(OBJECTS) $(SYSTEM) mkprep find_name vmlinux.gz
- $(LD) $(ZLINKFLAGS) -o zvmlinux.tmp $(OBJECTS)
- $(OBJCOPY) $(OBJCOPY_ARGS) --add-section=image=vmlinux.gz \
- zvmlinux.tmp $@
- rm zvmlinux.tmp
+floppy:
+
+znetboot:
+
+znetboot.initrd:
+
+zvmlinux:
+
+zvmlinux.initrd:
+
+zImage:
+
+zImage.initrd:
endif
-vmlinux.gz: $(TOPDIR)/vmlinux
- dd bs=64k skip=1 if=$(TOPDIR)/vmlinux | gzip -vf9 - > vmlinux.gz
-zvmlinux.initrd: zvmlinux
- $(OBJCOPY) $(OBJCOPY_ARGS) --add-section=initrd=ramdisk.image.gz \
- zvmlinux $@
+
+# just here to match coffboot/Makefile
+vmlinux.coff:
+
+vmlinux.coff.initrd:
clean:
- rm -f vmlinux* znetboot* zImage* zvmlinux* mkprep find_name
- rm -f $(TOPDIR)/{zImage*,znetboot*,zvmlinux*,vmlinux*}
+ rm -f vmlinux* zvmlinux* mkprep zImage*
fastdep:
$(TOPDIR)/scripts/mkdep *.[Sch] > .depend