autoconf
[Top][All Lists]
Advanced

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

Re: Literate programming with noweb ...


From: Scott D. Brown
Subject: Re: Literate programming with noweb ...
Date: Wed, 12 Feb 2003 08:25:16 -0500
User-agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.2) Gecko/20021202

Paul Eggert wrote:
I have not seen how I could override the rules to produce .cpp files
from the output of the noweb tools.  I have to think that in a world
with automated code generators (yacc(1), etc.) that this sort of thing
has been tried before, but I have struck out on finding it.
You might try looking in the GNU "make" documentation, under "suffix
rules" (the old-fashioned way) or "pattern rules" (the newer way).  It
sounds like this will do what you want.
>
Our current Makefiles already take advantage of the gmake pattern rules.
What I am interested in is a way to introduce this into an automake and
autoconf pipeline.  To be more specific, if I was using normal source
files, I could simply specify the name of my library, the name of the
source files (foo.cpp, goo.cpp, etc.) and almost everything else is
automated.  What I was hoping to find was a way to do this with the noweb
files so that I specify the general rule *somewhere* that explains how
to compile an object (.o) file from the noweb (.nw) file (by extracting
the .cpp from the .nw and then doing a normal compile).  If I could do
that then I can list the .nw files as my "source" files and take advantage
of everything else that automake and autoconf have to offer.  If I have
to hand build every single file dependency in every Makefile.am then I
am really not saving myself much over our current solution.

So the two fundemental questions are:
1. Can I introduce a "rule" into my Makefile.am (just like a normal
   Makefile) that would define how to produce a .o file from the .nw
   file.
2. Assuming I can do that then I can also create the header files from
   the noweb files too.  How do I teach automake that when foo.cpp needs
   foo.h that it can be generated from foo.nw using the provided rule.
   It seems to me that this mechanism does not really exist since these
   tools are designed for "I have all my source files (.cpp and .h) and
   what I need is a system to help compile them on any machine"

I will start experimenting with this on my own but feedback would still
be apprechiated if this is a losing battle.

scott

--
Scott D. Brown // Research Scientist // address@hidden
Digital Imaging and Remote Sensing Lab // Rochester Institute of Technology
54 Lomb Memorial Dr. Rochester, NY 14623 // VX:585.475.7194 // FX:585.475.5988





reply via email to

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