To reverse a list of words separated by white-space, the reverse
can be called as a function with e.g. $(call reverse, a b c)
.
Created
October 25, 2024 08:26
-
-
Save amn/fa8b75db148abe55a8004451a5642e81 to your computer and use it in GitHub Desktop.
A "reverse list" function for [GNU] Make
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
reverse = $(lastword $(1)) $(and $(1),$(call reverse,$(wordlist 1,$(shell echo $$(($(words $(1)) - 1))),$(1)))) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment