I have this C++ file (let's call it main.cpp
):
#include <string>
#include "main.y.c"
void f(const std::string& s) {
yy_switch_to_buffer(yy_scan_string(s.c_str()));
yyparse();
}
The file depends on main.y.c
, which has to be generated beforehand by means of bison
util. In other words, I can't compile main.c
file if I forget to run bison main.y
before it. And it's perfectly OK, this is how I want it. Now I'm trying to build .d
file from Makefile
, using this command:
$ c++ -MM main.c > main.d
main.cpp:2:10: error: main.y.c: No such file or directory
I fail here, since main.y.c
is not ready yet. I think that I should somehow quote my #include
directive in the main.c
file to make it invisible for c++ -MM
process.