make: replace curly braces with parenthesis#8822
Conversation
|
Did you use a script to perform the replaces? |
No, just query replaces by hand. |
jnohlgard
left a comment
There was a problem hiding this comment.
There are many places where the text in a makefile is passed to the shell, there curly braces can't be replaced or it will break
makefiles/buildtests.inc.mk
Outdated
| ${COLOR_ECHO} -n "Building for $$board ... " ; \ | ||
| BOARD=$${board} RIOT_CI_BUILD=1 RIOT_VERSION_OVERRIDE=buildtest \ | ||
| $(COLOR_ECHO) -n "Building for $$board ... " ; \ | ||
| BOARD=$$(board) RIOT_CI_BUILD=1 RIOT_VERSION_OVERRIDE=buildtest \ |
There was a problem hiding this comment.
Here, the curly braces matter
makefiles/buildtests.inc.mk
Outdated
| $(MAKE) clean-intermediates >/dev/null 2>&1 || true; \ | ||
| done ; \ | ||
| $${RESULT} | ||
| $$(RESULT) |
makefiles/info-global.inc.mk
Outdated
| for board in ${BOARDS}; do \ | ||
| echo "$$(BOARD=$${board} $(MAKE) --no-print-directory info-buildsize 2>/dev/null | tail -n-1 | cut -f-4)" "$${board}"; \ | ||
| for board in $(BOARDS); do \ | ||
| echo "$$(BOARD=$$(board) $(MAKE) --no-print-directory info-buildsize 2>/dev/null | tail -n-1 | cut -f-4)" "$$(board)"; \ |
makefiles/info-global.inc.mk
Outdated
| for BINDIRBASE in $${OLDBIN} $${NEWBIN}; do \ | ||
| BINDIRBASE=$${BINDIRBASE} BOARD=$${board} $(MAKE) info-buildsize --no-print-directory 2>/dev/null | tail -n-1 | cut -f-4; \ | ||
| for board in $(BOARDS); do \ | ||
| for BINDIRBASE in $$(OLDBIN) $$(NEWBIN); do \ |
makefiles/info-global.inc.mk
Outdated
| BINDIRBASE=$${BINDIRBASE} BOARD=$${board} $(MAKE) info-buildsize --no-print-directory 2>/dev/null | tail -n-1 | cut -f-4; \ | ||
| for board in $(BOARDS); do \ | ||
| for BINDIRBASE in $$(OLDBIN) $$(NEWBIN); do \ | ||
| BINDIRBASE=$$(BINDIRBASE) BOARD=$$(board) $(MAKE) info-buildsize --no-print-directory 2>/dev/null | tail -n-1 | cut -f-4; \ |
makefiles/info-global.inc.mk
Outdated
| for I in 0 1 2 3; do echo -ne "$${NEW[I]-${COLOR_RED}ERR${COLOR_RESET}}\t"; done; echo -e "$${NEWBIN}\n"; \ | ||
| echo "$$(board)"; \ | ||
| for I in 0 1 2 3; do echo -ne "$$(OLD[I]-$(COLOR_RED)ERR$(COLOR_RESET))\t"; done; echo -e "$$(OLDBIN)"; \ | ||
| for I in 0 1 2 3; do echo -ne "$$(NEW[I]-$(COLOR_RED)ERR$(COLOR_RESET))\t"; done; echo -e "$$(NEWBIN)\n"; \ |
makefiles/info-global.inc.mk
Outdated
|
|
||
| info-boards-features-missing: | ||
| @for f in $(BOARDS_FEATURES_MISSING); do echo $${f}; done | column -t | ||
| @for f in $(BOARDS_FEATURES_MISSING); do echo $$(f); done | column -t |
makefiles/info.inc.mk
Outdated
| tail -n+2 | \ | ||
| sed -e 's#$(BINDIR)##' | \ | ||
| sort -rnk$${SORTROW} | ||
| sort -rnk$$(SORTROW) |
|
I did not mark all mistakes, but look for double dollar signs in the diff and verify those one more time |
|
oups, you are right, I'll fix them. |
|
@gebart, I reverted the wrong changes. I think it should be ok now. |
|
@gebart do you see other problems here ? |
|
I will check this afternoon. |
cladmi
left a comment
There was a problem hiding this comment.
I did not find other occurrence of ${ in makefiles. I used this command to check:
git grep '${' | grep -v '$${' | grep -v -e '\.sh:' -e '^dist/' -e .murdock -e mkbootc -e README.md -e 'generate-cmake-xcompile.perl' -e 'doc/doxygen'
The changes look ok by looking at the diff.
Follow up to RIOT-OS#8822 cleanup.
Follow up to RIOT-OS#8822 cleanup.
Follow up to RIOT-OS#8822 cleanup.
Follow up to RIOT-OS#8822 cleanup.
Follow up to RIOT-OS#8822 cleanup.
Contribution description
This PR is a follow-up of #8815 but applied to all Makefiles. Then the use of
$(variable)is consistent across all makefiles (instead of mixing it with${variable}).Maybe @cladmi is interested ?
Issues/PRs references