How much do header dependencies matter in a Makefile?

0 Dol Lod · March 28, 2015
I am writing a program that should automatically output a makefile. So far I've checked to make sure I am retrieving the data correctly. I've collected the information in an xml like format including headers. However, what I didn't realize was how to associate the headers only with the Makefiles that need them or if this matters at all. 

Possible Ideas I have to deal with this problem

1) Make every source file depend on every header file.

2) Create a new tag for dependencies and handle it that way by making each dependency contain each source file and headers it depends on. <Dependency>main.c Globals.c:Globals.h</Dependency>

3) Redo the source Tags to have the header dependencies follow the way it is written. <Source>main:cpp: Globals.h</Source>

Any other suggestions or which one of these approaches makes the most sense?

Post a Reply


Oldest  Newest  Rating
0 Bhaskar Thakur · March 29, 2015
Make header files independent of the C - classes . Make a new source file for every header, In this way you're gonna get a whole lot of mess cleared in your cms.
  • 1



One of the most popular languages of all time.

Bucky Roberts Administrator