Skip to content

Commit

Permalink
makefiles/riotboot.mk: enforce rule precedence (signed.bin before .bin)
Browse files Browse the repository at this point in the history
make is a bit strange sometimes and considers various factors to decide
the precedence of the rule to be applied: definition order is one (and
the %.signed.bin is after %.bin, and would be also if we put it at the
end of Makefile.include), but also if a rule is implicit is then
preferred no matter the order.

A quite complete and coincise overview of the topic can be found here:
https://stackoverflow.com/questions/28842851/force-make-to-use-a-more-specific-rule

Given the inclusion mechanism used in RIOT it should be safer to
explicitly state things, although may seem ugly sometimes.
  • Loading branch information
fedepell authored and kYc0o committed Oct 30, 2018
1 parent 7004953 commit 359ee2e
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion makefiles/riotboot.mk
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ $(BINDIR)/$(APPLICATION)-slot1.elf: ROM_OFFSET=$(SLOT1_OFFSET)
$(BINDIR)/$(APPLICATION)-slot2.elf: ROM_OFFSET=$(SLOT2_OFFSET)

# create signed binary target
%.signed.bin: %.sig %.bin
$(BINDIR)/$(APPLICATION)-slot1.signed.bin $(BINDIR)/$(APPLICATION)-slot2.signed.bin: %.signed.bin: %.sig %.bin
@echo "creating $@..."
cat $^ > $@

Expand Down

0 comments on commit 359ee2e

Please sign in to comment.