Compiling C code with CPPFLAGS with multiple directories
To define multiple includes in your CPPFLAGS, just do,
Clearly, put the path inside the "double quoted" flag value.
This can be included like when you compile a package, let say for example, compiling with "configure", you can,
$> ./configure --prefix=/usr/local
$> make CPPFLAGS="-I/usr/include -I/opt/local/include -I/usr/local/include -I/usr/include/malloc"
$> make install
where it includes and specify a malloc header looks for /usr/include/malloc/malloc.h for example, so you'll just use the base directory, which is /usr/include/malloc.
CPPFLAGS="-I/usr/include -I/opt/local/include -I/usr/local/include"
Clearly, put the path inside the "double quoted" flag value.
This can be included like when you compile a package, let say for example, compiling with "configure", you can,
$> ./configure --prefix=/usr/local
$> make CPPFLAGS="-I/usr/include -I/opt/local/include -I/usr/local/include -I/usr/include/malloc"
$> make install
where it includes and specify a malloc header looks for /usr/include/malloc/malloc.h for example, so you'll just use the base directory, which is /usr/include/malloc.
Comments
Post a Comment