gcc - Makefile dependency chart -


i have file:

main.c a.h a.c b.h b.c x.h 

and in main.c include , in a.h include b , in b.h include x.h how write makefile this? please tell me dependency diagram of example

try this:

main: main.o a.o b.o     gcc -o main main.o a.o b.o  %.o: %.c     gcc -c $< 

while compiling .c files don't have worry dependencies yet, when linking executable.


Comments

Popular posts from this blog

How to mention the localhost in android -

php - Calling a template part from a post -

c# - String.format() DateTime With Arabic culture -