13

We have the ctemplate library included in our git-managed project which is based on GNU Autoconf.

I would like to put everything which is generated by Autoconf into the .gitignore file to avoid conflicts if someone accidentally commits his platform-specific generated files.

Can someone tell me how to figure out the complete list of files autoconf generates/modifies for all platforms (Mac, Ubuntu, CentOS, etc.)?

oradwell
  • 392
  • 1
  • 12
Korbi
  • 1,438
  • 4
  • 15
  • 22
  • Not an answer to the downvote question - wasn't me... but, it seems pretty trivial to 1) start with the files you wrote and commit them, 2) run `autoconf` and look at what files exist now - anything new was generated by autoconf - add those to `.gitignore`... – twalberg May 06 '13 at 18:00
  • 1
    This might work for your local machine but autoconf can also generate stuff only on specific platforms. – Korbi May 09 '13 at 20:49
  • 1
    Don't give commit privileges to anyone who would commit autotools-generated files :-P – ptomato May 10 '13 at 20:59
  • 1
    adding ref to list : https://github.com/github/gitignore/blob/master/Autotools.gitignore – parasrish Aug 17 '20 at 04:55

1 Answers1

15

Here is what I have in my various .gitignore (on Debian testing):

Shared library: (libtool)

/Makefile
/Makefile.in
/aclocal.m4
/autom4te.cache/
/config.*
/configure
/depcomp
/install-sh
/libtool
/ltmain.sh
/m4/
/missing
/stamp-h?
.deps/
.dirstamp
.libs/
*.l[ao]
*~

Executable:

/Makefile
/Makefile.in
/aclocal.m4
/autom4te.cache/
/config.*
/configure
/m4/
/stamp-h?
.deps/
.dirstamp
*.o
*~

You may want to adapt this a bit, but this is the bulk of it. make dist-clean followed by commit, rebuild, and finally git status may show you new files though, depending on what exactly your build generates.

syam
  • 14,701
  • 3
  • 41
  • 65