Daniel Dunbar | b3a6901 | 2009-06-26 16:47:03 +0000 | [diff] [blame] | 1 | # Makefile utilities |
| 2 | |
| 3 | ### |
| 4 | # Utility functions |
| 5 | |
| 6 | # Function: Set variable value |
| 7 | # |
| 8 | # Set the given make variable to the given value. |
| 9 | Set = $(eval $(1) := $(2)) |
| 10 | |
| 11 | # Function: Append variable value |
| 12 | # |
| 13 | # Append the given value to the given make variable. |
| 14 | Append = $(eval $(1) += $(2)) |
| 15 | |
| 16 | ### |
| 17 | # Clean up make behavior |
| 18 | |
| 19 | # Cancel all suffix rules. We don't want no stinking suffix rules. |
| 20 | .SUFFIXES: |
| 21 | |
| 22 | ### |
| 23 | # Debugging |
| 24 | |
Daniel Dunbar | 557a6ea | 2010-01-13 16:13:01 +0000 | [diff] [blame^] | 25 | # General debugging rule, use 'make print-XXX' to print the definition, value |
| 26 | # and origin of XXX. |
| 27 | make-print-%: |
Daniel Dunbar | b3a6901 | 2009-06-26 16:47:03 +0000 | [diff] [blame] | 28 | $(error PRINT: $(value $*) = "$($*)" (from $(origin $*))) |
| 29 | |