help-gnu-utils
[Top][All Lists]
Advanced

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

Re: Preprocessing files with make


From: Paul D. Smith
Subject: Re: Preprocessing files with make
Date: 29 Aug 2004 20:08:12 -0400
User-agent: Gnus/5.09 (Gnus v5.9.0) Emacs/21.3

%% Michael Chastain <mec.gnu@mindspring.com> writes:

  mc> alpha.o: %.o
  mc> cc -c $< -o $@ -DFOO

  mc> I didn't write this.  Check my mail again.

???

I quoted you exactly... I'm not in the habit of reworking peoples' email
and then quoting it.

  mc> Yes, I don't remember whether that two-phase process is explicitly
  mc> spelled out in the documentation.  If not, it should be.  I
  mc> figured it after I used gnu make for a while.

It is.  Check the section "How 'make' Reads a Makefile" in the GNU make
manual.

  mc> The first phase lacks a "for" construct that can generate rules.
  mc> That would be a really good feature enhancement for gnu make.

You can do this kind of thing in GNU make 3.80, with the $(eval ...)
function.


However, as I mentioned in a previous post the requirement the OP had is
much more straightforwardly solved using simple pattern rules, and you
don't need any of these more advanced features.

-- 
-------------------------------------------------------------------------------
 Paul D. Smith <psmith@gnu.org>          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]