Reputation: 327
I try to then execute exact same compilation command for that skipped file and it is being correctly compiled. But when I put it in make file it is just skipped. Every other file is generated.
Upvotes: 1
Views: 1861
Reputation: 881653
Without actually seeing the makefile
(which you haven't provided), we can only guess (though I'd like to think it's an educated guess).
Since make
works by checking file timestamps to see if they need rebuilding, that's one thing to look at. If the timestamp of a target is later than that of all dependencies, the target won't be built.
The other is to ensure your top level rule actually has a dependency on what you're trying to build, somewhere in the hierarchy. By that I mean the ruleset:
all: xyzzy
xyzzy:
touch xyzzy
plugh:
touch plugh
with the command make all
will never touch plugh
because it's not in the dependency hierarchy off all
.
And make
generally provides command line options for debugging (like the -d
flag in GNU Make) which will tell you why it's making the decisions it's making. If you want to understand what's happening, you should probably use them,a s it makes it that much easier to debug your makefile
.
Upvotes: 1