Remove Inagua Kconfig items for external VGA and AHCI binaries. These can be addded...
[coreboot.git] / Makefile
index 4361b20fc7b208d16cb8dfcce4499433a8aa860b..43be315c89fe5328368be25a44dba6120b6c6e85 100644 (file)
--- a/Makefile
+++ b/Makefile
@@ -123,7 +123,7 @@ export MAINBOARDDIR
 PLATFORM-y += src/arch/$(ARCHDIR-y) src/cpu src/mainboard/$(MAINBOARDDIR)
 TARGETS-y :=
 
-BUILD-y := src/lib src/boot src/console src/devices src/southbridge src/northbridge src/superio src/drivers
+BUILD-y := src/lib src/boot src/console src/devices src/ec src/southbridge src/northbridge src/superio src/drivers
 BUILD-y += util/cbfstool util/sconfig
 BUILD-$(CONFIG_ARCH_X86) += src/pc80
 
@@ -163,7 +163,10 @@ $(obj)/config.h:
 #######################################################################
 # Build the tools
 
-CBFSTOOL:=$(objutil)/cbfstool/cbfstool
+CBFSTOOL:=$(obj)/cbfstool
+
+$(CBFSTOOL): $(objutil)/cbfstool/cbfstool
+       cp $< $@
 
 # needed objects that every mainboard uses
 # Creation of these is architecture and mainboard independent
@@ -184,6 +187,7 @@ ramstage-srcs:=$(obj)/mainboard/$(MAINBOARDDIR)/static.c
 romstage-srcs:=
 driver-srcs:=
 smm-srcs:=
+cbfs-files:=
 
 ramstage-objs:=
 romstage-objs:=
@@ -197,11 +201,20 @@ types:=ramstage romstage driver smm
 includemakefiles= \
        $(foreach type,$(2), $(eval $(type)-y:=)) \
        $(eval subdirs-y:=) \
+       $(eval cbfs-files-y:=) \
        $(eval -include $(1)) \
        $(foreach type,$(2), \
                $(eval $(type)-srcs+= \
                        $$(subst $(top)/,, \
                        $$(abspath $$(addprefix $(dir $(1)),$$($(type)-y)))))) \
+       $(foreach file,$(cbfs-files-y), \
+               $(if $(wildcard $(dir $(1))$($(file)-file)), \
+                       $(eval tmp-cbfs-file:= $(wildcard $(dir $(1))$($(file)-file))), \
+                       $(eval tmp-cbfs-file:= $($(file)-file))) \
+               $(eval cbfs-files += $(tmp-cbfs-file)|$(file)|$($(file)-type)|$($(file)-position)) \
+               $(eval $(file)-name:=) \
+               $(eval $(file)-type:=) \
+               $(eval $(file)-position:=)) \
        $(eval subdirs+=$$(subst $(CURDIR)/,,$$(abspath $$(addprefix $(dir $(1)),$$(subdirs-y)))))
 
 # For each path in $(subdirs) call includemakefiles
@@ -275,6 +288,7 @@ printall:
        @echo allsrcs=$(allsrcs)
        @echo DEPENDENCIES=$(DEPENDENCIES)
        @echo LIBGCC_FILE_NAME=$(LIBGCC_FILE_NAME)
+       @echo cbfs-files:='$(cbfs-files)'
 
 printcrt0s:
        @echo crt0s=$(crt0s)
@@ -286,13 +300,16 @@ INCLUDES += -Isrc/devices/oprom/include
 # abspath is a workaround for romcc
 INCLUDES += -include $(abspath $(obj)/config.h)
 
-CFLAGS = $(INCLUDES) -Os -nostdinc -pipe -g
+CFLAGS = $(INCLUDES) -Os -pipe -g
 CFLAGS += -nostdlib -Wall -Wundef -Wstrict-prototypes -Wmissing-prototypes
 CFLAGS += -Wwrite-strings -Wredundant-decls -Wno-trigraphs
 CFLAGS += -Wstrict-aliasing -Wshadow
 ifeq ($(CONFIG_WARNINGS_ARE_ERRORS),y)
 CFLAGS += -Werror
 endif
+ifneq ($(CONFIG_AMD_AGESA),y)
+CFLAGS += -nostdinc 
+endif
 CFLAGS += -fno-common -ffreestanding -fno-builtin -fomit-frame-pointer
 
 CBFS_COMPRESS_FLAG:=l
@@ -352,6 +369,7 @@ clean-for-update: doxygen-clean
        rm -f $(obj)/mainboard/$(MAINBOARDDIR)/bootblock.* $(obj)/mainboard/$(MAINBOARDDIR)/dsdt.*
        rm -f $(obj)/cpu/x86/smm/smm_bin.c $(obj)/cpu/x86/smm/smm.* $(obj)/cpu/x86/smm/smm
        rmdir -p $(alldirs) 2>/dev/null >/dev/null || true
+       $(MAKE) -C payloads/external/SeaBIOS -f Makefile.inc clean
 
 clean: clean-for-update
        rm -f $(obj)/coreboot* .ccwrap