13.07.2015 Views

TASKING VX-toolset for ARM User Guide

TASKING VX-toolset for ARM User Guide

TASKING VX-toolset for ARM User Guide

SHOW MORE
SHOW LESS

Create successful ePaper yourself

Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.

Using the Utilities$(<strong>for</strong>each var-name, item ..., action)The <strong>for</strong>each function runs through a list of items and per<strong>for</strong>ms the same action <strong>for</strong> each item. Thevar-name is the name of the macro which gets dynamically filled with an item while iterating through theitem list. In the action you can refer to this macro. For example:results in:${<strong>for</strong>each T, test filter output, ${T}.c ${T}.h}test.c test.h filter.c filter.h output.c output.h10.3.5. Conditional ProcessingLines containing ifdef, ifndef, else or endif are used <strong>for</strong> conditional processing of the makefile.They are used in the following way:ifdef macro-nameif-lineselseelse-linesendifThe if-lines and else-lines may contain any number of lines or text of any kind, even other ifdef, ifndef,else and endif lines, or no lines at all.The else line may be omitted, along with the else-lines followingit. White spaces (tabs or spaces) in front of preprocessing directives are allowed.First the macro-name after the ifdef command is checked <strong>for</strong> definition. If the macro is defined thenthe if-lines are interpreted and the else-lines are discarded (if present). Otherwise the if-lines are discarded;and if there is an else line, the else-lines are interpreted; but if there is no else line, then no lines areinterpreted.When you use the ifndef line instead of ifdef, the macro is tested <strong>for</strong> not being defined. Theseconditional lines can be nested to any level.You can also add tests based on strings. With ifeq the result is true if the two strings match, with ifneqthe result is true if the two strings do not match. They are used in the following way:ifeq(string1,string2)if-lineselseelse-linesendif10.3.6. Makefile Parsingamk reads and interprets a makefile in the following order:1. When the last character on a line is a backslash (\) (i.e. without trailing white space) then that line andthe next line will be concatenated, removing the backslash and newline.253

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!