meta data for this page
  •  

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Next revision
Previous revision
programming:makefile:functions [2024/03/22 09:35] – created niziakprogramming:makefile:functions [2025/09/23 09:51] (current) niziak
Line 11: Line 11:
   * $(**addprefix**)   * $(**addprefix**)
   * $(**join**)   * $(**join**)
-  * $(**wildcard**)+  * $(**wildcard**) - execute wildcard expansion (needed to expand wildcards in variables and arguments in functions). More: [[https://www.gnu.org/software/make/manual/html_node/Wildcard-Function.html|The Function wildcard]]
   * $(**realpath**) - NOTE: file must exist!   * $(**realpath**) - NOTE: file must exist!
   * $(**abspath**) - NOTE: do not require file to exist   * $(**abspath**) - NOTE: do not require file to exist
  
 +[[https://www.gnu.org/software/make/manual/html_node/Conditional-Functions.html|Conditional Functions]] - can be used also in recipes body:
  
 +  * $(**if**)\\ Example 1: <code make> 
 +build: 
 +    $(if $(filter 1,$(WORKSPACE_DETECTED)),
 +      @echo 
 +      @echo "!!! Configured workspace detected: '$(WORKSPACE_PATH)'" 
 +    ) 
 +</code> Example 2: <code make> 
 +$(if $(filter foo,bar),@echo match is broken,@echo match works) 
 +$(if $(filter-out foo,bar),@echo match works,@echo match is broken) 
 +</code>