Are makefiles Turing complete?

Yes, see this. Once you have lambda, it’s all downhill from there. Here is a plagiarized Fibonacci example This should be enough to build a foundation for more generality (I’ve got to get back to work, or I’d play more.) dec = $(patsubst .%,%,$1) not = $(if $1,,.) lteq = $(if $1,$(if $(findstring $1,$2),.,),.) gteq … Read more

gnu make: list the values of all variables (or “macros”) in a particular run

GNU make provides .VARIABLES which holds all global variables’ names. However, this includes built-in variables(like MAKEFLAGS). If you have to exclude built-in variables, some filtering like the following might be needed. The following makefile prints user-defined variables(CUR-DIR, LOG-DIR) using info: # Place this line at the top of your Makefile VARS_OLD := $(.VARIABLES) # Define … Read more