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
programfails half-way, old (working) version ofprogramleft behind, or deleted?related point 1, how make sure if
programdeleted,program.revisiondeleted well? , similarly, if old build survives, oldprogram.revisionremains intact?how make sure
program.revisionin sync, if executemake programopposed plainmake?i realize problem made considerably simpler deleting old files prior building them, important minimize chance
programends 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