Functions allow you to do text processing in the makefile to compute the files to operate on or the commands to use in recipes. You use a function in a function call, where you give the name of the function and some text (the arguments) for the function to operate on. The result of the function’s processing is substituted into the makefile at the point of the call, just as a variable might be substituted.
• Syntax of Functions | How to write a function call. | |
• Text Functions | General-purpose text manipulation functions. | |
• File Name Functions | Functions for manipulating file names. | |
• Conditional Functions | Functions that implement conditions. | |
• Foreach Function | Repeat some text with controlled variation. | |
• File Function | Write text to a file. | |
• Call Function | Expand a user-defined function. | |
• Value Function | Return the un-expanded value of a variable. | |
• Eval Function | Evaluate the arguments as makefile syntax. | |
• Origin Function | Find where a variable got its value. | |
• Flavor Function | Find out the flavor of a variable. | |
• Make Control Functions | Functions that control how make runs. | |
• Shell Function | Substitute the output of a shell command. | |
• Guile Function | Use GNU Guile embedded scripting language. |
Copyright © 1988, 1989, 1990, 1991, 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011, 2012, 2013, 2014, 2015, 2016, 2017, 2018, 2019, 2020 Free Software Foundation, Inc.
Licensed under the GNU Free Documentation License.
https://www.gnu.org/software/make/manual/html_node/Functions.html