You better use make. Thus, if your source has not changed, the compilation will be skipped, so the object files will not be changed.
: , make , . .
makefile:
all: source
source: source.i.cpp
@cmp -s source.i.cpp source.i.prev || g++ source.i.cpp -o source
@touch source
@cp source.i.cpp source.i.prev
source.i.cpp: source.cpp
@g++ -E source.cpp >source.i.cpp
, , ( , ).