From: Wolfgang Denk Date: Mon, 24 Feb 2014 06:36:07 +0100 Subject: [U-Boot] [PATCH v2 03/15] kbuild: move asm-offsets.h rules to ./Kbuild In-Reply-To: <1393207943-3725-4-git-send-email-yamada.m@jp.panasonic.com> References: <1393207943-3725-1-git-send-email-yamada.m@jp.panasonic.com> <1393207943-3725-4-git-send-email-yamada.m@jp.panasonic.com> Message-ID: <20140224053607.6B9603801BF@gemini.denx.de> List-Id: MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit To: u-boot@lists.denx.de Dear Masahiro, In message <1393207943-3725-4-git-send-email-yamada.m@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@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.