AMD Bimini: Small fixes, and updates to recent trunk conventions.
[coreboot.git] / Makefile
index 397e51d301c67de902cc218cf2aa51a55590ec99..d2c6515ac983f484dd4ac91fccc0a756d3308b87 100644 (file)
--- a/Makefile
+++ b/Makefile
@@ -47,7 +47,10 @@ export KCONFIG_AUTOCONFIG := $(obj)/auto.conf
 CONFIG_SHELL := sh
 KBUILD_DEFCONFIG := configs/defconfig
 UNAME_RELEASE := $(shell uname -r)
-HAVE_DOTCONFIG := $(wildcard .config)
+DOTCONFIG ?= .config
+KCONFIG_CONFIG = $(DOTCONFIG)
+export KCONFIG_CONFIG
+HAVE_DOTCONFIG := $(wildcard $(DOTCONFIG))
 MAKEFLAGS += -rR --no-print-directory
 
 # Make is silent per default, but 'make V=1' will show all compiler calls.
@@ -111,7 +114,7 @@ endif
 
 strip_quotes = $(subst ",,$(subst \",,$(1)))
 
-ARCHDIR-$(CONFIG_ARCH_X86)    := i386
+ARCHDIR-$(CONFIG_ARCH_X86)    := x86
 ARCHDIR-$(CONFIG_ARCH_POWERPC) := ppc
 
 MAINBOARDDIR=$(call strip_quotes,$(CONFIG_MAINBOARD_DIR))
@@ -123,6 +126,7 @@ TARGETS-y :=
 BUILD-y := src/lib src/boot src/console src/devices src/southbridge src/northbridge src/superio src/drivers
 BUILD-y += util/cbfstool util/sconfig
 BUILD-$(CONFIG_ARCH_X86) += src/pc80
+BUILD-y += src/vendorcode
 
 ifneq ($(CONFIG_LOCALVERSION),"")
 COREBOOT_EXTRA_VERSION := -$(call strip_quotes,$(CONFIG_LOCALVERSION))
@@ -181,6 +185,7 @@ ramstage-srcs:=$(obj)/mainboard/$(MAINBOARDDIR)/static.c
 romstage-srcs:=
 driver-srcs:=
 smm-srcs:=
+cbfs-files:=
 
 ramstage-objs:=
 romstage-objs:=
@@ -194,11 +199,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)), \
+                       $(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)) \
+               $(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
@@ -272,6 +286,7 @@ printall:
        @echo allsrcs=$(allsrcs)
        @echo DEPENDENCIES=$(DEPENDENCIES)
        @echo LIBGCC_FILE_NAME=$(LIBGCC_FILE_NAME)
+       @echo cbfs-files:='$(cbfs-files)'
 
 printcrt0s:
        @echo crt0s=$(crt0s)
@@ -349,6 +364,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 clean
 
 clean: clean-for-update
        rm -f $(obj)/coreboot* .ccwrap
@@ -366,6 +382,26 @@ distclean: clean-cscope
 update:
        dongle.py -c /dev/term/1 $(obj)/coreboot.rom EOF
 
+lint:
+       FAILED=0; LINTLOG=`mktemp`; \
+       for script in util/lint/lint-*; do \
+               echo; echo `basename $$script`; \
+               grep "^# DESCR:" $$script | sed "s,.*DESCR: *,," ; \
+               echo ========; \
+               $$script > $$LINTLOG; \
+               if [ `wc -l $$LINTLOG | cut -d' ' -f1` -eq 0 ]; then \
+                       printf "success\n\n"; \
+               else \
+                       echo test failed: ; \
+                       cat $$LINTLOG; \
+                       rm -f $$LINTLOG; \
+                       FAILED=$$(( $$FAILED + 1 )); \
+               fi; \
+               echo ========; \
+       done; \
+       test $$FAILED -eq 0 || { echo "ERROR: $$FAILED test(s) failed." &&  exit 1; }; \
+       rm -f $$LINTLOG
+
 # This include must come _before_ the pattern rules below!
 # Order _does_ matter for pattern rules.
 include util/kconfig/Makefile