[Top][All Lists]

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

Extension proposal

From: Eray Ozkural (exa)
Subject: Extension proposal
Date: Fri, 10 Nov 2000 00:52:57 +0200


In the course of developing a skeletal build system using
GNU make, I was looking how I could incorporate automake-like
features into make. I've been using a hand-crafted makefile
over the last few years, so I just took it, refactored it into
a few files and extended it so that it had an automake like
user interface.

However, it seemed that I needed some features not available
in GNU make. I checked out make from anonymous cvs and saw
what I could do.

[in summary]
After my changes the following make code works for me:

$(interpret $(foreach prg,$(PROGRAMS),$(prg)_OBJFILES := $(patsubst %.cxx,%.o, 

This code fragment takes each program in a list PROGRAMS of programs
to compile, and then it derives a list of object files for each program
from the C++ source files defined for that program.

Here, there are two extensions in effect:

foreach: takes a third optional argument which is a user defined separator
instead of space. A special symbol "newline" denotes "\n" here. (A better
solution might be needed)

interpret: this is a new function that evaluates the expanded string input
from its single argument. the nice thing about interpret is that no temporary
file is used (i.e. in /tmp), please see the code.

I'm attaching a patch to cvs version. While it is obvious that these
extensions are far from perfect, I believe that they are of utility.
I've spent considerable effort in trying to keep these changes minimal.
I've even traced a bug in glibc in order to fix a problem with memory streams.
Thankfully, Ulrich has been prompt in his response and has fixed that
bug. Thus, this patch will work only under glibc version 2.1.97 or later.

Please consider this an alpha, there are some glitches to be worked out
but overall I'm hoping that you'll find this patch useful. [I'll be 
coming up with some more advanced features soon]


PS: This is a context diff, to apply it just
gzip -d -c make-patch.diff.gz | patch -c
in make toplevel dir.

Eray (exa) Ozkural
Comp. Sci. Dept., Bilkent University, Ankara
e-mail: address@hidden
www: http://www.cs.bilkent.edu.tr/~erayo

Attachment: make-patch.diff.gz
Description: GNU Zip compressed data

reply via email to

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