41

Sometimes in the sources of projects I see "*.in" files. For example, a bunch of "Makefile.in"s. What are they for and/or what does the ".in" part mean? I assume that this has something to do with autoconf or make or something like those, but I'm not sure.

I've tried searching for ".in file extension", "autoconf .in file extension", "autoconf .in", "autoconf dot in", and other variants, with no luck.

Gilles 'SO- stop being evil'
  • 807,993
  • 194
  • 1,674
  • 2,175
strugee
  • 14,723
  • 17
  • 73
  • 119
  • If you want to know how autotools work, I suggest this series of articles: http://www.freesoftwaremagazine.com/articles/gnu_coding_standards_applied_to_autotools. – Boris Burkov Jul 25 '13 at 10:04
  • I found this in my google search. Kinda scary. https://fileinfo.com/extension/in – Bozeyman9000 Oct 23 '18 at 20:28

3 Answers3

37

I believe the automake process involving a Makefile.in is something like this:

  Makefile.am
       |
      \'/
+--------------+
|   automake   |
+--------------+
       |
      \'/
   Makefile.in
       |
      \'/
+--------------+    +--------------+
| ./configure  |<-- |   autoconf   |<-- configure.in
+--------------+    +--------------+
       |
      \'/
    Makefile

Nobody actually writes a Makefile.in. The only programmer-defined file here is the Makefile.am.

Trevor Hickey
  • 947
  • 3
  • 9
  • 17
29

it's just a convention that signifies the given file is for input; in my experience, these files tend to be a sort of generic template from which a specific output file or script results.

Josh McGee
  • 726
  • 5
  • 6
  • 4
    Out of interest, could you cite some examples where ".in" is used in this way outside of the `autoconf` realm? – spinkus Jul 05 '14 at 12:08
  • @spinkus Python packaging/dev tools use it now, e.g. `MANIFEST.in` and `requirements.in`. The former name would have been in use back in 2014 when you first asked! – shadowtalker Sep 30 '22 at 20:28
9

They are input files for the m4 macro preprocessor. Among other things, these files contain macros marked by @, that get expanded by m4.

ninjalj
  • 1,427
  • 12
  • 10