X-Git-Url: http://wien.tomnetworks.com/gitweb/?a=blobdiff_plain;f=Makefile.inc;h=b4855d0b6831802b68708973045d2612079db0f0;hb=0078ceb553a1d87ea0a948c3e7e2c59ab4d2e65e;hp=f8c4deb2acff1e8ed0acc3e11ae0bb2468c39581;hpb=b2a4264ea54e19729f86e9d01b9933ad83ce16be;p=coreboot.git diff --git a/Makefile.inc b/Makefile.inc index f8c4deb2a..b4855d0b6 100644 --- a/Makefile.inc +++ b/Makefile.inc @@ -19,8 +19,7 @@ ####################################################################### # misleadingly named, this is the coreboot version -REV=-r$(shell if [ -d $(top)/.svn -a -f "`which svnversion`" ]; then svnversion $(top); else if [ -d $(top)/.git -a -f "`which git`" ]; then git --git-dir=/$(top)/.git log|grep git-svn-id|cut -f 2 -d@|cut -f 1 -d' '|sort -g|tail -1; fi; fi) -export KERNELVERSION := 4.0$(REV) +export KERNELVERSION := $(shell if [ -d "$(top)/.git" -a -f "`which git`" ]; then git describe --dirty; else echo unknown; fi) ####################################################################### # Basic component discovery @@ -35,23 +34,30 @@ 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 := 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 subdirs-y += src/arch/$(ARCHDIR-y) subdirs-y += src/mainboard/$(MAINBOARDDIR) subdirs-$(CONFIG_ARCH_X86) += src/pc80 +subdirs-y += site-local + ####################################################################### # Add source classes and their build options classes-y := ramstage romstage driver smm romstage-c-ccopts:=-D__PRE_RAM__ romstage-S-ccopts:=-D__PRE_RAM__ +ifeq ($(CONFIG_TRACE),y) +ramstage-c-ccopts:= -finstrument-functions +endif + smm-c-ccopts:=-D__SMM__ smm-S-ccopts:=-D__SMM__ @@ -63,8 +69,8 @@ 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 - cd $$(dir $$@); iasl -p $$(notdir $$@) -tc $$(notdir $$(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 # keep %.o: %.c rule from catching the temporary .c file after a make clean @@ -128,6 +134,7 @@ $(obj)/build.h: .xcompile printf "#define COREBOOT_VERSION \"$(KERNELVERSION)\"\n" >> $(obj)/build.ht printf "#define COREBOOT_EXTRA_VERSION \"$(COREBOOT_EXTRA_VERSION)\"\n" >> $(obj)/build.ht printf "#define COREBOOT_BUILD \"`LANG= date`\"\n" >> $(obj)/build.ht + printf "#define COREBOOT_DMI_DATE \"`LANG= date +"%m/%d/%Y"`\"\n" >> $(obj)/build.ht printf "\n" >> $(obj)/build.ht printf "#define COREBOOT_COMPILER \"$(shell LANG= $(CC) --version | head -n1)\"\n" >> $(obj)/build.ht printf "#define COREBOOT_ASSEMBLER \"$(shell LANG= $(AS) --version | head -n1)\"\n" >> $(obj)/build.ht @@ -197,7 +204,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* @@ -211,14 +218,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: ; \ @@ -231,7 +238,14 @@ lint: test $$FAILED -eq 0 || { echo "ERROR: $$FAILED test(s) failed." && exit 1; }; \ rm -f $$LINTLOG +gitconfig: + 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 + $(MAKE) -C util/crossgcc build-without-gdb + +crosstools: clean-for-update $(MAKE) -C util/crossgcc build crossgcc-clean: clean-for-update