Detect if VFS module is being compiled inside or outside source tree

Richard Sharpe realrichardsharpe at gmail.com
Fri Mar 23 20:43:14 MDT 2012


On Thu, Mar 22, 2012 at 9:12 PM, Richard Sharpe
<realrichardsharpe at gmail.com> wrote:
> On Thu, Mar 22, 2012 at 8:45 PM, Richard Sharpe
> <realrichardsharpe at gmail.com> wrote:
>> On Wed, Mar 21, 2012 at 10:38 AM, Andrew Klaassen <clawsoon at yahoo.com> wrote:
>>> --- On Wed, 3/21/12, Richard Sharpe <realrichardsharpe at gmail.com> wrote:
>>>
>>>> Perhaps the best thing to do is for you to create a new bug on
>>>> bugzilla.samba.org about this and then I can resurrect my emails and
>>>> add them to the bug.
>>>
>>> Done.
>>>
>>> https://bugzilla.samba.org/show_bug.cgi?id=8822
>>
>> It strikes me that we might be able to do something in Makefile.in.
>>
>> It currently has this code:
>>
>> # Auto target
>> default: $(patsubst %.c,%.$(SHLIBEXT),$(wildcard *.c))
>>
>> # Pattern rules
>>
>> %.$(SHLIBEXT): %.$(OBJEXT)
>>        @echo "Linking $@"
>>        @$(CC) $(LDSHFLAGS) $(LDFLAGS) -o $@ $<
>>
>> %.$(OBJEXT): %.c %.h
>>        @echo "Compiling $<"
>>        @$(CC) $(FLAGS) -c $<
>>
>> We might be able to pass -D%_init=samba_init_module on the compile
>> line. That might do the trick and unify them.
>>
>> I will try to have a look soon.
>
> OK, that won't work but this will:
>
>        @echo "Compiling $<"
> -       @$(CC) $(FLAGS) -c $<
> +       @$(CC) $(FLAGS) -c $< -D$(basename $@)_init=samba_init_module

That change was pushed to master as a15aefea27fffcbf622f7032e5d50628189a49bd

However, it might be that I can get rid of that $(basename $@) ...

-- 
Regards,
Richard Sharpe
(何以解憂?唯有杜康。--曹操)


More information about the samba-technical mailing list