Err... it shouldn't be doing that. It would need to recompile if the object file is older than the source file... not vice versa.
Are you sure that's really what's happening?
EDIT:
Also does GCC even do this? I thought it just compiled whatever files you tell it to and it doesn't care about timestamps. I thought the build manager (ie: make, or whatever IDE you're using) keeps track of all this stuff.
I have no IDE, make, etc. I'm using batch files. I'm calling GCC manually, like so:
gcc -g -c main.c -o./obj/main.o -std=c99
I'd like GCC to not compile if it sees that the source file is older than the object file, because if that's the case, then the code hasn't changed since the last time it compiled the code. Sorry, i switched the two around in my question.