IAMTubby
May 20th, 2013, 10:15 AM
Hello,
I observed this kind of architecture in a project I'm working on.
Scenario
Assume sourcefile1.c calls a function defined in sourcefile2.c,
What I would do to build the project is:
gcc -o finalexe sourcefile1.c sourcefile2.c
What I observe in the project is:
Within sourcefile1.c, they do a #include "sourcefile2.c"
Problem
This makes it difficult for me to understand code flow(while working on a bigger project), because by looking at the makefile, I can't figure out how the files are linked. I would kinda have to go inside each file to see the #include's and understand how they are linked to each other.
No worries, I have got it using some grep'ping skills, but just want to know if this is bad architecture.
Please advise.
Thanks.
I observed this kind of architecture in a project I'm working on.
Scenario
Assume sourcefile1.c calls a function defined in sourcefile2.c,
What I would do to build the project is:
gcc -o finalexe sourcefile1.c sourcefile2.c
What I observe in the project is:
Within sourcefile1.c, they do a #include "sourcefile2.c"
Problem
This makes it difficult for me to understand code flow(while working on a bigger project), because by looking at the makefile, I can't figure out how the files are linked. I would kinda have to go inside each file to see the #include's and understand how they are linked to each other.
No worries, I have got it using some grep'ping skills, but just want to know if this is bad architecture.
Please advise.
Thanks.