- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hi,
We have a git project created on modust toolbox.we have a header file named common.h in source folder and also one more header file with name common.h is available in git submodule. I am not ableto exclude this .h file from building. i am using CY_IGNORE in makefile and it doesn't seems to be working.
CY_IGNORE+=$(wildcard ./<folder path>/common.h)
Please suggest how i can exclude this from referencing in build.
Thanks
Aashik MS
PS: CY_IGNORE working well to ignore folder and .c file.
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
There are a number of command-line options you can use to add additional directories to the search path. The most commonly-used option is -Idir, which causes dir to be searched after the current directory (for the quote form of the directive) and ahead of the standard system directories. You can specify multiple -I options on the command line, in which case the directories are searched in left-to-right order.
If you specify other options on the command line, such as -I, that affect where the preprocessor searches for header files, the directory list printed by the -v option reflects the actual search path used by the preprocessor.
Also, you could append the relevant mid-path before common.h to restrict the search pattern, i.e., #include "some_path_pattern_that_distinguishes/common.h".
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hi,
The solutions vary a bit based on your files' structure. You could start by trying #include "common.h" or #include <common.h> with luck.
See: Search Path (The C Preprocessor) (gnu.org)
Best regards
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Thanks for reply, but i cannot modify the submodue source file. I need a way to exclude this common.h file from outside like in makefile or CLI command.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
There are a number of command-line options you can use to add additional directories to the search path. The most commonly-used option is -Idir, which causes dir to be searched after the current directory (for the quote form of the directive) and ahead of the standard system directories. You can specify multiple -I options on the command line, in which case the directories are searched in left-to-right order.
If you specify other options on the command line, such as -I, that affect where the preprocessor searches for header files, the directory list printed by the -v option reflects the actual search path used by the preprocessor.
Also, you could append the relevant mid-path before common.h to restrict the search pattern, i.e., #include "some_path_pattern_that_distinguishes/common.h".