| [ < ] | [ > ] | [ << ] | [ Up ] | [ >> ] | [Top] | [Contents] | [Index] | [ ? ] |
Macros are canned sequences of unit names that can be used on the right-hand side of a unit definition. A macro is defined with an equals sign in the `Dependencies' file:
FOO = foobar foobaz foofum myprog: FOO blarp gargle %PROGRAM |
This is convenient if you have sets of units that are used together by many other units. Mosmake makes no distinction between the name of a macro and the name of a unit, but I suggest using upper case for macro names.
The use of a macro can come either before or after its definition; the entire `Dependencies' file is read by Mosmake before macros are processed. Macros can reference other macros, but recursion between macros is not allowed (nor meaningful):
FOO = foobar foobaz foofum myprog: FOOBLARP gargle %PROGRAM FOOBLARP = FOO blarp |
A macro may not contain any `%keyword' flags, and the `+'
that separates interface dependencies from implementation dependencies
(see plus sign) may not come from a macro, either. A macro
can, however, contain bracket-delimited compilation options
(see section 2.8 Extra mosmlc options).
If the same unit appears more than once in the dependency list after all macros have been expanded (often because several different macros that were used overlap), all but the first instance of each unit name is silently deleted.
FOO = foobar foobaz foofum BELCH = blarp foobar gargle myprog: FOOBAR BELCH %PROGRAM |
| [ < ] | [ > ] | [ << ] | [ Up ] | [ >> ] | [Top] | [Contents] | [Index] | [ ? ] |