Trying to compile Python fails because of files' timestamps
<p>I want to compile Python; I cloned the repository from Github:</p>

<pre><code>git clone --depth=1 --branch=2.7 https://github.com/python/cpython.git
</code></pre>

<p>Configure works but building fails because Python is not found:</p>

<pre><code>$ cd cpython
$ ./configure
...
$ make
/bin/mkdir -p Include
./Parser/asdl_c.py -h Include ./Parser/Python.asdl
/usr/bin/env: python: No such file or directory
Makefile:718: recipe for target 'Include/Python-ast.h' failed
make: *** [Include/Python-ast.h] Error 127
</code></pre>

<p>This is because <code>Include/Python-ast.h</code> is newer than <code>Parser/asdl_c.py</code>, as told by <code>make --debug</code>:</p>

<pre><code>...
Prerequisite 'Parser/Python.asdl' is newer than target 'Include/Python-ast.h'.
Prerequisite 'Parser/asdl.py' is newer than target 'Include/Python-ast.h'.
Prerequisite 'Parser/asdl_c.py' is newer than target 'Include/Python-ast.h'.
Must remake target 'Include/Python-ast.h'.
</code></pre>

<p>Indeed, the header was cloned a little bit after the Python script:</p>

<pre><code>$ ls --full-time Include/Python-ast.h Parser/asdl_c.py
-rw-r--r-- 1 piwi piwi 21113 2016-09-08 15:22:32.984000000 +0200 Include/Python-ast.h
-rwxr-xr-x 1 piwi piwi 41414 2016-09-08 15:22:33.248000000 +0200 Parser/asdl_c.py
</code></pre>

<p>Touching the header works around the problem in this specific case:</p>

<pre><code>$ touch Include/Python-ast.h
$ make
... compiles ...
</code></pre>

<p>Is there an appropriate way to prevent this behavior?</p>

<p>Thanks,</p>

<p>Apparently it's known issue. Use <code>make touch</code> after checkout, then <code>make</code> should work.</p>

<p>See <a href="https://github.com/python/cpython/blob/b72e279bfa0eece094f652b9fc329200d5964ffa/Makefile.pre.in#L1504" rel="nofollow">https://github.com/python/cpython/blob/b72e279bfa0eece094f652b9fc329200d5964ffa/Makefile.pre.in#L1504</a></p>

python git makefile compilation