help-make
[Top][All Lists]
Advanced

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

Re: any tool(or gmake option) to rewrite GNUMakefiles into plain-make Ma


From: Paul D. Smith
Subject: Re: any tool(or gmake option) to rewrite GNUMakefiles into plain-make Makefile ?
Date: Thu, 21 Aug 2003 21:54:26 -0400

%% Yakov Lerner <address@hidden> writes:

  >> How often do you think such a tool is needed?

  yl> If you know of GNU-compatible distributed make, then I wouldn't
  yl> need the rewrite option.

Uh... well... GNU make itself is distributed, or at least can be made to
be so with add-on libraries.  Is that good enough?

  >> Who could spend the resources to do it? What's your conclusion?

  yl> The easy way to do it is to hack the gmake sources, adding the
  yl> option for this. I could do it, given encouragement of one of
  yl> gmake maintainers.

On the todo list for a while is a debugging mode which generates a
"postprocessed" form of the makefile so people can look at it to see
what's going on.  With the advent of $(eval ...) and $(call ...) the
need for this is even more critical.  Exactly what the form of this
output would take is not really clear, although I would like it to be a
valid GNU makefile itself.  Note that I don't require that it be a
POSIX-compliant makefile: basically because it can't be.  The main idea
is to make it easier for people to debug their makefiles.  But if you
were careful how you used GNU make constructs I can imagine that the
output would be fairly generic make syntax.

I envisioned this working inside the parser, actually, generating the
output as it read in the input.  To me that seems the only way to get
accurate output that's not too digested, rather than printing things out
from the internal data structures.

The idea would be to expand what could be expanded (eval's, call's, and
other functions and variables in immediate contexts, etc.), handle
things like target-specific pattern rules by expanding them into
explicit rules, etc.  And comments would be added that showed the
filename and line number where the original lived, and maybe even the
original line (commented out of course).

I guess I kind of envisioned something like the GNU C preprocessor
output with "-E -dD -C" flags, if you're familiar with that :).


If you'd like to start working on this I'd be willing to look at what
you come up with.  Remember any non-trivial work you do on GNU make must
have paperwork done: you and your company, if you've signed any
agreement with them or do this work on their time, must assign the
copyright for all your changes to the FSF.  The FSF will give you back
an unlimited license to do whatever you want with your changes (only, of
course), so for all practical purposes you can still do anything you
want to with them, but the FSF holds the copyright.

-- 
-------------------------------------------------------------------------------
 Paul D. Smith <address@hidden>          Find some GNU make tips at:
 http://www.gnu.org                      http://make.paulandlesley.org
 "Please remain calm...I may be mad, but I am a professional." --Mad Scientist




reply via email to

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