patch-2.4.19 linux-2.4.19/arch/s390x/kernel/Makefile

Next file: linux-2.4.19/arch/s390x/kernel/asm-offsets.c
Previous file: linux-2.4.19/arch/s390x/defconfig
Back to the patch index
Back to the overall index

diff -urN linux-2.4.18/arch/s390x/kernel/Makefile linux-2.4.19/arch/s390x/kernel/Makefile
@@ -8,9 +8,9 @@
 # Note 2! The CFLAGS definitions are now in the main makefile...
 
 .S.o:
-	$(CC) -D__ASSEMBLY__ $(AFLAGS) -traditional -c $< -o $*.o
+	$(CC) $(AFLAGS) -traditional -c $< -o $*.o
 
-all: kernel.o head.o init_task.o
+all: asm-offsets.h kernel.o head.o init_task.o
 
 O_TARGET	:= kernel.o
 
@@ -32,9 +32,31 @@
 obj-$(CONFIG_S390_SUPPORT)	+= linux32.o signal32.o ioctl32.o wrapper32.o exec32.o
 obj-$(CONFIG_BINFMT_ELF32)	+= binfmt_elf32.o
 
+.PHONY: asm-offsets.h
+
 #
 # This is just to get the dependencies...
 #
 binfmt_elf32.o:	$(TOPDIR)/fs/binfmt_elf.c
 
+#
+# Automatic offset generation for assembler files.
+#
+asm-offsets.h: asm-offsets.c
+	$(CC) $(CFLAGS) $(EXTRA_CFLAGS) -S $< -o - | grep -- "->" | \
+	(echo "#ifndef __ASM_OFFSETS_H__"; \
+	 echo "#define __ASM_OFFSETS_H__"; \
+	 echo "/*"; \
+	 echo " * DO NOT MODIFY"; \
+	 echo " *"; \
+	 echo " * This file was generated by arch/s390/kernel/Makefile"; \
+	 echo " */"; \
+	 sed -e "s:^->\([^ ]*\) \([^ ]*\) \(.*\):#define \\1 \\2 /* \\3*/:" \
+	     -e "s:->::"; \
+	 echo "#endif" \
+	) > asm-offsets.h
+
+clean:
+	rm -f asm-offsets.h
+
 include $(TOPDIR)/Rules.make

FUNET's LINUX-ADM group, linux-adm@nic.funet.fi
TCL-scripts by Sam Shen (who was at: slshen@lbl.gov)