Stub out FILE*, stdout/stdin/stderr and implement fprintf on these
[coreboot.git] / Makefile
index 5876cdc616134b750bbf625bd797f14a948b589e..43be315c89fe5328368be25a44dba6120b6c6e85 100644 (file)
--- a/Makefile
+++ b/Makefile
@@ -208,10 +208,10 @@ includemakefiles= \
                        $$(subst $(top)/,, \
                        $$(abspath $$(addprefix $(dir $(1)),$$($(type)-y)))))) \
        $(foreach file,$(cbfs-files-y), \
-               $(if $(wildcard $(dir $(1))$(file)), \
-                       $(eval tmp-cbfs-file:= $(wildcard $(dir $(1))$(file))), \
-                       $(eval tmp-cbfs-file:= $(file))) \
-               $(eval cbfs-files += $(tmp-cbfs-file)|$$($(file)-name)|$$($(file)-type)|$$($(file)-position)) \
+               $(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:=)) \
@@ -300,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