Mike:
Maybe you can help me with a couple of problems that are giving me fits.
Precompiled headers in the makefile… What am I doing wrong? All my
declarations are kept in one file, called "header.h". For the sake of
consistency, I opened a file and called it "header.c". In this latter
file, there is only one line. It reads: #include "header.h".
In my makefile, I have the line:
c.pre:
cc -bs -ho Headers.pre header.c
I make a change in headers.h, but make doesn't see it. What change must
I make? (Lord, what a pun!) I can't just do cc -bs -ho $@ $*.c because I
have then never set forth a valid rule.
Regards Tom
You haven't made any dependencies for the header file, which is why make
never sees it. Try something like:
c.pre: header.h
cc -bs -ho c.pre header.c
The key to getting makefiles working is to get the dependencies right –
unfortunately, figuring out how make figures out dependencies can be, ah,
challenging at times.
-Mike