Hi,

I am a user of imake (with X derived rules) and GNU make.

Apart from the portability aspect [1] of an imake based system, what I
find useful is that it avoids the redundant specification of rules.
That is, rules are defined only once by means of macro definitions and
imakefiles invoke them. 

One example is the SharedLibraryTarget rule in X.
I can say in an imakefile:

SharedLibraryTarget(<params-set-1>)
SharedLibraryTarget(<params-set-2>)

which expands to something like the following in the generated makefile
as:

lib-1: objs-1
       <list-of-shell-commands-using-params-set-1>

lib-2: objs-2
       <list-of-shell-commands-using-params-set-2>

I just say "what" needs to be done in an imakefile and the "how" part is
picked up from elsewhere and is shared.

I would like to know whether something similar is possible at the make
"level" itself to avoid the redundancy of specifying the
<list-of-shell-commands-using-params-set>.

Make's pattern rules solve only a subset of the problems.
But pattern rules can't solve problems like those above.
Any ideas as to how this may be tackled with make?

What about the possibility of having "rule-functions" which can be
defined once and invoked many times by the user?

----
[1] to the extent possible by the set of shipped arch specific config
files

Regards
Sankar

Reply via email to