RISCV := /opt/riscv BUILDROOT := ${RISCV}/buildroot IMAGES := ${BUILDROOT}/output/images WALLY := $(shell dirname $(shell pwd)) WALLYLINUX := $(shell pwd) PACKAGE_SOURCE := ${WALLYLINUX}/buildroot-packages/package-source FPGA_AXI_SDC := ${WALLYLINUX}/buildroot-packages/fpga-axi-sdc DRIVER := ${PACKAGE_SOURCE}/fpga-axi-sdc.c # Device tree file DTS ?= $(shell find -type f -regex ".*\.dts" | sort) DTB := $(DTS:%.dts=%.dtb) DTB := $(foreach name, $(DTB), $(IMAGES)/$(shell basename $(name))) .PHONY: generate cleanDriver patch clean # Generate all device trees # TODO: Add configuration for only generating device tree for specified # supported FPGA. generate: $(DTB) $(DTB): $(DTS) dtc -I dts -O dtb $< > $@ disassemble: # Generating new Buildroot directories -------------------------------- # This directive should be run as: make patch BUILDROOT=path/to/buildroot patch: $(BUILDROOT) $(DRIVER) @ echo "Patching buildroot directory at: $<" @ echo "Copying wally configuration files and rootfs_overlay to buildroot." cp -r $(WALLYLINUX)/buildroot-config-src/wally $