[U-Boot] [RFC PATCH v2 13/20] sandbox: Add OS dependent layer

Simon Glass sjg at chromium.org
Tue Sep 27 01:53:41 CEST 2011


On Mon, Sep 26, 2011 at 3:03 PM, Simon Glass <sjg at chromium.org> wrote:
> Hi Mike,
>
> On Mon, Sep 26, 2011 at 2:19 PM, Mike Frysinger <vapier at gentoo.org> wrote:
>> On Monday, September 26, 2011 17:04:49 Simon Glass wrote:
>>> On Sun, Sep 25, 2011 at 10:16 PM, Mike Frysinger wrote:
>>> > On Friday, September 23, 2011 12:22:15 Simon Glass wrote:
>>> >> --- a/arch/sandbox/cpu/sandbox/Makefile
>>> >> +++ b/arch/sandbox/cpu/sandbox/Makefile
>>> >>
>>> >> +# I want to do this, but it doesn't seem to work
>>> >> +CFLAGS_arch/sandbox/cpu/sandbox/os.o += -I/usr/include
>>> >
>>> > seems to work for me ...
>>> > CFLAGS_arch/blackfin/lib/board.o = -ffoo
>>>
>>> That is not a -I flag, though. If you try -I I think you will get a
>>> failure. Looking a bit closer it is because the dependency stuff uses
>>> CPPFLAGS which doesn't support per file/dir flags.
>>
>> OK, if it's the dependency step, that's a different story.  untested patch:
>>
>> --- a/config.mk
>> +++ b/config.mk
>> @@ -277,6 +277,8 @@
>>  BCURDIR = $(subst $(SRCTREE)/,,$(CURDIR:$(obj)%=%))
>>  ALL_AFLAGS = $(AFLAGS) $(AFLAGS_$(BCURDIR)/$(@F)) $(AFLAGS_$(BCURDIR))
>>  ALL_CFLAGS = $(CFLAGS) $(CFLAGS_$(BCURDIR)/$(@F)) $(CFLAGS_$(BCURDIR))
>> +EXTRA_CPPFLAGS = $(CPPFLAGS_$(BCURDIR)/$(@F)) $(CPPFLAGS_$(BCURDIR))
>> +ALL_CFLAGS += $(EXTRA_CPPFLAGS)
>>  $(obj)%.s:     %.S
>>        $(CPP) $(ALL_AFLAGS) -o $@ $<
>>  $(obj)%.o:     %.S
>> --- a/rules.mk
>> +++ b/rules.mk
>> @@ -30,7 +30,7 @@
>>                @touch $@
>>                @for f in $(SRCS); do \
>>                        g=`basename $$f | sed -e 's/\(.*\)\.[[:alnum:]_]/\1.o/'`; \
>> -                       $(CC) -M $(CPPFLAGS) -MQ $(obj)$$g $$f >> $@ ; \
>> +                       $(CC) -M $(CPPFLAGS) $(EXTRA_CPPFLAGS) -MQ $(obj)$$g $$f >> $@ ; \
>>                done
>>                @for f in $(HOSTSRCS); do \
>>                        g=`basename $$f | sed -e 's/\(.*\)\.[[:alnum:]_]/\1.o/'`; \
>>
>> -mike
>>
>
> Thanks - have been playing with this a bit. The problem is that
> rules.mk goes through the files in the directory one by one in a shell
> 'for' loop, so $(@F) isn't relevant. I am wondering in fact where I
> need to replace the dependency file generation with something which
> creates separate .deps for each file, and then concats them in a
> separate rule.

Just to follow up on this - I was not able to get this to work within
the existing .depend generation, because it happens within a shell
script with no access to make variables. I have added a patch to
change this and will wait for the screams :-)

Regards,
Simon


More information about the U-Boot mailing list