diff --git a/linux/Makefile b/linux/Makefile index 41d9e00df..d846db791 100644 --- a/linux/Makefile +++ b/linux/Makefile @@ -7,17 +7,20 @@ PACKAGE_SOURCE := ${WALLYLINUX}/buildroot-packages/package-source FPGA_AXI_SDC := ${WALLYLINUX}/buildroot-packages/fpga-axi-sdc DRIVER := ${PACKAGE_SOURCE}/fpga-axi-sdc.c -DTS ?= $(shell find -type f -regex ".*\.dts" | sort) +# 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 +.PHONY: generate cleanDriver patch clean -# Generate device tree binaries from device tree source files -# Currently supported fpga device tree binaries are also generated -generate: $(DTS) $(IMAGES) - dtc -I dts -O dtb devicetree/wally-virt.dts > ${IMAGES}/wally-virt.dtb - dtc -I dts -O dtb devicetree/wally-vcu108.dts > ${IMAGES}/wally-vcu108.dtb - dtc -I dts -O dtb devicetree/wally-vcu118.dts > ${IMAGES}/wally-vcu118.dtb - dtc -I dts -O dtb devicetree/wally-vcu118.dts > ${IMAGES}/wally-artya7.dtb +# 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: @@ -29,12 +32,20 @@ patch: $(BUILDROOT) $(DRIVER) @ echo "Copying wally configuration files and rootfs_overlay to buildroot." cp -r $(WALLYLINUX)/buildroot-config-src/wally $