help-make
[Top][All Lists]
Advanced

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

Re: non-recursive build question


From: David Boyce
Subject: Re: non-recursive build question
Date: Thu, 29 Apr 2004 19:00:03 -0400

It's always struck me that the best way to answer the out-of-date question generically is via a "plugin" design. Any implementation that's hardwired into make is bound to be wrong for someone's needs. Couldn't make do something like this: at startup, it uses the dlopen/dlsym() interface (there's something similar on Windows) to look for a function with a particular name and a documented signature including a boolean return value. If found, that's what it uses to make subsequent out-of-date decisions. If not (the normal case), it falls back to an internal function which simply implements the forward-timestamp-based logic that's always been standard.

This would allow for alternate implementations of statefulness, entirely configurable by the client site. Developers would only need create a shared library implementing the documented function. They could then build gmake so as to link it in explicitly, or LD_PRELOAD it on an as-needed basis. I could see a whole cottage industry of plugins developing.

One limitation is that GNU make has probably been ported to some old platforms which don't have dlopen/dlsym or similar. But IMHO it wouldn't be so bad to make this feature depend on a HAVE_DLFCN_H configure macro and thus be available only on modern platforms, which all support something similar AFAIK. Certainly SUS specifies dlopen.

Would this work or am I misunderstanding something about dlopen?

-dsb





reply via email to

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