Merge with /home/hs/U-Boot/u-boot-dev
[oweals/u-boot.git] / config.mk
index 313761b86d6e497142bd1c72e8ab886c50a6106b..b59667a83311f39458cb501434979b4996b1e029 100644 (file)
--- a/config.mk
+++ b/config.mk
@@ -53,12 +53,19 @@ PLATFORM_CPPFLAGS+= -D__ARM__
 endif
 endif
 
+ifeq ($(ARCH),blackfin)
+PLATFORM_CPPFLAGS+= -D__BLACKFIN__ -mno-underscore
+endif
+
 ifdef  ARCH
 sinclude $(TOPDIR)/$(ARCH)_config.mk   # include architecture dependend rules
 endif
 ifdef  CPU
 sinclude $(TOPDIR)/cpu/$(CPU)/config.mk        # include  CPU  specific rules
 endif
+ifdef  SOC
+sinclude $(TOPDIR)/cpu/$(CPU)/$(SOC)/config.mk # include  SoC  specific rules
+endif
 ifdef  VENDOR
 BOARDDIR = $(VENDOR)/$(BOARD)
 else
@@ -83,6 +90,12 @@ HOSTCFLAGS   = -Wall -Wstrict-prototypes -O2 -fomit-frame-pointer
 HOSTSTRIP      = strip
 
 #########################################################################
+#
+# Option checker (courtesy linux kernel) to ensure
+# only supported compiler options are used
+#
+cc-option = $(shell if $(CC) $(CFLAGS) $(1) -S -o /dev/null -xc /dev/null \
+               > /dev/null 2>&1; then echo "$(1)"; else echo "$(2)"; fi ;)
 
 #
 # Include the make variables (CC, etc...)
@@ -99,7 +112,7 @@ OBJDUMP = $(CROSS_COMPILE)objdump
 RANLIB = $(CROSS_COMPILE)RANLIB
 
 RELFLAGS= $(PLATFORM_RELFLAGS)
-DBGFLAGS= -g #-DDEBUG
+DBGFLAGS= -g # -DDEBUG
 OPTFLAGS= -Os #-fomit-frame-pointer
 ifndef LDSCRIPT
 #LDSCRIPT := $(TOPDIR)/board/$(BOARDDIR)/u-boot.lds.debug
@@ -126,11 +139,19 @@ endif
 # this option have to be placed behind -Wall -- that's why it is here
 ifeq ($(ARCH),nios)
 ifeq ($(findstring 2.9,$(shell $(CC) --version)),2.9)
-CFLAGS := $(CPPFLAGS) -Wno-trigraphs
+CFLAGS := $(CPPFLAGS) -Wall -Wno-trigraphs
 endif
 endif
 
 AFLAGS_DEBUG := -Wa,-gstabs
+
+# turn jbsr into jsr for m68k
+ifeq ($(ARCH),m68k)
+ifeq ($(findstring 3.4,$(shell $(CC) --version)),3.4)
+AFLAGS_DEBUG := -Wa,-gstabs,-S
+endif
+endif
+
 AFLAGS := $(AFLAGS_DEBUG) -D__ASSEMBLY__ $(CPPFLAGS)
 
 LDFLAGS += -Bstatic -T $(LDSCRIPT) -Ttext $(TEXT_BASE) $(PLATFORM_LDFLAGS)
@@ -158,6 +179,10 @@ BFD_ROOT_DIR =             /opt/powerpc
 endif
 endif
 
+ifeq ($(PCI_CLOCK),PCI_66M)
+CFLAGS := $(CFLAGS) -DPCI_66M
+endif
+
 #########################################################################
 
 export CONFIG_SHELL HPATH HOSTCC HOSTCFLAGS CROSS_COMPILE \