makefile debugging

Daniel Santos daniel.santos at pobox.com
Thu Jan 18 11:48:18 PST 2024


On 1/18/24 12:01, Tim Harvey wrote:
> Greetings,
>
> I seem to recall a way to ask OpenWrt's build system to output a list
> of all variable values used in the build but can't find it documented
> or in my notes. Does anyone know how to do that?
>
> Also, is there a way to output a post-processed Makefile after all the
> define foo gets done? I find it pretty difficult to work through the
> build system, especially when working with images.
>
> Best Regards,
>
> Tim
This is what I use for variables. I don't know if there's a way to get a 
post-processed Makefile -- that could be helpful, but also sounds like a 
bear to parse.

$(foreach v, \
	$(shell echo "$(filter-out .VARIABLES,$(.VARIABLES))" | tr ' ' '\n' | sort), \
	$(info /tmp/make_vars,$(shell printf "%-20s" "$(v)")= $(value $(v))) \
)

Daniel




More information about the openwrt-devel mailing list