[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Enhancement request for GNU "make": writing text to files
From: |
wouter . batelaan |
Subject: |
Enhancement request for GNU "make": writing text to files |
Date: |
Wed, 26 Sep 2001 16:24:20 +0100 |
Dear Sir/Madam,
I would like to request a simple enhancement to GNU make:
the ability to directly write to files from GNU without invoking a shell
command.
The reason for this request is the often occuring situation where we need to
create
a list of filenames in a file, based on out of date information. Make works out
if
a file is up to date, and if it is not we execute
%.x : %.y
@echo $< >>some.file
We then use some.file in further processing, e.g. passing to a compiler.
This mechanism is very slow: invoking a shell command just to write a bit of
text
to a file. For our project that is many 1000s of shell invocations,
to subsequently invoke a single compiler run which reads the list of out of
date files
from a command file.
A few new functions, e.g.
$(filewrite FILENAME, TEXT)
$(filewriteln FILENAME, TEXT)
$(fileappend FILENAME, TEXT)
$(fileappendln FILENAME, TEXT)
would do the job nicely.
%.x : %.y
@$(fileappendln some.file, $<)
The functions would return an empty string, but ideally of course
a build rule should fail if a write fails.
And in the above example, make should of course not invoke any sub process
for the essentially empty command line (I think this is already implemented).
Hope to improve make with this suggestion,
Yours sincerely,
PS I could of course instead suggest a new function $(perleval PERLCODE),
i.e. that perl is linked into make :-)
-- Wouter Batelaan mailto:address@hidden
System Laboratory / Philips Semiconductors
Second Avenue / Millbrook Ind. Estate/ Southampton SO15 0DJ / England
tel:+44-23-80 312615 fax:+44-23-80 316303
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- Enhancement request for GNU "make": writing text to files,
wouter . batelaan <=