Bjdooks/fix fpga bootrom makefile (#2969)

The prints after the command invocation makes it easier to work
out what went wrong if you get errors in the command, which end
up being done silently.

For testing, it is useful to be able to control where the CC and
OBJCOPY commands are coming from.

---------

Signed-off-by: Ben Dooks <ben.dooks@codethink.co.uk>
Co-authored-by: JeanRochCoulon <jean-roch.coulon@thalesgroup.com>
This commit is contained in:
Ben Dooks 2025-05-23 12:59:45 +01:00 committed by GitHub
parent 86ad99fda5
commit 92b2d0b73b
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -17,8 +17,8 @@ UART_BITRATE ?= 115200
HAS_ETHERNET ?= 1
endif
CC = $(RISCV)/bin/${CROSSCOMPILE}gcc
OBJCOPY = $(RISCV)/bin/$(CROSSCOMPILE)objcopy
CC ?= $(RISCV)/bin/${CROSSCOMPILE}gcc
OBJCOPY ?= $(RISCV)/bin/$(CROSSCOMPILE)objcopy
SED = sed
PLATFORM_DEFINES = -DCLOCK_FREQUENCY=$(CLOCK_FREQUENCY) -DUART_BITRATE=$(UART_BITRATE) -D$(PLATFORM)
@ -65,12 +65,12 @@ $(MAIN): $(DTB) $(OBJS_C) $(OBJS_S) linker.lds
$(OBJCOPY) -O binary $< $@
%.o: %.c
@$(CC) $(CFLAGS) $(INCLUDES) -c $< -o $@
@echo "CC <= $<"
@$(CC) $(CFLAGS) $(INCLUDES) -c $< -o $@
%.o: %.S
@$(CC) $(CFLAGS) $(CCASFLAGS) $(INCLUDES) -c $< -o $@
@echo "CC <= $<"
@$(CC) $(CFLAGS) $(CCASFLAGS) $(INCLUDES) -c $< -o $@
%.dts: %.dts.in
$(SED) -e "s/DRAM_SIZE_64/$(DRAM_SIZE_64)/g" \
@ -85,8 +85,8 @@ $(MAIN): $(DTB) $(OBJS_C) $(OBJS_S) linker.lds
dtc -I dts $< -O dtb -o $@
%.sv: %.img
./gen_rom.py $<
@echo "PYTHON >= $(MAIN_SV)"
./gen_rom.py $<
clean:
$(RM) $(OBJS_C) $(OBJS_S) $(MAIN) $(MAIN_BIN) $(MAIN_IMG) *.dtb *.dts *.sv