Take the 2-minute tour ×
Unix & Linux Stack Exchange is a question and answer site for users of Linux, FreeBSD and other Un*x-like operating systems.. It's 100% free, no registration required.

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.

share|improve this question
    
If you want to know how autotools work, I suggest this series of articles: freesoftwaremagazine.com/articles/…. –  Bob Jul 25 '13 at 10:04

3 Answers 3

up vote 4 down vote accepted

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.

share|improve this answer
    
Out of interest, could you cite some examples where ".in" is used in this way outside of the autoconf realm? –  Sam Pinkus Jul 5 at 12:08

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.

share|improve this answer
1  
Well, on occasion I've written a Makefile.in, because automake wouldn't do what I want. –  Simon Richter Jul 25 '13 at 14:03

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

share|improve this answer
    
This is the correct answer. –  Gaius Jul 25 '13 at 11:26
1  
Nope. Makefile.in is never touched by anything m4 related. –  Simon Richter Jul 25 '13 at 14:02
    
@Gaius my answer is indeed the correct, general-purpose answer. m4 isn't the only tool that uses this convention. certainly not the first, almost definitely won't be the last. –  Josh McGee Jul 27 '13 at 13:25

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.