Skip to content

Commit

Permalink
Fix makefile for automatic hex2dfu compilation
Browse files Browse the repository at this point in the history
  • Loading branch information
Baldanos committed Jun 22, 2024
1 parent f42daef commit bb39551
Showing 1 changed file with 13 additions and 3 deletions.
16 changes: 13 additions & 3 deletions src/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -312,6 +312,13 @@ ULIBDIR =
# List all user libraries here
ULIBS =

# hex2dfu utility, depending on platform
ifeq ($(OS), Windows_NT)
HEX2DFU_BIN = ./build-scripts/hex2dfu.exe
else
HEX2DFU_BIN = ./build-scripts/hex2dfu
endif

# Flash tool with arguments depending on platform
ifeq ($(OS), Windows_NT)
FLASH_CMD = ../utils/windows_dfu_util/DfuSeCommand.exe -c --de 0 -d --fn
Expand All @@ -330,15 +337,18 @@ include $(RULESPATH)/rules.mk
FORCE:
.PHONY: FORCE

build-scripts/hex2dfu:
make -C build-scripts/

%.hdr: FORCE
$(OUT_LOG) echo Creating ./common/hydrafw_version.hdr
$(OUT_CMD) rm -f $(OBJDIR)/common.o
$(OUT_CMD) build-scripts/hydrafw-version ./common/hydrafw_version.hdr

%.dfu: %.hex $(LDSCRIPT)
%.dfu: %.hex $(LDSCRIPT) $(HEX2DFU_BIN)
$(OUT_LOG) echo Creating $@
$(OUT_LOG) echo ./build-scripts/hex2dfu -l ST... -r $(FW_REVISION) -i $< -o $@
$(OUT_CMD) ./build-scripts/hex2dfu -l ST... -r $(FW_REVISION) -i $< -o $@
$(OUT_LOG) echo $(HEX2DFU_BIN) -l ST... -r $(FW_REVISION) -i $< -o $@
$(OUT_CMD) $(HEX2DFU_BIN) -l ST... -r $(FW_REVISION) -i $< -o $@

# This rule hook is defined in the ChibiOS build system
PRE_MAKE_ALL_RULE_HOOK: ./common/hydrafw_version.hdr
Expand Down

0 comments on commit bb39551

Please sign in to comment.