#######################################################################
# our phony targets
-PHONY+= clean-abuild coreboot
+PHONY+= clean-abuild coreboot lint lint-stable
#######################################################################
# root source directories of coreboot
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
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: ; \
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