will include the contents of the file
macros.mac into the
source file containing the
Include files are first
searched for relative to the directory containing the source file that is performing the
inclusion, and then relative to any directories specified on the Yasm command line using
-I option (see Section 126.96.36.199), in the order given on
the command line (any relative paths on the Yasm command line are relative to the current
working directory, e.g. where Yasm is being run from). While this search strategy does
not match traditional NASM behavior, it does match the behavior of most C compilers and
better handles relative pathnames.
The standard C idiom for preventing a file being included more than once is just as
applicable in the NASM preprocessor: if the file
has the form
%ifndef MACROS_MAC %define MACROS_MAC ; now define some macros %endif
then including the file more than once will not cause errors, because the second time
the file is included nothing will happen because the macro
MACROS_MAC will already be defined.
You can force a file to be included even if there is no
%include directive that explicitly includes it, by using the
option on the Yasm command line (see Section 188.8.131.52).