RISCV := /opt/riscv BUILDROOT := ${RISCV}/buildroot IMAGES := ${BUILDROOT}/output/images WALLY := $(shell dirname $(shell pwd)) WALLYLINUX := $(shell pwd) DIS := ${IMAGES}/disassembly BRPACKAGES := $(WALLYLINUX)/buildroot-packages # Buildroot Config Stuff WALLYBOARDSRC := $(WALLYLINUX)/buildroot-config-src/wally WALLYBOARD := $(BUILDROOT)/board/wally # Buildroot Package Stuff PACKAGE_SOURCE := ${WALLYLINUX}/buildroot-packages/package-source FPGA_AXI_SDC := ${WALLYLINUX}/buildroot-packages/fpga-axi-sdc DRIVER := ${PACKAGE_SOURCE}/fpga-axi-sdc.c PATCHFILE := $(BRPACKAGES)/package.patch # Device tree files DTS ?= $(shell find -type f -regex ".*\.dts" | sort) DTB := $(DTS:%.dts=%.dtb) DTB := $(foreach name, $(DTB), $(IMAGES)/$(shell basename $(name))) # Disassembly stuff BINARIES := fw_jump.elf vmlinux busybox BINARIES := $(foreach name, $(BINARIES), $(shell find -type f -regex ".*$(name)")) OBJDUMPS := fw_jump.objdump vmlinux.objdump busybox.objdump OBJDUMPS := $(foreach name, $(OBJDUMPS), $(DIS)/$(name)) .PHONY: generate cleanDriver patch clean # Generate all device trees # TODO: Add configuration for only generating device tree for specified # supported FPGA. test: generate: $(DTB) $(DTB): $(DTS) dtc -I dts -O dtb $< > $@ disassemble: mkdir -p $(DIS) make -j $(OBJDUMPS) $(OBJDUMPS): $(BINARIES) riscv64-unknown-elf-objdump -DS $< >> $@ # Generating new Buildroot directories -------------------------------- # This directive should be run as: make newbr BUILDROOT=path/to/buildroot newbr: $(BUILDROOT) $(DRIVER) @ echo "Patching buildroot directory at: $<" @ echo "Copying wally configuration files and rootfs_overlay to buildroot." cp -r $(WALLYLINUX)/buildroot-config-src/wally $