patch-2.1.79 linux/arch/ppc/coffboot/Makefile

Next file: linux/arch/ppc/coffboot/elfextract.c
Previous file: linux/arch/ppc/chrpboot/zlib.h
Back to the patch index
Back to the overall index

diff -u --recursive --new-file v2.1.78/linux/arch/ppc/coffboot/Makefile linux/arch/ppc/coffboot/Makefile
@@ -8,6 +8,7 @@
 CROSS_COMPILE 	=powerpc-eabi-
 endif
 
+
 HOSTCC	= gcc
 HOSTCFLAGS = -O -I$(TOPDIR)/include
 
@@ -16,35 +17,71 @@
 CFLAGS	= -O -fno-builtin -I$(TOPDIR)/include
 OBJCOPY = $(CROSS_COMPILE)objcopy
 OBJCOPY_ARGS = -O aixcoff-rs6000 -R .stab -R .stabstr -R .comment \
-	--add-section=image=zImage
+	--add-section=image=vmlinux.gz
 LD_ARGS = -e _start -T ld.script -Ttext 500000 -Tdata 510000 -Bstatic
-GZIP = gzip -9
+GZ = gzip -9
 
 OBJS = crt0.o start.o main.o misc.o string.o zlib.o
 LIBS = $(TOPDIR)/lib/lib.a
 
-vmlinux.coff: coffboot hack-coff zImage
+ifeq ($(CONFIG_PMAC),y)
+hack-coff: hack-coff.c
+	$(HOSTCC) $(HOSTCFLAGS) -o hack-coff hack-coff.c
+
+floppy: zImage
+#	mount -t hfs /dev/fd0 /mnt
+#	cp vmlinux.coff /mnt
+#	umount /mnt
+
+znetboot: vmlinux.coff
+	cp vmlinux.coff /tftpboot/zImage.pmac
+
+znetboot.initrd: vmlinux.coff.initrd
+	cp vmlinux.coff.initrd /tftpboot/zImage.pmac
+
+coffboot: $(OBJS) ld.script
+	$(LD) -o coffboot $(LD_ARGS) $(OBJS) $(LIBS)
+
+zImage: vmlinux.coff
+
+zImage.initrd: vmlinux.coff.initrd
+
+vmlinux.coff: coffboot hack-coff vmlinux.gz
 	$(OBJCOPY) $(OBJCOPY_ARGS) coffboot $@
 	./hack-coff $@
+	ln -sf vmlinux.coff zImage
 
-vmlinux.coff.initrd: coffboot hack-coff zImage ramdisk.image.gz
+vmlinux.coff.initrd: coffboot hack-coff vmlinux.gz ramdisk.image.gz
 	$(OBJCOPY) $(OBJCOPY_ARGS) --add-section=initrd=ramdisk.image.gz \
 		coffboot $@
 	./hack-coff $@
 
-coffboot: $(OBJS) ld.script
-	$(LD) -o coffboot $(LD_ARGS) $(OBJS) $(LIBS)
+else
+znetboot: vmlinux.gz
 
-zImage: $(TOPDIR)/vmlinux elfextract
-	./elfextract $(TOPDIR)/vmlinux | $(GZIP) >zImage
+znetboot.initrd: vmlinux.gz
 
-hack-coff: hack-coff.c
-	$(HOSTCC) $(HOSTCFLAGS) -o hack-coff hack-coff.c
+coffboot: vmlinux.gz
+
+zImage: vmlinux.gz
+
+zImage.initrd: vmlinux.gz
+
+vmlinux.coff: vmlinux.gz
+
+vmlinux.coff.initrd: vmlinux.gz
+
+floppy: vmlinux.gz
+
+
+
+endif
 
-elfextract: elfextract.c
-	$(HOSTCC) $(HOSTCFLAGS) -o elfextract elfextract.c
+vmlinux.gz: $(TOPDIR)/vmlinux
+	$(OBJCOPY) -S -O binary $(TOPDIR)/vmlinux vmlinux
+	gzip -vf9 vmlinux
 
 clean:
-	rm -f elfextract hack-coff coffboot zImage vmlinux.coff
+	rm -f hack-coff coffboot zImage vmlinux.coff vmlinux.gz
 
 fastdep:

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