c - How to keep two related files in sync? -
suppose have makefile containing similar this:
program.revision: smaug git rev-parse head > program.revision program: $(obj) $(cc) -o $@ $^ $(ldflags)
the aim clear: want program.revision
always mirror revision of source created program
.
but wrote , realized not adequately cover needs nor concerns:
if compile of
program
fails half-way, old (working) version ofprogram
left behind, or deleted?related point 1, how make sure if
program
deleted,program.revision
deleted well? , similarly, if old build survives, oldprogram.revision
remains intact?how make sure
program.revision
in sync, if executemake program
opposed plainmake
?i realize problem made considerably simpler deleting old files prior building them, important minimize chance
program
ends missing due failed build.
how handle situation?
edit:
after writing this, realized problem might not think is. aim have build of program
know revision created with, maybe answer isn't in makefile
, program.revision
file, instead in finding way compile information executable. hmm..
Comments
Post a Comment