Fix technexion tim5690 build failure - REALMODE option required for x86.c mainboard...
[coreboot.git] / Makefile
index 9c951457650001c50356470b6cea57883f1ad1c2..3b964b81f8bf8508063c2e5b26a941369e7f9a7c 100644 (file)
--- a/Makefile
+++ b/Makefile
@@ -247,6 +247,9 @@ CFLAGS = $(STACKPROTECT) $(INCLUDES) -Os -nostdinc
 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
 CFLAGS += -fno-common -ffreestanding -fno-builtin -fomit-frame-pointer
 
 CBFS_COMPRESS_FLAG:=l
@@ -289,7 +292,8 @@ doxygen-clean:
        rm -rf $(DOXYGEN_OUTPUT_DIR)
 
 clean: doxygen-clean
-       rm -f $(allobjs) $(obj)/coreboot* .xcompile
+       rm -f $(allobjs) $(obj)/coreboot*
+       rm -rf $(obj)/bootblock* $(obj)/romstage* $(obj)/location.*
        rm -f $(obj)/option_table.* $(obj)/crt0_includes.h $(obj)/ldscript
        rm -f $(obj)/mainboard/$(MAINBOARDDIR)/static.c $(obj)/mainboard/$(MAINBOARDDIR)/config.py $(obj)/mainboard/$(MAINBOARDDIR)/static.dot
        rm -f $(obj)/mainboard/$(MAINBOARDDIR)/auto.inc $(obj)/mainboard/$(MAINBOARDDIR)/crt0.s $(obj)/mainboard/$(MAINBOARDDIR)/crt0.disasm
@@ -297,7 +301,7 @@ clean: doxygen-clean
        $(MAKE) -C util/sconfig clean
 
 distclean: clean
-       rm -rf $(obj)
+       rm -rf $(obj) .xcompile
        rm -f .config .config.old ..config.tmp .kconfig.d .tmpconfig*
 
 update:
@@ -308,12 +312,19 @@ update:
 include util/kconfig/Makefile
 
 $(obj)/ldoptions: $(obj)/config.h
-#      cat $(obj)/config.h  | grep -v \" |grep -v AUTOCONF_INCLUDED | grep \#define | sed s/\#define\ // | sed s/\ /\ =\ / | sed 's/$$/;/' > $(obj)/ldoptions
-       awk '/^#define ([^"])* ([^"])*$$/ {print $$2 " = " $$3 ";";}' $< > $@
+       awk '/^#define ([^"])* ([^"])*$$/ {gsub("\\r","",$$3); print $$2 " = " $$3 ";";}' $< > $@
 
+_OS=$(shell uname -s |cut -c-7)
+STACK=
+ifeq ($(_OS),MINGW32)
+       STACK=-Wl,--stack,16384000
+endif
+ifeq ($(_OS),CYGWIN_)
+       STACK=-Wl,--stack,16384000
+endif
 $(obj)/romcc: $(top)/util/romcc/romcc.c
        @printf "    HOSTCC     $(subst $(obj)/,,$(@)) (this may take a while)\n"
-       $(HOSTCC) -g -O2 -Wall -o $@ $<
+       $(HOSTCC) -g -O2 $(STACK) -Wall -o $@ $<
 
 .PHONY: $(PHONY) prepare prepare2 clean distclean doxygen doxy coreboot