Commit 209633ab authored by Bernhard Nortmann's avatar Bernhard Nortmann
Browse files

Makefile: Unify rules for target-tools, narrow down on dependencies



This appends sunxi-meminfo to the TARGET_TOOLS, and adds a new rule
to fix the compilation of sunxi-pio (by making it *cross-compile*
for the target).

Additionally adds a new build target "make install-misc".

For more details, see github issues #69 and #70.
Signed-off-by: default avatarBernhard Nortmann <bernhard.nortmann@web.de>
parent 5244e88f
......@@ -39,8 +39,9 @@ TOOLS = sunxi-fexc sunxi-bootinfo sunxi-fel sunxi-nand-part
FEXC_LINKS = bin2fex fex2bin
# Tools which are only useful on the target
TARGET_TOOLS = sunxi-pio
TARGET_TOOLS = sunxi-meminfo sunxi-pio
# Misc tools (of more "exotic" nature) not part of our default build / install
MISC_TOOLS = phoenix_info sunxi-nand-image-builder
# ARM binaries and images
......@@ -61,7 +62,7 @@ target-tools: $(TARGET_TOOLS)
all: tools target-tools
misc: version.h $(MISC_TOOLS)
misc: $(MISC_TOOLS)
binfiles: $(BINFILES)
......@@ -83,12 +84,18 @@ install-target-tools: $(TARGET_TOOLS)
install -m0755 $$t $(DESTDIR)$(BINDIR)/$$t ; \
done
install-misc: $(MISC_TOOLS)
install -d $(DESTDIR)$(BINDIR)
@set -ex ; for t in $^ ; do \
install -m0755 $$t $(DESTDIR)$(BINDIR)/$$t ; \
done
clean:
@rm -vf $(TOOLS) $(FEXC_LINKS) $(TARGET_TOOLS) $(MISC_TOOLS)
@rm -vf version.h *.o *.elf *.sunxi *.bin *.nm *.orig
$(TOOLS) $(TARGET_TOOLS): Makefile common.h version.h
$(TOOLS) $(TARGET_TOOLS) $(MISC_TOOLS): Makefile common.h version.h
fex2bin bin2fex: sunxi-fexc
ln -nsf $< $@
......@@ -113,6 +120,8 @@ sunxi-nand-part: nand-part-main.c nand-part.c nand-part-a10.h nand-part-a20.h
sunxi-%: %.c
$(CC) $(CFLAGS) $(LDFLAGS) -o $@ $(filter %.c,$^) $(LIBS)
phoenix_info: phoenix_info.c
$(CC) $(CFLAGS) $(LDFLAGS) -o $@ $< $(LIBS)
%.bin: %.elf
$(CROSS_COMPILE)objcopy -O binary $< $@
......@@ -153,11 +162,14 @@ boot_head_sun5i.elf: boot_head.S boot_head.lds
sunxi-bootinfo: bootinfo.c
# target tools
TARGET_CFLAGS = -g -O0 -Wall -Wextra -std=c99 $(DEFINES) -Iinclude/ -static
sunxi-pio: pio.c
$(CROSS_COMPILE)gcc $(TARGET_CFLAGS) -o $@ $<
sunxi-meminfo: meminfo.c
$(CROSS_COMPILE)gcc -g -O0 -Wall -static -o $@ $^
$(CROSS_COMPILE)gcc $(TARGET_CFLAGS) -o $@ $<
sunxi-script_extractor: script_extractor.c
$(CROSS_COMPILE)gcc -g -O0 -Wall -static -o $@ $^
$(CROSS_COMPILE)gcc $(TARGET_CFLAGS) -o $@ $<
version.h:
@./autoversion.sh > $@
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment