patch-1.3.5 linux/arch/i386/boot/compressed/Makefile

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

diff -u --recursive --new-file v1.3.4/linux/arch/i386/boot/compressed/Makefile linux/arch/i386/boot/compressed/Makefile
@@ -11,6 +11,12 @@
 
 CFLAGS = -O2 -DSTDC_HEADERS
 
+ifdef CONFIG_KERNEL_ELF
+TARGET=--target elf32-i386
+INPUT_DATA=input_data
+INPUT_LEN=input_len
+endif
+
 .c.s:
 	$(CC) $(CFLAGS) -S $<
 .s.o:
@@ -20,13 +26,24 @@
 
 all: vmlinux
 
-vmlinux:	piggy.o $(OBJECTS)
-		$(LD) $(ZLINKFLAGS) -o vmlinux $(OBJECTS) piggy.o
+vmlinux: piggy.o $(OBJECTS)
+	$(LD) $(ZLINKFLAGS) -o vmlinux $(OBJECTS) piggy.o
+
+head.o: head.S $(TOPDIR)/include/linux/tasks.h
+	$(CC) -traditional -c head.S
 
-head.o:	head.s
+ifdef CONFIG_KERNEL_ELF
 
-head.s: head.S $(TOPDIR)/include/linux/tasks.h
-	$(CPP) -traditional head.S -o head.s
+# You cannot compress a file and have the kernel uncompress it, it must
+# be stdin
+piggy.o:	$(SYSTEM)
+	tmppiggy=/tmp/$$.piggy; \
+	rm -f $$tmppiggy $$tmppiggy.gz; \
+	$(OBJDUMP) $(OBJDUMP_FLAGS) -o $(IMAGE_OFFSET) $(SYSTEM) > $$tmppiggy; \
+	gzip -f -9 < $$tmppiggy > $$tmppiggy.gz; \
+	encaps $(TARGET) piggy.o $$tmppiggy.gz $(INPUT_DATA) $(INPUT_LEN); \
+	rm -f $$tmppiggy $$tmppiggy.gz
+else
 
 piggy.o:	$(SYSTEM) xtract piggyback
 		./xtract $(SYSTEM) | gzip -9 | ./piggyback > piggy.o
@@ -36,6 +53,8 @@
 
 piggyback: piggyback.c
 	$(HOSTCC) $(CFLAGS) -o piggyback piggyback.c
+
+endif
 
 clean:
 	rm -f xtract piggyback vmlinux

FUNET's LINUX-ADM group, linux-adm@nic.funet.fi
TCL-scripts by Sam Shen, slshen@lbl.gov with Sam's (original) version
of this