Which files generated by Autotools should I keep in version control repository?

前端 未结 3 1231
迷失自我
迷失自我 2020-12-22 23:32

I am new to autotools and I am working on a C project. I want to add my project to a git repository. Which files generated by the autotools I need to track in my version con

3条回答
  •  慢半拍i
    慢半拍i (楼主)
    2020-12-23 00:12

    Note: I agree with ptomato'ss answer, and leave this answer as Community Wiki.
    It makes sense for source code distributions, but your project may not be one.
    For development purpose, ptomato's answer makes more sense.


    All the C projects generally comes with a configure file able to generate the actual Makefile used for the compilation.

    So when you consider the autotool chain, I would recommend versioning all files generated up to the configure file, as they are normally a one-time generation operation.

    http://upload.wikimedia.org/wikipedia/commons/thumb/8/86/Autoconf.svg/309px-Autoconf.svg.png

    That means anyone with a checked out copy of your version project can immediately start:

    ./configure
    make
    make install
    

    So, while it is generally true you shouldn't version any generated files, you could stored those ones especially if the other reader from that project can:

    • benefit from not re-generating those files (for an identical result)
    • start immediately to configure and compile.

提交回复
热议问题