[U-Boot] [PATCH v2 03/15] kbuild: move asm-offsets.h rules to ./Kbuild

Wolfgang Denk wd at denx.de
Mon Feb 24 06:36:07 CET 2014


Dear Masahiro,

In message <1393207943-3725-4-git-send-email-yamada.m at jp.panasonic.com> you wrote:
>
> +define cmd_generic-offsets
> +	(set -e; \
> +	 echo "#ifndef __GENERIC_ASM_OFFSETS_H__"; \
> +	 echo "#define __GENERIC_ASM_OFFSETS_H__"; \
> +	 echo "/*"; \
> +	 echo " * DO NOT MODIFY."; \
> +	 echo " *"; \
> +	 echo " * This file was generated by Kbuild"; \
> +	 echo " *"; \
> +	 echo " */"; \
> +	 echo ""; \
> +	 sed -ne $(sed-y) $<; \
> +	 echo ""; \
> +	 echo "#endif" ) > $@
> +endef

Can we use here documents in cases like this, so the number of
shell command executions could be greatly reduced?

Does something like this work?

define cmd_generic-offsets		\
	cat <<_END_ > $@		\
#ifndef __GENERIC_ASM_OFFSETS_H__	\
#define __GENERIC_ASM_OFFSETS_H__	\
/*					\
 * DO NOT MODIFY			\
 *					\
 * This file was generated by Kbuild	\
 */					\
$$(sed -ne $(sed-y) $<)			\
#endif					\
_END_

?

[I'm not sure how to mark the continuation lines here...]

Best regards,

Wolfgang Denk

-- 
DENX Software Engineering GmbH,     MD: Wolfgang Denk & Detlev Zundel
HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany
Phone: (+49)-8142-66989-10 Fax: (+49)-8142-66989-80 Email: wd at denx.de
If all the Chinese simultaneously jumped into the Pacific  off  a  10
foot platform erected 10 feet off their coast, it would cause a tidal
wave that would destroy everything in this country west of Nebraska.


More information about the U-Boot mailing list