''.PHONY'' für targets die keine Dateien erzeugen und und immer ausgeführt werden sollen / ''FORCE'' für targets die files erzeugen und immer ausgeführt werden sollen (''FORCE'' selbst ist nicht ''.PHONY'') [[https://github.com/RIOT-OS/RIOT/pull/9623|Quelle]] ====== GNU Make cheat scheet ====== ===== Variables ===== [[https://www.gnu.org/software/make/manual/html_node/Automatic-Variables.html|Ofiziell]]. | ''$@'' | ''**target**: a b a c'' | | ''$%'' | The target member name, when the target is an archive member. | | ''$<'' | ''target: **a** b a c'' | | ''$?'' | ''target: a **b** a **c**'' (newer prerequisites) | | ''$^'' | ''target: **a** **b** a **c**'' | | ''$+'' | ''target: **a** **b** **a** **c**'' | | ''$*'' | The stem with which an implicit rule matches. | | ''$|'' | ''target: a b a c | **d** **e** **f**'' | ... da fehlen welche | ''CPPFLAGS'' | Compiler, alle Sprachen (z.B. ''-I...'') | | ''CFLAGS'' | Compiler, nur C (z.B. ''-std=...'') | | ''CXXFLAGS'' | Compiler, nur C++ | ===== Functions ===== [[https://www.gnu.org/software/make/manual/html_node/Text-Functions.html|Ofiziell]]. | ''$(**subst** from,to,text)'' | Fixed string replacement. | | ''$(**patsubst** %-from,%to,text)'' | %-Pattern replacement. \\ Alternative 1: ''$(var:%-from=%-to)'' \\ Alternative 2: ''$(var:suffix=replacement)'' | | ''$(**strip** string)'' | Remove whitespace at the ends (like ''trim''). | | ''$(**findstring** find,text)'' | Return ''"find"'' or ''""''. | | ''$(**filter** pattern...,word...)'' | Return //word// which matches any %-pattern | | ''$(**filter-out** pattern...,word...)'' | Return //word// which mateches none %-pattern. | | ''$(**sort** word...)'' | 1) Sort words, 2) removing duplicates. | | ''$(**dir** names...)'' | Extract the directory part of each file name. | | ''$(**notdir** names...)'' | Extract the non-directory part of each file name. | | ''$(**suffix** names...)'' | Extract the suffix (the last dot and following characters) of each file name. | | ''$(**basename** names...)'' | Extract the base name (name without suffix) of each file name. | | ''$(**addsuffix** suffix,names...)'' | Append suffix to each word in names. | | ''$(**addprefix** prefix,names...)'' | Prepend prefix to each word in names. | | ''$(**join** list1,list2)'' | Join two parallel lists of words. | | ''$(**word** n,word...)'' | The //n//th word. | | ''$(**firstword** word...)'' | The //1//th word. | | ''$(**wordlist** s,e,word...)'' | The //s//th ... //e//th word. | | ''$(**words** word...)'' | Number of words. | | ''$(**wildcard** pattern...)'' | Find file names matching a shell file name pattern (not a `%' pattern). | | ''$(**error** text...)'' | When this function is evaluated, make generates a fatal error with the message text. | | ''$(**warning** text...)'' | When this function is evaluated, make generates a warning with the message text. | | ''$(**shell** command)'' | Execute a shell command and return its output. | | ''$(**origin** variable)'' | Return a string describing how the make variable variable was defined. | | ''$(**foreach** var,words,text)'' | Evaluate text with var bound to each word in words, and concatenate the results. | | ''$(**call** var,param,...)'' | Evaluate the variable var replacing any references to ''$(1)'', ''$(2)'' with the first, second, etc. param values. | ... da fehlen welche