successfully using assembler to generate .hex rather than writing straight machine code
This commit is contained in:
@@ -13,8 +13,11 @@ LDFLAGS = -T test.ld
|
||||
%.o: %.S
|
||||
$(AS) $(ASFLAGS) $^ -o $@
|
||||
|
||||
%.o: %.c
|
||||
$(CC) $(CFLAGS) $^ -o $@
|
||||
|
||||
%.elf: %.o
|
||||
$(LD) $(LDFLAGS) $^ -o $@
|
||||
|
||||
test.hex: test.elf
|
||||
riscv64-linux-gnu-objdump -s $^ | sed -n '/0000/,$$p' | cut -f3-6 -d ' ' | sed -e 's/ /\n/g' > $@
|
||||
riscv64-linux-gnu-objdump -s $^ | sed -n '/0000/,$$p' | cut -f3-6 -d ' ' | sed -e 's/ /\n/g' | sed 's/^\(..\)\(..\)\(..\)\(..\)/\4\3\2\1/' > $@
|
||||
|
Reference in New Issue
Block a user