X-Git-Url: http://wien.tomnetworks.com/gitweb/?p=coreboot.git;a=blobdiff_plain;f=Makefile.inc;h=b5e8811370c5c66df39b0d9f8c168234b3a09ad7;hp=4c87bd271677142dd99e3cfcfb58a760f1fe06cb;hb=HEAD;hpb=a25828dd0eaec09334ccbe05559d0e121e698b0d diff --git a/Makefile.inc b/Makefile.inc index 4c87bd271..b5e881137 100644 --- a/Makefile.inc +++ b/Makefile.inc @@ -34,12 +34,13 @@ coreboot: $(obj)/coreboot.rom ####################################################################### # our phony targets -PHONY+= clean-abuild coreboot +PHONY+= clean-abuild coreboot lint lint-stable ####################################################################### # root source directories of coreboot -subdirs-y := src/lib src/boot src/console src/devices src/ec src/southbridge src/northbridge src/superio src/drivers src/cpu -subdirs-y += util/cbfstool util/sconfig +subdirs-y := src/lib src/boot src/console src/devices src/ec src/southbridge +subdirs-y += src/northbridge src/superio src/drivers src/cpu src/vendorcode +subdirs-y += util/cbfstool util/sconfig util/nvramtool subdirs-y += src/arch/$(ARCHDIR-y) subdirs-y += src/mainboard/$(MAINBOARDDIR) @@ -60,6 +61,11 @@ endif smm-c-ccopts:=-D__SMM__ smm-S-ccopts:=-D__SMM__ +# SMM TSEG base is dynamic +ifeq ($(CONFIG_SMM_TSEG),y) +smm-c-ccopts += -fpic +endif + ramstage-c-deps:=$$(OPTION_TABLE_H) romstage-c-deps:=$$(OPTION_TABLE_H) @@ -68,7 +74,7 @@ romstage-c-deps:=$$(OPTION_TABLE_H) define ramstage-objs_asl_template $(obj)/$(1).ramstage.o: src/$(1).asl $(obj)/config.h @printf " IASL $$(subst $(top)/,,$$(@))\n" - $(CC) -x assembler-with-cpp -E -MMD -MT $$(@) -D__ACPI__ -P -include $(abspath $(obj)/config.h) -I$(src) -I$(src)/mainboard/$(MAINBOARDDIR) $$< -o $$(basename $$@).asl + $(CC) -x assembler-with-cpp -E -MMD -MT $$(@) -D__ACPI__ -P -include $(abspath $(obj)/config.h) -I$(src) -I$(src)/include -I$(src)/arch/$(ARCHDIR-y)/include -I$(src)/mainboard/$(MAINBOARDDIR) $$< -o $$(basename $$@).asl cd $$(dir $$@); $(IASL) -p $$(notdir $$@) -tc $$(notdir $$(basename $$@)).asl mv $$(basename $$@).hex $$(basename $$@).c $(CC) $$(CFLAGS) $$(if $$(subst dsdt,,$$(basename $$(notdir $(1)))), -DAmlCode=AmlCode_$$(basename $$(notdir $(1)))) -c -o $$@ $$(basename $$@).c @@ -76,13 +82,27 @@ $(obj)/$(1).ramstage.o: src/$(1).asl $(obj)/config.h mv $$(basename $$@).c $$(basename $$@).hex endef +####################################################################### +# Parse plaintext cmos defaults into binary format +# arg1: source file +# arg2: binary file name +cbfs-files-processor-nvramtool= \ + $(eval $(2): $(1) $(src)/mainboard/$(MAINBOARDDIR)/cmos.layout | $(objutil)/nvramtool/nvramtool ; \ + printf " CREATE $(2) (from $(1))\n"; $(objutil)/nvramtool/nvramtool -y $(src)/mainboard/$(MAINBOARDDIR)/cmos.layout -D $(2).tmp -p $(1) && mv $(2).tmp $(2)) + ####################################################################### # Add handler for arbitrary files in CBFS $(call add-special-class,cbfs-files) cbfs-files-handler= \ + $(eval tmp-cbfs-method:=$(word 2, $(subst :, ,$($(2)-file)))) \ + $(eval $(2)-file:=$(word 1, $(subst :, ,$($(2)-file)))) \ $(if $(wildcard $(1)$($(2)-file)), \ $(eval tmp-cbfs-file:= $(wildcard $(1)$($(2)-file))), \ $(eval tmp-cbfs-file:= $($(2)-file))) \ + $(if $(tmp-cbfs-method), \ + $(eval tmp-old-cbfs-file:=$(tmp-cbfs-file)) \ + $(eval tmp-cbfs-file:=$(shell mktemp $(obj)/mainboard/$(MAINBOARDDIR)/cbfs-file.XXXXXX).out) \ + $(call cbfs-files-processor-$(tmp-cbfs-method),$(tmp-old-cbfs-file),$(tmp-cbfs-file))) \ $(eval cbfs-files += $(tmp-cbfs-file)|$(2)|$($(2)-type)|$($(2)-position)) \ $(eval $(2)-name:=) \ $(eval $(2)-type:=) \ @@ -203,7 +223,7 @@ clean-for-update-target: rm -f $(obj)/mainboard/$(MAINBOARDDIR)/romstage.inc 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 - $(MAKE) -C payloads/external/SeaBIOS -f Makefile.inc clean + $(MAKE) -C payloads/external/SeaBIOS -f Makefile.inc clean OUT=$(abspath $(obj)) HOSTCC="$(HOSTCC)" CC="$(CC)" LD="$(LD)" clean-target: rm -f $(obj)/coreboot* @@ -217,14 +237,14 @@ printcrt0s: update: dongle.py -c /dev/term/1 $(obj)/coreboot.rom EOF -lint: +lint lint-stable: FAILED=0; LINTLOG=`mktemp`; \ - for script in util/lint/lint-*; do \ + for script in util/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 \ + if [ `cat $$LINTLOG | wc -l` -eq 0 ]; then \ printf "success\n\n"; \ else \ echo test failed: ; \ @@ -238,7 +258,7 @@ lint: rm -f $$LINTLOG gitconfig: - if ! [ -x .git/hooks/commit-msg ]; then cp util/gitconfig/commit-msg .git/hooks/commit-msg; chmod +x .git/hooks/commit-msg; fi + for hook in commit-msg pre-commit; do if ! [ -x .git/hooks/$$hook ]; then cp util/gitconfig/$$hook .git/hooks/$$hook; chmod +x .git/hooks/$$hook; fi; done (git config --global user.name >/dev/null && git config --global user.email >/dev/null) || (printf 'Please configure your name and email in git:\n\n git config --global user.name "Your Name Comes Here"\n git config --global user.email your.email@example.com\n'; exit 1) crossgcc: clean-for-update