Giovanni wrote:Hi Faisal,
Try this:
Code: Select all
BOARD_PATH := $(CHIBIOS)/os/hal/boards/ST_NUCLEO64_G474RE
BOARD_FILES := $(BOARD_PATH)/board.c $(BOARD_PATH)/board.h
PRE_MAKE_ALL_RULE_HOOK : $(BOARD_FILES)
$(BOARD_FILES) &: $(BOARD_PATH)/cfg/board.chcfg $(BOARD_PATH)/cfg/board.fmpp
@echo "Rebuilding board files"
@echo
@fmpp -C $(BOARD_PATH)/cfg/board.fmpp -O $(BOARD_PATH)/
Note that it requires make 4.3, it is not included in ChibiStudio, this works:
https://packages.msys2.org/package/ming ... 86_64-makeRename it to "make.exe" and replace the existing one.
Giovanni
Sorry, I was half asleep when I made the post - there were several errors. Thanks for your code, it almost works
. I didn't know about the "&:" operator. I placed your code before rules.mk is included. Is that the right spot? Or does it matter?
I do a make clean, then a make all. It builds the board files, and goes on the build the rest of the project. Then, I touch board.chcfg, and do a make all again. It rebuilds the board file, and what looks like most of the files in the project. Here's the kicker - I do another make all, and it continues to build a whole bunch of stuff again. After a third make all, it says there is nothing to do. I picked on a few files to demonstrate:
There are 4 assembly files in the project. The first time I do a make clean, then a make all I get this:
Compiling chcoreasm_v7m.S
Compiling vectors.S
Compiling crt0_v7m.S
Compiling crt1.c
Then I touch board.chcfg and I get this after the next make all:
Compiling vectors.S
Compiling chcoreasm_v7m.S
Then after another make all:
Compiling crt0_v7m.S
Then after another make all:
Nothing to be done for 'all'