meta data for this page
  •  

Differences

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

Link to this comparison view

Both sides previous revisionPrevious revision
programming:makefile:functions [2024/08/22 20:02] niziakprogramming:makefile:functions [2025/09/23 09:51] (current) niziak
Line 15: Line 15:
   * $(**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>