From ae22bcd6d99174994b5ac5e3369e0154bb9678c3 Mon Sep 17 00:00:00 2001 From: Stefan Reinauer Date: Fri, 5 Mar 2010 10:20:28 +0000 Subject: This patch fixes two things: - -m32 is already defined by xcompile if the compiler is a 64bit compiler so drop it from the Makefile. - allow "obj-.. += foo.o" for util/, too. Otherwise the source files in util/x86emu/ put their objects in util/ instead of $(obj)/util Signed-off-by: Stefan Reinauer Acked-by: Stefan Reinauer git-svn-id: svn://svn.coreboot.org/coreboot/trunk@5186 2b7e53f0-3cfb-0310-b3e9-8179ed1497e1 --- Makefile | 28 ++++++++++++++++++---------- 1 file changed, 18 insertions(+), 10 deletions(-) (limited to 'Makefile') diff --git a/Makefile b/Makefile index 423e1340ea..9be6a4cd3a 100644 --- a/Makefile +++ b/Makefile @@ -119,7 +119,7 @@ smmobjs:= crt0s:= ldscripts:= types:=obj initobj driver smmobj -includemakefiles=$(foreach type,$(2), $(eval $(type)-y:=)) $(eval subdirs-y:=) $(eval -include $(1)) $(if $(strip $(3)),$(foreach type,$(2),$(eval $(type)s+=$$(patsubst src/%,$(obj)/%,$$(addprefix $(dir $(1)),$$($(type)-y)))))) $(eval subdirs+=$$(subst $(PWD)/,,$$(abspath $$(addprefix $(dir $(1)),$$(subdirs-y))))) +includemakefiles=$(foreach type,$(2), $(eval $(type)-y:=)) $(eval subdirs-y:=) $(eval -include $(1)) $(if $(strip $(3)),$(foreach type,$(2),$(eval $(type)s+=$$(patsubst util/%,$(obj)/util/%,$$(patsubst src/%,$(obj)/%,$$(addprefix $(dir $(1)),$$($(type)-y))))))) $(eval subdirs+=$$(subst $(PWD)/,,$$(abspath $$(addprefix $(dir $(1)),$$(subdirs-y))))) evaluate_subdirs=$(eval cursubdirs:=$(subdirs)) $(eval subdirs:=) $(foreach dir,$(cursubdirs),$(eval $(call includemakefiles,$(dir)/Makefile.inc,$(types),$(1)))) $(if $(subdirs),$(eval $(call evaluate_subdirs, $(1)))) # collect all object files eligible for building @@ -148,55 +148,63 @@ $(obj)/$(1)%.o: src/$(1)%.asl $(CPP) -D__ACPI__ -P $(CPPFLAGS) -include $(obj)/config.h -I$(src) -I$(src)/mainboard/$(MAINBOARDDIR) $$< -o $$(basename $$@).asl iasl -p $$(basename $$@) -tc $$(basename $$@).asl mv $$(basename $$@).hex $$(basename $$@).c - $(CC) -m32 $$(CFLAGS) $$(if $$(subst dsdt,,$$(basename $$(notdir $$@))), -DAmlCode=AmlCode_$$(basename $$(notdir $$@))) -c -o $$@ $$(basename $$@).c + $(CC) $$(CFLAGS) $$(if $$(subst dsdt,,$$(basename $$(notdir $$@))), -DAmlCode=AmlCode_$$(basename $$(notdir $$@))) -c -o $$@ $$(basename $$@).c endef define objs_c_template +$(obj)/$(1)%.o: $(1)%.c $(obj)/config.h + @printf " CC $$(subst $$(obj)/,,$$(@))\n" + $(CC) $$(CFLAGS) -c -o $$@ $$< + $(obj)/$(1)%.o: src/$(1)%.c $(obj)/config.h @printf " CC $$(subst $$(obj)/,,$$(@))\n" - $(CC) -m32 $$(CFLAGS) -c -o $$@ $$< + $(CC) $$(CFLAGS) -c -o $$@ $$< endef define objs_S_template +$(obj)/$(1)%.o: $(1)%.S $(obj)/config.h + @printf " CC $$(subst $$(obj)/,,$$(@))\n" + $(CC) -DASSEMBLY $$(CFLAGS) -c -o $$@ $$< + $(obj)/$(1)%.o: src/$(1)%.S $(obj)/config.h @printf " CC $$(subst $$(obj)/,,$$(@))\n" - $(CC) -m32 -DASSEMBLY $$(CFLAGS) -c -o $$@ $$< + $(CC) -DASSEMBLY $$(CFLAGS) -c -o $$@ $$< endef define initobjs_c_template $(obj)/$(1)%.initobj.o: src/$(1)%.c $(obj)/config.h @printf " CC $$(subst $$(obj)/,,$$(@))\n" - $(CC) -m32 $$(CFLAGS) -c -o $$@ $$< + $(CC) $$(CFLAGS) -c -o $$@ $$< endef define initobjs_S_template $(obj)/$(1)%.initobj.o: src/$(1)%.S $(obj)/config.h @printf " CC $$(subst $$(obj)/,,$$(@))\n" - $(CC) -m32 -DASSEMBLY $$(CFLAGS) -c -o $$@ $$< + $(CC) -DASSEMBLY $$(CFLAGS) -c -o $$@ $$< endef define drivers_c_template $(obj)/$(1)%.driver.o: src/$(1)%.c $(obj)/config.h @printf " CC $$(subst $$(obj)/,,$$(@))\n" - $(CC) -m32 $$(CFLAGS) -c -o $$@ $$< + $(CC) $$(CFLAGS) -c -o $$@ $$< endef define drivers_S_template $(obj)/$(1)%.driver.o: src/$(1)%.S @printf " CC $$(subst $$(obj)/,,$$(@))\n" - $(CC) -m32 -DASSEMBLY $$(CFLAGS) -c -o $$@ $$< + $(CC) -DASSEMBLY $$(CFLAGS) -c -o $$@ $$< endef define smmobjs_c_template $(obj)/$(1)%.smmobj.o: src/$(1)%.c @printf " CC $$(subst $$(obj)/,,$$(@))\n" - $(CC) -m32 $$(CFLAGS) -c -o $$@ $$< + $(CC) $$(CFLAGS) -c -o $$@ $$< endef define smmobjs_S_template $(obj)/$(1)%.smmobj.o: src/$(1)%.S @printf " CC $$(subst $$(obj)/,,$$(@))\n" - $(CC) -m32 $$(CFLAGS) -c -o $$@ $$< + $(CC) $$(CFLAGS) -c -o $$@ $$< endef usetemplate=$(foreach d,$(sort $(dir $($(1)))),$(eval $(call $(1)_$(2)_template,$(subst $(obj)/,,$(d))))) -- cgit v1.2.3