[U-Boot] what means "extra-" versus "obj-" in Makefiles

Masahiro Yamada yamada.masahiro at socionext.com
Wed Aug 31 22:26:56 CEST 2016


2016-09-01 4:09 GMT+09:00 Robert P. J. Day <rpjday at crashcourse.ca>:
>
>   really a Kbuild question, i realize, but i'm looking at
> common/Makefile, and i'm having trouble understanding the flipping
> back and forth, as in:
>
>   obj-$(CONFIG_ENV_IS_IN_DATAFLASH) += env_dataflash.o
>   obj-$(CONFIG_ENV_IS_IN_EEPROM) += env_eeprom.o
>   extra-$(CONFIG_ENV_IS_EMBEDDED) += env_embedded.o
>   obj-$(CONFIG_ENV_IS_IN_EEPROM) += env_embedded.o
>   extra-$(CONFIG_ENV_IS_IN_FLASH) += env_embedded.o
>   obj-$(CONFIG_ENV_IS_IN_NVRAM) += env_embedded.o
>
> what is the rationale for the jumping between "obj-" and "extra-"?
> thanks.
>
> rday



linux/Documentation/kbuild/makefiles.txt says as follows:


--- 6.6 Building non-kbuild targets

    extra-y

        extra-y specifies additional targets created in the current
        directory, in addition to any targets specified by obj-*.

        Listing all targets in extra-y is required for two purposes:
        1) Enable kbuild to check changes in command lines
           - When $(call if_changed,xxx) is used
        2) kbuild knows what files to delete during "make clean"

        Example:
                #arch/x86/kernel/Makefile
                extra-y := head.o init_task.o

        In this example, extra-y is used to list object files that
        shall be built, but shall not be linked as part of built-in.o.


-- 
Best Regards
Masahiro Yamada


More information about the U-Boot mailing list