barebox/arch/blackfin/Makefile
Loïc Minier 4e26fba680 Only pass -P to cpp when generating ld scripts
When building sandbox with ccache, one would hit warnings such as:
    warning: 'struct mmsghdr' declared inside parameter list
on random files; a way to reproduce this issue is to build a simple
file doing just:
    #include <sys/socket.h>

    int main(void) {
        return 0;
    }

    gcc -Wall -P -c -o foo foo.c

But actually the -P flag is only useful when generating non-C files,
such as linker scripts in the case of barebox.  Removing the -P flag
from all the gcc invocations, except when generating .lds files makes
the warning go away.  It turns out that this is what
linux/scripts/Makefile.build also does nowadays.

Signed-off-by: Loïc Minier <loic.minier@linaro.org>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2011-10-18 09:18:41 +02:00

54 lines
855 B
Makefile

CPPFLAGS += -fno-strict-aliasing
board-$(CONFIG_MACH_IPE337) := ipe337
cpu-$(CONFIG_BF561) := bf561
TEXT_BASE = $(CONFIG_TEXT_BASE)
CPPFLAGS += -DTEXT_BASE=$(TEXT_BASE)
CFLAGS += -D__blackfin__
# -Ttext $(TEXT_BASE)
KALLSYMS += --symbol-prefix=_
ifndef CONFIG_BFIN_BOOT_BYPASS
all: barebox.ldr
endif
archprepare: maketools
PHONY += maketools
ifneq ($(board-y),)
BOARD := arch/blackfin/boards/$(board-y)/
else
BOARD :=
endif
ifneq ($(cpu-y),)
CPU := arch/blackfin/cpu-$(cpu-y)/
else
CPU :=
endif
common-y += $(BOARD)
common-y += arch/blackfin/lib/ $(CPU)
lds-y += $(BOARD)/barebox.lds
ifdef CONFIG_BFIN_BOOT_FLASH16
FLASHBITS :=-B 16
else
FLASHBITS :=
endif
ifneq ($(cpu-y),)
ifndef CONFIG_BFIN_BOOT_BYPASS
barebox.ldr: barebox
rm -f $@
$(CROSS_COMPILE)ldr -T $(cpu-y) -c $(FLASHBITS) -i $(CPU)/init_sdram.o $@ $<
endif
endif