Fix to linux makefile to support disassembly and creating vmlinux automatically.

This commit is contained in:
Rose Thompson 2023-11-21 17:59:22 -06:00
parent d57ec045de
commit 6461f0fa63

View file

@ -1,5 +1,5 @@
RISCV := /opt/riscv
BUILDROOT := ${RISCV}/buildroot
RISCV := /home/rose/repos/
BUILDROOT := ${RISCV}/buildroot-test
IMAGES := ${BUILDROOT}/output/images
WALLY := $(shell dirname $(shell pwd))
WALLYLINUX := $(shell pwd)
@ -55,10 +55,23 @@ $(RISCV):
# Disassembly rules ---------------------------------------------------
vmlinux:
sed 's/BR2_LINUX_KERNEL_IMAGE=y/\# BR2_LINUX_KERNEL_IMAGE is not set/g' ${BR2023}/main.config > ${BR2023}/main-vmlinux.config
sed -i 's/\# BR2_LINUX_KERNEL_VMLINUX is not set/BR2_LINUX_KERNEL_VMLINUX=y/g' ${BR2023}/main-vmlinux.config
sed -i 's/\# BR2_TARGET_OPENSBI_LINUX_PAYLOAD is not set//g' ${BR2023}/main-vmlinux.config
cp $(BR2023)/main-vmlinux.config $(WALLYBOARD)/main.config
cp $(BR2023)/main-vmlinux.config $(BUILDROOT)/.config
make -C $(BUILDROOT) --jobs
disassemble:
mkdir -p $(DIS)
make -j $(OBJDUMPS)
Image:
cp $(BR2023)/main.config $(WALLYBOARD)/main.config
cp $(BR2023)/main.config $(BUILDROOT)/.config
make -C $(BUILDROOT) --jobs
$(DIS)/%.objdump: $(IMAGES)/%.elf
riscv64-unknown-elf-objdump -DS $< >> $@