[OpenAFS-devel] Re: [RFC] splitting out CRULE_TARGET from
libafs/Makefile.common
Benjamin Kaduk
kaduk@MIT.EDU
Sat, 25 Jun 2011 19:17:31 -0400 (EDT)
On Sat, 25 Jun 2011, Andrew Deason wrote:
> On Sat, 25 Jun 2011 00:57:44 -0400 (EDT)
> Benjamin Kaduk <kaduk@MIT.EDU> wrote:
>
>> I am not particularly inclined to redefine CRULE_{NO,}OPT in
>> MakefileProto.FBSD.in after including Makefile.common, because if
>> these variables are changed in Makefile.common in the future, it is
>> likely that the FreeBSD-specific definition will be missed at that
>> time. Instead, I have introduced a new variable, CRULE_TARGET, which
>> is defined in the individual MakefileProtos, that Makefile.common uses
>> as the source file for its CC invocation in CRULE_{NO,}OPT. This
>> variable can then be tweaked as appropriate for each OS, allowing me
>> to use the extra features of FreeBSD's make.
>
> Shouldn't libafs makefiles just be converted to use AFS_CCRULE ?
Maybe? I'm still finding my way around our build system.
> Everywhere else in the source tree we just specify source files as
> additional arguments, and it hasn't seemed to bad to me.
>
> That is,
>
> foo.o: bar.c
> $(AFS_CCRULE) bar.c
>
> But that involves changing a ton of lines; if you're talking about doing
> something in the interim, sure, but afaik going towards AFS_*RULE is
> supposed to be the longer term solution.
If that's the way of the future, I don't mind changing a bunch of lines.
I will note, though, that we need to retain (gain?) a way for kernel
sources to be compiled with different flags than userland. The case that
I tripped over most recently is that the (FBSD) amd64 userland build is
compiling with PIC, but when I go to bsd.kmod.mk for libafs, it adds
mcmodel=kernel which is incompatible with PIC. (I currently workaround
this by emptying XCFLAGS for the libafs build, but would like other
options.)
-Ben