Re: Generate m4 dependencies

Dima wrote:
Dan Espen wrote:
"Dima" <dimsol@xxxxxxxxx> writes:

Probably I was not clear enough.

I'm looking something similar to -M flag of gcc which returns all
header files which are included in compiled file.
This list can be used later in makefile as dependency.

m4 have also "include" directive which resembles C #include. Is
there're something similar to "gcc -M" for m4?
I don't think there are too many people that have used m4
to the extent that they need a tool for dependencies.

Have you looked at turning on the m4 trace and parsing that?
You could modify m4 or get a copy of makedepend and modify
it to handle m4.


There's an option to invoke m4 in debug mode. In the mode all included
files are printed. So it indeed possible to filter out from it all
included files.

I just thought that there's a better way and not to invent the wheel


What would happen if you ran the m4 code through the gcc compiler? You might
get that to work, especially if you could turn off further passes in the
compiler. Maybe running cpp alone would be enough, but I never tried
anything like this.

.~. Jean-David Beyer Registered Linux User 85642.
/V\ PGP-Key: 9A2FC99A Registered Machine 241939.
/( )\ Shrewsbury, New Jersey
^^-^^ 18:05:01 up 92 days, 20:39, 5 users, load average: 4.14, 4.20, 4.24

Relevant Pages

  • Re: Whats the story with the "end of XP"?
    ... Support gives them access to the larger body ... The same compiler suite may be "best" in both ... In the case of ByteCraft compilers, you are truly expert in your field, you work closely and rapidly with customers if there are any issues, and you have top class testing and quality control. ... understanding the inner workings of a relatively simple compiler like GCC ...
  • Re: 10.0-CUR r226986 && ports (general)
    ... configure:3232: checking for gcc ... Configured with: FreeBSD/amd64 system compiler ... configure:5483: checking how to associate runtime and link libraries ... configure: failed program was: ...
  • [RFC][PATCH-2.6] Clean up and merge compiler-*.h
    ... the kernel headers in include/linux to include/linux-abi. ... * Common definitions for all gcc versions go here. ... -/* Some compiler specific definitions are overwritten here ...
  • Re: LPC900/80C51 Compiler Toolchain
    ... >> supported by GCC, and so they invest. ... > if they already have their in-house compiler. ... one of the main companies in the Symbian consortium ... vendor to provide a good compiler for Atmel AVRs and eventually became ...
  • Re: [TESTING]: ClangBSD branch needs testing before the import to HEAD
    ... I hate gcc with the burning heat of a million suns. ... been a major liability towards FreeBSD releases in the past. ... While Clang is immature now, it will mature in the near future, ... Any bug analisys now shall start with exchange to verify which compiler ...