[U-Boot] RFC: auto-generate ARM mach-types.h file from ARM machine database

Mike Frysinger vapier at gentoo.org
Fri May 6 07:09:59 CEST 2011


On Thu, May 5, 2011 at 17:48, Michael Schwingen wrote:
> --- a/Makefile
> +++ b/Makefile
> @@ -469,7 +469,7 @@ $(obj)System.map:   $(obj)u-boot
>  # This target actually generates 2 files; autoconf.mk and autoconf.mk.dep.
>  # the dep file is only include in this top level makefile to determine when
>  # to regenerate the autoconf.mk file.
> -$(obj)include/autoconf.mk.dep: $(obj)include/config.h include/common.h
> +$(obj)include/autoconf.mk.dep: $(obj)include/config.h include/common.h $(obj)include/asm/mach-types.h
>        @$(XECHO) Generating $@ ; \
>        set -e ; \
>        : Generate the dependancies ; \
> @@ -530,13 +530,18 @@ unconfig:
>                $(obj)board/*/config.tmp $(obj)board/*/*/config.tmp \
>                $(obj)include/autoconf.mk $(obj)include/autoconf.mk.dep
>
> -%_config::     unconfig
> +%_config::     unconfig $(obj)include/asm/mach-types.h
>        @$(MKCONFIG) -A $(@:_config=)
>
>  sinclude $(obj).boards.depend
>  $(obj).boards.depend:  boards.cfg
>        awk '(NF && $$1 !~ /^#/) { print $$1 ": " $$1 "_config; $$(MAKE)" }' $< > $@
>
> +
> +$(obj)include/asm/mach-types.h: arch/arm/tools/gen-mach-types arch/arm/tools/mach-types
> +       @mkdir -p $(obj)include/asm
> +       awk -f $^ > $@ || { rm -f $@; /bin/false; }
> +
>  #
>  # Functions to generate common board directory names
>  #

this all belongs in arch/arm/config.mk and not the toplevel makefile

also, dont hardcode full paths to things.  there's no reason for it.

might want to add an "update-mach-types" target so people can type
`make update-mach-types` and it'll automatically wget the right file
to the right place ...
-mike


More information about the U-Boot mailing list