IEI Kino mainboard support based on Mahogany Fam10.
[coreboot.git] / Makefile
index 05b41d123f863e377cc7319019a9782c8121853f..247daccc01fc3f9e6bd7e0a4bce3c5e7955d4b24 100644 (file)
--- a/Makefile
+++ b/Makefile
@@ -170,7 +170,7 @@ $(obj)/mainboard/$(MAINBOARDDIR)/static.c: $(src)/mainboard/$(MAINBOARDDIR)/devi
 
 $(objutil)/%.o: $(objutil)/%.c
        @printf "    HOSTCC     $(subst $(objutil)/,,$(@))\n"
-       $(HOSTCC) -MMD $(HOSTCFLAGS) -c -o $@ $<
+       $(HOSTCC) -MMD -I$(subst $(objutil)/,util/,$(dir $<)) -I$(dir $<) $(HOSTCFLAGS) -c -o $@ $<
 
 $(obj)/%.o: $(obj)/%.c $(obj)/config.h
        @printf "    CC         $(subst $(obj)/,,$(@))\n"
@@ -330,6 +330,9 @@ $(obj)/build.h: .xcompile
        printf "#endif\n" >> $(obj)/build.ht
        mv $(obj)/build.ht $(obj)/build.h
 
+cscope:
+       cscope -bR
+
 doxy: doxygen
 doxygen:
        $(DOXYGEN) documentation/Doxyfile.coreboot
@@ -354,7 +357,10 @@ clean-for-update: doxygen-clean
 clean: clean-for-update
        rm -f $(obj)/coreboot* .ccwrap
 
-distclean:
+clean-cscope:
+       rm -f cscope.out
+
+distclean: clean-cscope
        rm -rf $(obj)
        rm -f .config .config.old ..config.tmp .kconfig.d .tmpconfig* .ccwrap .xcompile
 
@@ -368,19 +374,20 @@ include util/kconfig/Makefile
 $(obj)/ldoptions: $(obj)/config.h
        awk '/^#define ([^"])* ([^"])*$$/ {gsub("\\r","",$$3); print $$2 " = " $$3 ";";}' $< > $@
 
-_OS=$(shell uname -s |cut -c-7)
+_WINCHECK=$(shell uname -o 2> /dev/null)
 STACK=
-ifeq ($(_OS),MINGW32)
+ifeq ($(_WINCHECK),Msys)
        STACK=-Wl,--stack,16384000
 endif
-ifeq ($(_OS),CYGWIN_)
+ifeq ($(_WINCHECK),Cygwin)
        STACK=-Wl,--stack,16384000
 endif
+
 $(objutil)/romcc/romcc: $(top)/util/romcc/romcc.c
        @printf "    HOSTCC     $(subst $(obj)/,,$(@)) (this may take a while)\n"
        @# Note: Adding -O2 here might cause problems. For details see:
        @# http://www.coreboot.org/pipermail/coreboot/2010-February/055825.html
        $(HOSTCC) -g $(STACK) -Wall -o $@ $<
 
-.PHONY: $(PHONY) clean distclean doxygen doxy coreboot .xcompile
+.PHONY: $(PHONY) clean clean-cscope cscope distclean doxygen doxy coreboot .xcompile