Patchwork Fix option_table.h issues

login
register
about
Submitter Patrick Georgi
Date 2011-03-08 09:50:07
Message ID <1299577807.2459.13.camel@linux-0a8x.site>
Download mbox | patch
Permalink /patch/2753/
State Accepted
Headers show

Comments

Patrick Georgi - 2011-03-08 09:50:07
Hi,

attached patch makes option_table.h a dependency for all
romstage/ramstage files built from C, forcing the build system to create
option_table.h earlier in the build.

This should fix the build issues that were seen by Jonathan, Josef, and
others.

Signed-off-by: Patrick Georgi <patrick.georgi@secunet.com>
Jonathan A. Kollasch - 2011-03-08 19:44:20
On Tue, Mar 08, 2011 at 10:50:07AM +0100, Georgi, Patrick wrote:
> Hi,
> 
> attached patch makes option_table.h a dependency for all
> romstage/ramstage files built from C, forcing the build system to create
> option_table.h earlier in the build.
> 
> This should fix the build issues that were seen by Jonathan, Josef, and
> others.
> 
> Signed-off-by: Patrick Georgi <patrick.georgi@secunet.com>
Acked-by: Jonathan Kollasch <jakllsch@kollasch.net>
Patrick Georgi - 2011-03-08 20:50:15
Am 08.03.2011 20:44, schrieb Jonathan A. Kollasch:
>> This should fix the build issues that were seen by Jonathan, Josef, and
>> others.
>> Signed-off-by: Patrick Georgi <patrick.georgi@secunet.com>
> Acked-by: Jonathan Kollasch <jakllsch@kollasch.net>
Thanks, r6438


Patrick

Patch

diff --git a/Makefile b/Makefile

index 4c787ef..06847b6 100644

--- a/Makefile

+++ b/Makefile

@@ -207,9 +207,10 @@  define create_cc_template

 # $1 obj class
 # $2 source suffix (c, S)
 # $3 additional compiler flags
+# $4 additional dependencies

 ifn$(EMPTY)def $(1)-objs_$(2)_template
 de$(EMPTY)fine $(1)-objs_$(2)_template
-$(obj)/$$(1).$(1).o: src/$$(1).$(2) $(obj)/config.h

+$(obj)/$$(1).$(1).o: src/$$(1).$(2) $(obj)/config.h $(4)

 	@printf "    CC         $$$$(subst $$$$(obj)/,,$$$$(@))\n"
 	$(CC) $(3) -MMD $$$$(CFLAGS) -c -o $$$$@ $$$$<
 en$(EMPTY)def
@@ -219,7 +220,7 @@  endef

 filetypes-of-class=$(subst .,,$(sort $(suffix $($(1)-srcs))))
 $(foreach class,$(classes), \
 	$(foreach type,$(call filetypes-of-class,$(class)), \
-		$(eval $(call create_cc_template,$(class),$(type),$($(class)-$(type)-ccopts)))))

+		$(eval $(call create_cc_template,$(class),$(type),$($(class)-$(type)-ccopts),$($(class)-$(type)-deps)))))

 
 foreach-src=$(foreach file,$($(1)-srcs),$(eval $(call $(1)-objs_$(subst .,,$(suffix $(file)))_template,$(subst src/,,$(basename $(file))))))
 $(eval $(foreach class,$(classes),$(call foreach-src,$(class))))
diff --git a/Makefile.inc b/Makefile.inc

index 1d2d0dc..b87cec7 100644

--- a/Makefile.inc

+++ b/Makefile.inc

@@ -54,6 +54,9 @@  romstage-c-ccopts:=-D__PRE_RAM__

 romstage-S-ccopts:=-DASSEMBLY -D__PRE_RAM__
 driver-S-ccopts:=-DASSEMBLY
 
+ramstage-c-deps:=$$(OPTION_TABLE_H)

+romstage-c-deps:=$$(OPTION_TABLE_H)

+

 #######################################################################
 # Add handler to compile ACPI's ASL
 define ramstage-objs_asl_template
@@ -174,7 +177,7 @@  $(objutil)/%.o: $(objutil)/%.c

 	@printf "    HOSTCC     $(subst $(objutil)/,,$(@))\n"
 	$(HOSTCC) -MMD -I$(subst $(objutil)/,util/,$(dir $<)) -I$(dir $<) $(HOSTCFLAGS) -c -o $@ $<
 
-$(obj)/%.ramstage.o: $(obj)/%.c $(obj)/config.h

+$(obj)/%.ramstage.o: $(obj)/%.c $(obj)/config.h $(OPTION_TABLE_H)

 	@printf "    CC         $(subst $(obj)/,,$(@))\n"
 	$(CC) -MMD $(CFLAGS) -c -o $@ $<
 
diff --git a/src/pc80/Makefile.inc b/src/pc80/Makefile.inc

index b82ea41..0bc57b2 100644

--- a/src/pc80/Makefile.inc

+++ b/src/pc80/Makefile.inc

@@ -7,9 +7,6 @@  ramstage-y += keyboard.c

 romstage-$(CONFIG_USE_OPTION_TABLE) += mc146818rtc_early.c
 subdirs-y += vga
 
-$(obj)/pc80/mc146818rtc.ramstage.o : $(OPTION_TABLE_H)

-$(obj)/pc80/mc146818rtc_early.romstage.o : $(OPTION_TABLE_H)

-

 cbfs-files-$(CONFIG_HAVE_CMOS_DEFAULT) += cmos.default
 cmos.default-file = $(CONFIG_CMOS_DEFAULT_FILE)
 cmos.default-type = 0xaa