[Top][All Lists]

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

Re: [patch] Guile conditional

From: Edward Welbourne
Subject: Re: [patch] Guile conditional
Date: Thu, 02 Jul 2015 12:33:25 +0000

>       ifeq ($(shell if [ -f /my/file ] ; then echo 0; else echo 1; fi), 0)

Why not:

ifneq ($(wildcard /my/file),)

which tests existence just as well.  Of course, it does also match if
/my/file is a directory or other non-file, but it's almost always
sufficient, unless there's some actual practical case where that name
might exist as something other than a file.

> to check whether file exists requires
> voodo like this(real code from some Debian package)

The fact that existing make-files do voodoo to achieve things does not
mean there is no clean elegant way to do those things in make.  It
usually means that the developer who wrote the make-file only knew a
tiny fraction of the things make can do and didn't go read the manual
when they had a perfectly good hammer with which to drive the
phillips-headed screw into the hole.  This is particularly true of the
widespread use of $(shell ...) to do all manner of things, many of which
can be done more efficiently and robustly using make's other built-in
functions - about which a great many developers know nothing.

That said, providing for make to support guile-plugins in some way does
sound like an interesting idea.  Some of the features presently build in
to make (particularly less-frequently used ones) might profitably be
moved out to such plugins.  Many of the sporadic feature requests that
folk come to this list to ask about could then be implemented as plugins
without Paul having to worry about long-term maintenance implications
for make itself - as long as someone else can be persuaded to own the
plugins ...


reply via email to

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