sorry for my bad english first of all...
Here's my problem: I have my application composed by main.c (main program), functions.c (code), functions.h (prototypes) and headers.h (typedefs, defines, etc).
In the main's code (and in functions.c, of course) I'm including functions.h, while in functions.h I'm including headers.h.
How should i compile headers.h in a makefile? I don't have headers.c: do I need to create headers.o anyway?
Here's my makefile's code:
application: main.o functions.o
gcc -o application main.o functions.o
main.o: main.c functions.o
gcc -c -Wall -pedantic main.c
functions.o: functions.c functions.h
gcc -c -Wall -pedantic functions.c
clean:
rm -f *.o
Everything works fine if i manually compile headers.h with
gcc -c -Wall -pedantic headers.h
EDIT: this is no longer true. I don't know why 5 minutes ago it works.
getting a .gch file. Where am I supposed to write that line in the makefile?
Thank you!