diff options
author | Alex Bennée <alex.bennee@linaro.org> | 2013-12-19 12:14:43 +0000 |
---|---|---|
committer | Peter Maydell <peter.maydell@linaro.org> | 2014-11-28 18:05:39 +0000 |
commit | 03cd8f95445b7d7fd0457c8ee4693db4f29c1838 (patch) | |
tree | b0271778fb1c15fb8381df05a73f2c53f0d21aa4 | |
parent | 6a7d33d8f8c46711dfc9129d3384c3c5fa16049f (diff) |
Makefile: Add "dump" target to aid debugging
This will dump any risu.bin files to the risu.asm files which are so
useful for working through stuff. Of course you can run an individual
make target by running:
make simd_copy.risu.asm
Signed-off-by: Alex Bennée <alex.bennee@linaro.org>
-rw-r--r-- | .gitignore | 1 | ||||
-rw-r--r-- | Makefile | 9 | ||||
-rwxr-xr-x | configure | 3 |
3 files changed, 13 insertions, 0 deletions
@@ -1,6 +1,7 @@ # Ignore binaries and any lurking coredumps *.o *.bin +*.risu.asm risu core config.h @@ -20,13 +20,22 @@ SRCS=risu.c comms.c risu_$(ARCH).c risu_reginfo_$(ARCH).c HDRS=risu.h BINS=test_$(ARCH).bin +# For dumping test patterns +RISU_BINS=$(wildcard *.risu.bin) +RISU_ASMS=$(patsubst %.bin,%.asm,$(RISU_BINS)) + OBJS=$(SRCS:.c=.o) all: $(PROG) $(BINS) +dump: $(RISU_ASMS) + $(PROG): $(OBJS) $(CC) $(STATIC) $(CFLAGS) -o $@ $^ +%.risu.asm: %.risu.bin + ${OBJDUMP} -b binary -m $(ARCH) -D $^ > $@ + %.o: %.c $(HDRS) $(CC) $(CPPFLAGS) $(CFLAGS) -o $@ -c $< @@ -37,6 +37,7 @@ generate_makefilein() { echo "CC:=${CC}" >> $m echo "AS:=${AS}" >> $m echo "OBJCOPY:=${OBJCOPY}" >> $m + echo "OBJDUMP:=${OBJDUMP}" >> $m echo "STATIC:=${STATIC}" >> $m echo "...done" @@ -64,6 +65,7 @@ Some influential environment variables: AS assembler command OBJCOPY object copy utility command + OBJDUMP object dump utility command EOF } @@ -86,6 +88,7 @@ done CC="${CC-${CROSS_PREFIX}gcc}" AS="${AS-${CROSS_PREFIX}as}" OBJCOPY="${OBJCOPY-${CROSS_PREFIX}objcopy}" +OBJDUMP="${OBJDUMP-${CROSS_PREFIX}objdump}" if test "x${ARCH}" = "x"; then guess_arch |