Resent-Date: Mon, 7 Dec 1998 11:26:25 +0100 (MET)
To: linux-m68k@lists.linux-m68k.org
Subject: Fixing m68k_defs.h generation
X-Yow: ...Get me a GIN and TONIC!!...make it HAIR TONIC!!
From: Andreas Schwab <schwab@issan.informatik.uni-dortmund.de>
Date: 07 Dec 1998 11:26:20 +0100
Resent-From: linux-m68k@phil.uni-sb.de

There are many more headers besides <linux/sched.h> that can influence the
offsets in task_struct.  I have changed the command to let gcc generate
the dependency list so that it is always correct.

Andreas.

----------------------------------------------------------------------
--- linux/arch/m68k/Makefile.~2~	Sat Jul 18 14:47:41 1998
+++ linux/arch/m68k/Makefile	Sun Dec  6 15:30:17 1998
@@ -116,6 +116,7 @@
 
 archclean:
 	rm -f vmlinux.gz
+	rm -f kernel/m68k_defs.h kernel/m68k_defs.d
 
 archmrproper:
 
--- linux/arch/m68k/kernel/Makefile.~2~	Wed Jan 14 22:16:35 1998
+++ linux/arch/m68k/kernel/Makefile	Sun Dec  6 15:22:44 1998
@@ -26,10 +26,13 @@
 
 head.o: head.S m68k_defs.h
 
-m68k_defs.h: m68k_defs.c m68k_defs.head $(TOPDIR)/include/linux/sched.h
-	$(CC) ${CFLAGS} -S m68k_defs.c
+m68k_defs.h: m68k_defs.c m68k_defs.head
+	rm -f m68k_defs.d
+	SUNPRO_DEPENDENCIES="m68k_defs.d m68k_defs.h" \
+	$(CC) $(filter-out -MD,$(CFLAGS)) -S m68k_defs.c
 	cp m68k_defs.head m68k_defs.h
-	sed -n < m68k_defs.s >> m68k_defs.h '/^#define/s/ #/ /p'
+	grep '^#define' m68k_defs.s >> m68k_defs.h
 	rm m68k_defs.s
+-include m68k_defs.d
 
 include $(TOPDIR)/Rules.make
--- linux/arch/m68k/kernel/m68k_defs.c.~1~	Thu Jan 15 08:07:42 1998
+++ linux/arch/m68k/kernel/m68k_defs.c	Sun Dec  6 13:47:58 1998
@@ -12,7 +12,7 @@
 #include <linux/sched.h>
 
 #define DEFINE(sym, val) \
-	asm volatile("\n#define " #sym " %0" : : "i" (val))
+	asm volatile("\n#define " #sym " %c0" : : "i" (val))
 
 int main(void)
 {

-- 
Andreas Schwab                                      "And now for something
schwab@issan.cs.uni-dortmund.de                      completely different"
schwab@gnu.org

