mirror of
https://github.com/openhwgroup/cvw
synced 2025-02-11 06:05:49 +00:00
Actually fix buildroot makefile
This commit is contained in:
parent
ec7e3d4f3b
commit
ab885287bb
@ -6,6 +6,13 @@ DIS := ${IMAGES}/disassembly
|
|||||||
BRPACKAGES := $(WALLYLINUX)/buildroot-packages
|
BRPACKAGES := $(WALLYLINUX)/buildroot-packages
|
||||||
BR2023 := $(WALLYLINUX)/buildroot-config-src/buildroot-2023.05.1
|
BR2023 := $(WALLYLINUX)/buildroot-config-src/buildroot-2023.05.1
|
||||||
|
|
||||||
|
# set sudo if needed depending on $RISCV
|
||||||
|
ifeq ($(shell mkdir -p $(RISCV)/.test > /dev/null 2>&1 ; echo $$?), 0)
|
||||||
|
SUDO :=
|
||||||
|
else
|
||||||
|
SUDO := sudo
|
||||||
|
endif
|
||||||
|
|
||||||
# Buildroot Config Stuff
|
# Buildroot Config Stuff
|
||||||
WALLYBOARDSRC := $(WALLYLINUX)/buildroot-config-src/wally
|
WALLYBOARDSRC := $(WALLYLINUX)/buildroot-config-src/wally
|
||||||
WALLYBOARD := $(BUILDROOT)/board/wally
|
WALLYBOARD := $(BUILDROOT)/board/wally
|
||||||
@ -31,23 +38,26 @@ OBJDUMPS := $(foreach name, $(OBJDUMPS), $(DIS)/$(name).objdump)
|
|||||||
all: check_write_permissions clean download Image disassemble install dumptvs
|
all: check_write_permissions clean download Image disassemble install dumptvs
|
||||||
|
|
||||||
check_write_permissions:
|
check_write_permissions:
|
||||||
@mkdir -p $(RISCV)/.test || \
|
ifeq ($(SUDO), sudo)
|
||||||
(echo "ERROR: Cannot write to '$(RISCV)'." \
|
@echo "Cannot write to '$(RISCV)'." \
|
||||||
"Make sure you have write permissions (you may need to run as sudo).'" >&2 \
|
"Using sudo (you may be prompted for your password several times throughout the install)"
|
||||||
|
endif
|
||||||
|
@$(SUDO) mkdir -p $(RISCV)/.test || \
|
||||||
|
(echo "ERROR: Still unable to write to '$(RISCV)'." >&2 \
|
||||||
&& exit 1)
|
&& exit 1)
|
||||||
@rm -r $(RISCV)/.test
|
@$(SUDO) rm -r $(RISCV)/.test
|
||||||
|
|
||||||
Image:
|
Image:
|
||||||
bash -c "unset LD_LIBRARY_PATH; make -C $(BUILDROOT) --jobs ${shell nproc --ignore 1};"
|
bash -c "unset LD_LIBRARY_PATH; make -C $(BUILDROOT) --jobs ${shell nproc --ignore 1};"
|
||||||
$(MAKE) generate
|
$(MAKE) generate
|
||||||
|
|
||||||
install: check_write_permissions
|
install: check_write_permissions
|
||||||
rm -rf $(RISCV)/$(BUILDROOT)
|
$(SUDO) rm -rf $(RISCV)/$(BUILDROOT)
|
||||||
mv $(BUILDROOT) $(RISCV)/$(BUILDROOT)
|
$(SUDO) mv $(BUILDROOT) $(RISCV)/$(BUILDROOT)
|
||||||
|
|
||||||
dumptvs: check_write_permissions
|
dumptvs: check_write_permissions
|
||||||
mkdir -p $(RISCV)/linux-testvectors
|
$(SUDO) mkdir -p $(RISCV)/linux-testvectors
|
||||||
cd testvector-generation; ./genInitMem.sh
|
cd testvector-generation; $(SUDO) ./genInitMem.sh
|
||||||
|
|
||||||
generate: $(DTB) $(IMAGES)
|
generate: $(DTB) $(IMAGES)
|
||||||
|
|
||||||
|
@ -26,9 +26,9 @@ fi
|
|||||||
|
|
||||||
echo "Launching QEMU in replay mode!"
|
echo "Launching QEMU in replay mode!"
|
||||||
(qemu-system-riscv64 \
|
(qemu-system-riscv64 \
|
||||||
-M virt -m 256M -dtb $DEVICE_TREE \
|
-M virt -m 256M -dtb "$DEVICE_TREE" \
|
||||||
-nographic \
|
-nographic \
|
||||||
-bios $imageDir/fw_jump.elf -kernel $imageDir/Image -append "root=/dev/vda ro" -initrd $imageDir/rootfs.cpio \
|
-bios "$imageDir"/fw_jump.elf -kernel "$imageDir"/Image -append "root=/dev/vda ro" -initrd "$imageDir"/rootfs.cpio \
|
||||||
-gdb tcp::$tcpPort -S) \
|
-gdb tcp::$tcpPort -S) \
|
||||||
& riscv64-unknown-elf-gdb --quiet \
|
& riscv64-unknown-elf-gdb --quiet \
|
||||||
-ex "set pagination off" \
|
-ex "set pagination off" \
|
||||||
|
Loading…
Reference in New Issue
Block a user