Reputation: 9298
In a typical C program, I break down it into several components:
// main.c
#include 'part-a.h'
#include 'part-b.h'
main () {
// ...
}
// part-a.h
#include 'part-c.h'
// ...
I want to export the whole project as one file including every dependencies recursively (excluding standard libraries), how could I do that with gcc
?
Upvotes: 0
Views: 727
Reputation: 16888
gcc -E
plus all the other option you normally use to compile, without -c
. This will produce preprocessor output. It's the best you can get, AFAIK there's no way to only expand #include
directives. But you can use some preprocessor library (GCC and Boost have ones) to write your own tool.
http://www.boost.org/doc/libs/1_54_0/libs/wave/
Upvotes: 4