2012/1/10 Ian Lance Taylor <i...@google.com>: > Stamp files in make work like this: > > FILE: STAMP-FILE; @true > STAMP-FILE: DEPENDENCIES > commands to create FILE.tmp > move-if-change FILE.tmp FILE > touch $@ > > What this says is: if any of DEPENDENCIES change, then run the commands > to create FILE.tmp. The move-if-change shell script then compares > FILE.tmp and FILE; if they are different, it moves FILE.tmp to FILE, > updating the timestamp. If they are not different, FILE is left > unchanged, with the same timestamp. > > The effect is that anything which depends on FILE is only rebuilt if the > contents of FILE changes.
Hmm, will it work to just write as FILE: DEPENDENCIES commands to create FILE.tmp move-if-change FILE.tmp FILE > Note that everything I show above is required. A naive approach would > omit the "; @true" but it is necessary. > > Ian Then what the role here "; @true" play? I'm still confused by the usage. Thanks for explanation. Mingjie