[U-Boot] Removal of generated asm-offsets.s/h

Matthias Weisser weisserm at arcor.de
Wed Jun 29 20:37:41 CEST 2011


Hi Stefano

Am 29.06.2011 17:48, schrieb Stefano Babic:
> Hi Matthias,
> 
>>> In message<4E0B3331.9030605 at arcor.de>  you wrote:
>>>>
>>>> If a soc automatically generates asm-offsets.s/h in its makefile it
>>>> isn't removed by a make clean or make distclean. See mx35 as an example.
>>>> Even adding a clean: target to the SoCs makefile doesn't help. What
>>>> would be the right way to remove these files with make clean?
>>>
>>> Add it to the list of files to remove in the top level Makefile?
>>
>> Well, thats is not that easy. The generated asm-offsets.h file ends up 
>> in arch/arm/include/asm/arch-mx35/ after a "make mx35pdk_config" "make" 
>> "make distclean" run. It is generated to include/asm/arch/ in the SoCs 
>> makefile so I don't understand why it ends up in 
>> arch/arm/include/asm/arch-mx35/
> 
> There is an explicit rule in arch/arm/cpu/arm1136/mx35/Makefile. It
> seems to me the right place to put the generated file. It is an include
> header, and it should be the include directory for the desired soc, in
> this case arch/arm/include/asm/arch-mx35/

If I look into that Makefile I observe the following rule

$(TOPDIR)/include/asm/arch/asm-offsets.h:

And this rule should put the generated header file into
include/asm/arch/ which is completly removed by a "make clean". But it
ends up in arch/arm/include/asm/arch-mx35/ also. That puzzled me a bit
but I must admit that I am not an expert in the u-boot makefile structure.

>> I don't think it makes sense to add a entry for each SoC using auto 
>> generated asm-offset files to the top level makefile. Same goes for the 
>> .s file as we shouldn't remove all .s files in the tree.
> 
> Is it not enough to add the following lines to the central Makefile, as
> suggested by Wolfgang:
> 
>        @rm -f arch/$(ARCH)/include/asm/arch-$(SOC)/asm-offsets.h

This will remove the handwritten asm-offsets.h files which are used in
arm/mb86r0x, arm/mx27, arm-mx5 and powerpc/mpc512x. I can change mb86r0x
to auto generate the file as I am the maintainer of this SoC. I can also
change the other ARM based SoCs but the PowerPC stuff is out of my focus.

>        @rm -f $(CPUDIR)/$(SOC)/asm-offsets.s

Thats perfect for the generated .s file. I will use this if we find a
solution for the .h file in a patch.

> The files are removed, as I now tested.
> And we do not need to add an entry for each CPU/SOC...

See my comments above.

Matthias Weißer


More information about the U-Boot mailing list