X-Git-Url: https://git.librecmc.org/?a=blobdiff_plain;f=config.mk;h=313761b86d6e497142bd1c72e8ab886c50a6106b;hb=04a85b3b36fdbaaac5fa95d61f59f481bbcf7520;hp=f0f8aa86b69791abe2c854d52b9f59ed83c15a30;hpb=7f6c2cbc2bc0721c41bb776242c0b18ec70328e4;p=oweals%2Fu-boot.git diff --git a/config.mk b/config.mk index f0f8aa86b6..313761b86d 100644 --- a/config.mk +++ b/config.mk @@ -23,6 +23,11 @@ ######################################################################### +# clean the slate ... +PLATFORM_RELFLAGS = +PLATFORM_CPPFLAGS = +PLATFORM_LDFLAGS = + # # When cross-compiling on NetBSD, we have to define __PPC__ or else we # will pick up a va_list declaration that is incompatible with the @@ -96,15 +101,19 @@ RANLIB = $(CROSS_COMPILE)RANLIB RELFLAGS= $(PLATFORM_RELFLAGS) DBGFLAGS= -g #-DDEBUG OPTFLAGS= -Os #-fomit-frame-pointer -#LDSCRIPT := board/$(BOARDDIR)/u-boot.lds.debug +ifndef LDSCRIPT +#LDSCRIPT := $(TOPDIR)/board/$(BOARDDIR)/u-boot.lds.debug LDSCRIPT := $(TOPDIR)/board/$(BOARDDIR)/u-boot.lds -OBJCFLAGS := --gap-fill=0xff +endif +OBJCFLAGS += --gap-fill=0xff + +gccincdir := $(shell $(CC) -print-file-name=include) CPPFLAGS := $(DBGFLAGS) $(OPTFLAGS) $(RELFLAGS) \ -D__KERNEL__ -DTEXT_BASE=$(TEXT_BASE) \ -I$(TOPDIR)/include \ - -fno-builtin \ - -pipe $(PLATFORM_CPPFLAGS) + -fno-builtin -ffreestanding -nostdinc -isystem \ + $(gccincdir) -pipe $(PLATFORM_CPPFLAGS) ifdef BUILD_TAG CFLAGS := $(CPPFLAGS) -Wall -Wstrict-prototypes \ @@ -113,6 +122,14 @@ else CFLAGS := $(CPPFLAGS) -Wall -Wstrict-prototypes endif +# avoid trigraph warnings while parsing pci.h (produced by NIOS gcc-2.9) +# 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 +endif +endif + AFLAGS_DEBUG := -Wa,-gstabs AFLAGS := $(AFLAGS_DEBUG) -D__ASSEMBLY__ $(CPPFLAGS) @@ -131,11 +148,15 @@ LDFLAGS += -Bstatic -T $(LDSCRIPT) -Ttext $(TEXT_BASE) $(PLATFORM_LDFLAGS) ifeq ($(HOSTOS)-$(HOSTARCH),darwin-ppc) BFD_ROOT_DIR = /usr/local/tools else +ifeq ($(HOSTARCH),$(ARCH)) +# native +BFD_ROOT_DIR = /usr +else #BFD_ROOT_DIR = /LinuxPPC/CDK # Linux/i386 #BFD_ROOT_DIR = /usr/pkg/cross # NetBSD/i386 -#BFD_ROOT_DIR = /usr # native BFD_ROOT_DIR = /opt/powerpc endif +endif #########################################################################