FAQ Database Discussion Community


How to programmatically define targets in GNU Make?

makefile,gnu-make,bsdmake
I am not aware of any way to define programatically targets in GNU Make. How is this possible? Sometimes one can go away with alternate methods. The ability to define programatically targets in Makefiles is however a very important to write and organise complex production rules with make. Examples of...

GNU make equivalent to BSD make's $(var:Q)?

makefile,make,gnu-make,bsdmake
BSD make has a :Q variable expansion modifier, documented in the FreeBSD make man page as follows: :Q Quotes every shell meta-character in the variable, so that it can be passed safely through recursive invocations of make. If variable var has value a b\c"d'e$f, then $(var:Q) expands to a\ b\\c\"d\'e\$f...