top button
Flag Notify
    Connect to us
      Site Registration

Site Registration

How we can create effective make file for C/C++ Code base? Can some please elaborate in details?

+2 votes
526 views
How we can create effective make file for C/C++ Code base? Can some please elaborate in details?
posted Jul 15, 2016 by Amit Kumar Pandey

Share this question
Facebook Share Button Twitter Share Button LinkedIn Share Button

1 Answer

+2 votes
 
Best answer

There is no standard way to have the makefile in a project, most of the companies have their own coding guidelines for having Makefile.

But most effective way to have multiple makefile for each code directory which includes the parameters from the parent makefile. So in short if you have code in five directories then you should have one makefile which calls the makefiles from each sub-directory and each sub-directory makefile will includes the parameters from the parent make file. If some sub-directory have a sub-directory again then makefile should also call sub-directory makefile.

So in short hierarchical makefile structure is best and easy to maintain.

Let me know if looking something different.

answer Jul 15, 2016 by Salil Agrawal
...