automake
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Support for tcc in the Automake-provided depcomp script


From: Stefano Lattarini
Subject: Support for tcc in the Automake-provided depcomp script
Date: Thu, 18 Oct 2012 20:39:54 +0200

Hello tcc developers (and CC:ed automakers).

In my role of Automake co-maintainer, I'm working on a set of patches
to refactor and improve the 'depcomp' script, which strives to provide
automatic dependency tracking for C and C++ compilers other than GCC [1].

So far, tcc has shared its depcomp mode with the (obsolete) 7.x release
series of the Intel C compiler.  A quick peek in the tcc git history has
showed me that the tcc developers seems interested in being compatible
with 'depcomp':

  commit 0394caf784124f867d9294dab700e6005e99cea4
  Author:     Michael Matz <address@hidden>
  AuthorDate: Sun May 13 02:03:47 2012 +0200

    Emit spaces for -MD

    TCCs make dependency generator is incompatible with the GNU
    depcomp script which is widely used.  For TCC it has to go over
    the output of -MD, (it detects it as ICC compatible), but the
    sed commands it uses are confused by tabs in the output, so that
    some rewrites aren't done.

    Those tabs will then finally confuse make itself when the
    generated .d files are included.  It reads them as goal commands
    (leading tab), and is totally lost then.

    Short of changing depcomp (hard because distributed with all kinds
    of software), simply emit spaces for -MD.

Given such interest, I'd like to introduce a dedicated depcomp mode for
tcc.  So far, I've concluded (by trivial "reverse-engineering") that
the format of the dependency files generated by tcc has the following
format:

   tcc understand '-MD -MF file' since version 0.9.26.
   It will wrap lines (doesn't matter whether long or short) with a
   trailing '\', as in:

     foo.o : \
      foo.c \
      foo.h \

  It will put a trailing '\' even on the last line, and will use leading
  spaces rather than leading tabs.

So I have two questions:

  1. Is that description of the depfile format correct and complete?
  2. Can you state and ensure that such a format will remain stable
     in the future?

If the answer to both those questions is "yes", then I'll proceed to
write a dedicated depmode for tcc (and remove the now-obsolete 'icc'
depmode).  That will be pretty easy, once I can be sure the format is
settled.

Thanks,
  Stefano

[1] <http://www.gnu.org/software/automake/manual/automake.html#Dependencies>




reply via email to

[Prev in Thread] Current Thread [Next in Thread]