patch-2.1.53 linux/arch/ppc/boot/Makefile

Next file: linux/arch/ppc/boot/head.S
Previous file: linux/arch/ppc/Makefile
Back to the patch index
Back to the overall index

diff -u --recursive --new-file v2.1.52/linux/arch/ppc/boot/Makefile linux/arch/ppc/boot/Makefile
@@ -26,9 +26,9 @@
 GZIP_FLAGS = -v9
 
 SYSTEM = $(TOPDIR)/vmlinux
-OBJECTS = head.o inflate.o unzip.o misc.o vreset.o #kbd.o
+OBJECTS := head.o inflate.o unzip.o misc.o vreset.o kbd.o
 CFLAGS = -O2 -DSTDC_HEADERS -I$(TOPDIR)/include
-OBJCOPY = objcopy
+OBJCOPY = $(CROSS_COMPILE)objcopy
 OBJCOPY_ARGS = -O elf32-powerpc
 
 
@@ -37,6 +37,9 @@
 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
 
@@ -52,6 +55,25 @@
 znetboot.initrd : zImage.initrd mkprep
 	cp $(TOPDIR)/zImage.initrd /usr/local/tftpboot/vmlinux
 
+#
+# 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
+#
+ifdef CONFIG_CHRP
+zImage: zvmlinux
+	cp zvmlinux $(TOPDIR)/zImage
+
+zImage.initrd: zvmlinux.initrd
+	cp zvmlinux.initrd $(TOPDIR)/zImage.initrd
+
+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
 
@@ -63,6 +85,7 @@
 	$(OBJCOPY) $(OBJCOPY_ARGS) --add-section=image=vmlinux.gz \
 		zvmlinux.tmp $@
 	rm zvmlinux.tmp
+endif
 
 vmlinux.gz: $(TOPDIR)/vmlinux
 	dd bs=64k skip=1 if=$(TOPDIR)/vmlinux | gzip -vf9 - > vmlinux.gz

FUNET's LINUX-ADM group, linux-adm@nic.funet.fi
TCL-scripts by Sam Shen, slshen@lbl.gov