2.1.10. The `-i' Option: Include File Search Directories
--------------------------------------------------------
When NASM sees the `%include' or `incbin' directive in a source file
(see *Note Section 4.6:: or *Note Section 3.2.3::), it will search for
the given file not only in the current directory, but also in any
directories specified on the command line by the use of the `-i'
option. Therefore you can include files from a macro library, for
example, by typing
nasm -ic:\macrolib\ -f obj myfile.asm
(As usual, a space between `-i' and the path name is allowed, and
optional).
NASM, in the interests of complete source-code portability, does not
understand the file naming conventions of the OS it is running on; the
string you provide as an argument to the `-i' option will be prepended
exactly as written to the name of the include file. Therefore the
trailing backslash in the above example is necessary. Under Unix, a
trailing forward slash is similarly necessary.
(You can use this to your advantage, if you're really perverse, by
noting that the option `-ifoo' will cause `%include "bar.i"' to search
for the file `foobar.i'...)
If you want to define a _standard_ include search path, similar to
`/usr/include' on Unix systems, you should place one or more `-i'
directives in the `NASMENV' environment variable (see *Note Section
2.1.22::).
For Makefile compatibility with many C compilers, this option can
also be specified as `-I'.