From bf4ec9a0178c9720a3d67f787d615d93977aed9c Mon Sep 17 00:00:00 2001 From: Ian Campbell Date: Wed, 14 Oct 2015 21:10:07 +0100 Subject: [PATCH] Makefile: Split out target tools rules Target tools are those which are only useful on a target sunxi system (i.e. which probe hardware etc). Currently this is only sunxi-pio. At first I thought sunxi-nand-part might be included, but I think that is useful on NAND images as well as actual devices. This will allow for easier packaging, by letting packagers only include the target tools when building for a suitable ARM architecture. Signed-off-by: Ian Campbell Acked-by: Peter Korsgaard --- Makefile | 19 +++++++++++++------ 1 file changed, 13 insertions(+), 6 deletions(-) diff --git a/Makefile b/Makefile index c6b790f..67dfafa 100644 --- a/Makefile +++ b/Makefile @@ -21,24 +21,31 @@ CFLAGS = -g -O0 -Wall -Wextra CFLAGS += -std=c99 -D_POSIX_C_SOURCE=200112L CFLAGS += -Iinclude/ -TOOLS = sunxi-fexc bin2fex fex2bin sunxi-bootinfo sunxi-fel sunxi-pio +# Tools useful on host and target +TOOLS = sunxi-fexc bin2fex fex2bin sunxi-bootinfo sunxi-fel TOOLS += sunxi-nand-part +# Tools which are only useful on the target +TARGET_TOOLS = sunxi-pio + MISC_TOOLS = phoenix_info CROSS_COMPILE ?= arm-none-eabi- -.PHONY: all clean +.PHONY: all clean tools target-tools -all: $(TOOLS) +all: tools target-tools + +tools: $(TOOLS) +target-tools: $(TARGET_TOOLS) misc: $(MISC_TOOLS) clean: - @rm -vf $(TOOLS) $(MISC_TOOLS) *.o *.elf *.sunxi *.bin *.nm *.orig + @rm -vf $(TOOLS) $(TARGET_TOOLS) $(MISC_TOOLS) *.o *.elf *.sunxi *.bin *.nm *.orig -$(TOOLS): Makefile common.h +$(TOOLS) $(TARGET_TOOLS): Makefile common.h fex2bin bin2fex: sunxi-fexc ln -s $< $@ @@ -115,6 +122,6 @@ sunxi-meminfo: meminfo.c $(CROSS_COMPILE)gcc -g -O0 -Wall -static -o $@ $^ .gitignore: Makefile - @for x in $(TOOLS) '*.o' '*.swp'; do \ + @for x in $(TOOLS) $(TARGET_TOOLS) '*.o' '*.swp'; do \ echo "$$x"; \ done > $@