[coreboot] [PATCH] Fix v3 build dependencies on build.h

Carl-Daniel Hailfinger c-d.hailfinger.devel.2006 at gmx.net
Thu Nov 13 03:50:29 CET 2008


On 06.11.2008 15:29, Carl-Daniel Hailfinger wrote:
> Not a single file is being rebuilt in v3 if build.h changes. That means
> the console banner and the option table will never be updated with more
> recent build.h strings.
>   

Thanks to Mart Raudsepp for spotting this oddness.

> x86emu doesn't care about the contents of build.h, it just uses build.h
> to check whether it is compiled in conjunction with coreboot.
>
> Signed-off-by: Carl-Daniel Hailfinger <c-d.hailfinger.devel.2006 at gmx.net>
>   

Updated patch, ready for commit.

Index: corebootv3-build_h_dependencies/lib/console.c
===================================================================
--- corebootv3-build_h_dependencies/lib/console.c	(Revision 1013)
+++ corebootv3-build_h_dependencies/lib/console.c	(Arbeitskopie)
@@ -6,6 +6,7 @@
 #include <stdarg.h>
 #include <string.h>
 #include <globalvars.h>
+#include <build.h>
 
 int vtxprintf(void (*)(unsigned char, void *arg), 
 		void *arg, const char *, va_list);
Index: corebootv3-build_h_dependencies/lib/Makefile
===================================================================
--- corebootv3-build_h_dependencies/lib/Makefile	(Revision 1013)
+++ corebootv3-build_h_dependencies/lib/Makefile	(Arbeitskopie)
@@ -44,6 +44,11 @@
 nrv2b:
 endif
 
+$(obj)/lib/console.o: $(src)/lib/console.c $(obj)/build.h
+	$(Q)mkdir -p $(dir $@)
+	$(Q)printf "  CC      $(subst $(shell pwd)/,,$(@))\n"
+	$(Q)$(CC) $(INITCFLAGS) -c $< -o $@
+
 $(obj)/lib/%.o: $(src)/lib/%.c
 	$(Q)mkdir -p $(dir $@)
 	$(Q)printf "  CC      $(subst $(shell pwd)/,,$(@))\n"
Index: corebootv3-build_h_dependencies/Makefile
===================================================================
--- corebootv3-build_h_dependencies/Makefile	(Revision 1013)
+++ corebootv3-build_h_dependencies/Makefile	(Arbeitskopie)
@@ -88,8 +88,7 @@
 			-I$(src)/include \
 			-I$(src)/include/arch/$(ARCH)/ \
 			-I$(src)/mainboard/$(MAINBOARDDIR)/ \
-			-include $(obj)/config.h \
-			-include $(obj)/build.h
+			-include $(obj)/config.h
 
 CC := $(CC_$(ARCH))
 AS := $(AS_$(ARCH))
Index: corebootv3-build_h_dependencies/util/x86emu/include/x86emu/x86emu.h
===================================================================
--- corebootv3-build_h_dependencies/util/x86emu/include/x86emu/x86emu.h	(Revision 1013)
+++ corebootv3-build_h_dependencies/util/x86emu/include/x86emu/x86emu.h	(Arbeitskopie)
@@ -43,7 +43,7 @@
 #define __X86EMU_X86EMU_H
 
 /* FIXME: undefine printk for the moment */
-#ifdef COREBOOT_VERSION
+#if 1 /* Coreboot needs to map prinkf to printk. */
 #include <console.h>
 #define printk(x...) printk(BIOS_DEBUG, x)
 #else
Index: corebootv3-build_h_dependencies/util/x86emu/x86emu/sys.c
===================================================================
--- corebootv3-build_h_dependencies/util/x86emu/x86emu/sys.c	(Revision 1013)
+++ corebootv3-build_h_dependencies/util/x86emu/x86emu/sys.c	(Arbeitskopie)
@@ -45,7 +45,7 @@
 #include <x86emu/regs.h>
 #include "debug.h"
 #include "prim_ops.h"
-#ifdef COREBOOT_VERSION
+#if 1 /* Coreboot needs to map prinkf to printk. */
 #include "io.h"
 #else
 #include <sys/io.h>
Index: corebootv3-build_h_dependencies/arch/x86/coreboot_table.c
===================================================================
--- corebootv3-build_h_dependencies/arch/x86/coreboot_table.c	(Revision 1013)
+++ corebootv3-build_h_dependencies/arch/x86/coreboot_table.c	(Arbeitskopie)
@@ -31,6 +31,7 @@
 //#include <pirq_routing.h>
 //#include <smp/mpspec.h>
 //#include <acpi.h>
+#include <build.h>
 
 struct lb_header *lb_table_init(unsigned long addr)
 {
Index: corebootv3-build_h_dependencies/arch/x86/Makefile
===================================================================
--- corebootv3-build_h_dependencies/arch/x86/Makefile	(Revision 1013)
+++ corebootv3-build_h_dependencies/arch/x86/Makefile	(Arbeitskopie)
@@ -248,6 +248,11 @@
 # Build rules.
 #
 
+$(obj)/arch/x86/coreboot_table.o: $(src)/arch/x86/coreboot_table.c $(obj)/build.h
+	$(Q)mkdir -p $(dir $@)
+	$(Q)printf "  CC      $(subst $(shell pwd)/,,$(@))\n"
+	$(Q)$(CC) $(INITCFLAGS) -c $< -o $@
+	
 $(obj)/arch/x86/%.o: $(src)/arch/x86/%.c
 	$(Q)mkdir -p $(dir $@)
 	$(Q)printf "  CC      $(subst $(shell pwd)/,,$(@))\n"


-- 
http://www.hailfinger.org/





More information about the coreboot mailing list