From 40096ac662297930a0f212471f2b9f0246b15882 Mon Sep 17 00:00:00 2001 From: Jacob Pease Date: Wed, 9 Aug 2023 12:31:14 -0500 Subject: [PATCH] Fixed bugs. Added an 'all' target that performs the whole process of building the images needed for booting linux, including device tree files. --- linux/Makefile | 34 ++++++++++++++++++++++++---------- 1 file changed, 24 insertions(+), 10 deletions(-) diff --git a/linux/Makefile b/linux/Makefile index 520536fe0..7c85e0ee4 100644 --- a/linux/Makefile +++ b/linux/Makefile @@ -23,17 +23,25 @@ DTB := $(foreach name, $(DTB), $(IMAGES)/$(shell basename $(name))) # Disassembly stuff BINARIES := fw_jump.elf vmlinux busybox -BINARIES := $(foreach name, $(BINARIES), $(IMAGES)/$(name)) -#BINARIES := $(foreach name, $(BINARIES), $(shell find -type f -regex ".*$(name)")) -OBJDUMPS := fw_jump.objdump vmlinux.objdump busybox.objdump -OBJDUMPS := $(foreach name, $(OBJDUMPS), $(DIS)/$(name)) +OBJDUMPS := $(foreach name, $(BINARIES), $(basename $(name) .elf)) +OBJDUMPS := $(foreach name, $(OBJDUMPS), $(DIS)/$(name).objdump) -.PHONY: generate disassemble install clean cleanDTB cleanDriver +.PHONY: all generate disassemble install clean cleanDTB cleanDriver test # Generate all device trees ------------------------------------------- # TODO: Add configuration for only generating device tree for specified # supported FPGA. +all: + $(MAKE) install + make -C $(BUILDROOT) --jobs + $(MAKE) generate + # TODO: Need to find a way to set the PATH for child processes. + # source ../setup.sh; $(MAKE) disassemble + +test: + @echo $(OBJDUMPS) + generate: $(DTB) $(IMAGES) $(IMAGES)/%.dtb: ./devicetree/%.dts @@ -43,6 +51,10 @@ $(IMAGES): @ echo "No output/images directory in buildroot." @ echo "Run make --jobs in buildroot directory before generating device tree binaries."; exit 1 +$(RISCV): + @ echo "ERROR: No $(RISCV) directory. Make sure you have installed the Wally Toolchain." + @ echo "this can be done with /bin/wally-tool-chain-install.sh" + # Disassembly rules --------------------------------------------------- disassemble: @@ -64,18 +76,20 @@ $(IMAGES)/busybox: $(BUILDROOT)/output/build/busybox-1.33.0/busybox # Generating new Buildroot directories -------------------------------- # This directive should be run as: make install BUILDROOT=path/to/buildroot -install: $(BUILDROOT)/package/fpga-axi-sdc $(WALLYBOARD)/main.config $(WALLYBOARD)/linux.config $(DRIVER) +install: $(BUILDROOT)/package/fpga-axi-sdc $(WALLYBOARD) $(DRIVER) cp $(WALLYBOARD)/main.config $(BUILDROOT)/.config # CONFIG DEPENDENCIES 2021.05 ----------------------------------------- -$(WALLYBOARD)/main.config: $(WALLYBOARD) $(BRPACKAGES)/wally.config - cp $(BRPACKAGES)/wally.config $@ +# $(WALLYBOARD)/main.config: $(WALLYBOARD) $(BRPACKAGES)/wally.config +# cp $(BRPACKAGES)/wally.config $@ -$(WALLYBOARD)/linux.config: $(WALLYBOARD) $(BRPACKAGES)/linux.config - cp $(BRPACKAGES)/linux.config $@ +# $(WALLYBOARD)/linux.config: $(BRPACKAGES)/linux.config $(WALLYBOARD) +# cp $(BRPACKAGES)/linux.config $@ $(WALLYBOARD): $(BUILDROOT) cp -r $(WALLYBOARDSRC) $(BUILDROOT)/board + cp $(BRPACKAGES)/wally.config $(WALLYBOARD)/main.config + cp $(BRPACKAGES)/linux.config $(WALLYBOARD)/linux.config # Buildroot Package --------------------------------------------------- $(BUILDROOT)/package/fpga-axi-sdc: $(BUILDROOT) $(PATCHFILE) $(BRPACKAGES)/fpga-axi-sdc