[OpenAFS-devel] support for enterprise kernel

Sam Hartman hartmans@mekinok.com
20 Aug 2001 12:30:47 -0400


warlord and I talked about this for a while and I understand my
position much better.  My concern was not so much raw complexity as
isolation of components.  This change is clearly Redhat specific and
is going into a makefile that is used by all Linux-based oses.


This is a problem because I don't believe that Makefile is well
designed at present and adding more cruft will only make it worse.  In
particular I am annoyed by the libafs target conditional (the series
of elifs) which has to be modified each time you add a new target.
Having code from multiple different oses (where Redhat is an OS)
concentrated in such a small chunk of code leads to unmaintainability.

I believe that especially if we want to depend on GNU Make there is a
better way of structuring the kernel build makefiles that allows for
OS-specific expansion.  In particular, you could include an
OS/packaging specific makefile fragment that is allowed to set a
LOCAL_TARGETS variable.  Then you have all depend on targets set by
configure as well as the local targets.  

Then you take advantage of the ability to scope variable assignments
to a rule.  You can do something like:

libafs.ep.o:  SMP_DEFS=blah blah blah

That means that SMP_DEFS  is set/overridden for libafs.ep.o and I
think for its dependencies (if I understand the docs correctly).  

However, restructuring the makefiles this way is a fair bit of work.
I think it is justified in the long term, especially if we ever get
other os-specific patches to the Linux build system.  I think it would
be too much work to ask people to do in order to support ep kernels
now.  So I tend to think that at the current time the tradeoffs favor
the existing solution.  I do ask that we keep an eye on the Linux
kernel makefiles and as people start trying to change it more, we ask
that they leave it cleaner than they left it.