(Nicola, I'm sorry for the duplicate, but I didn't mean to drop xen-devel@.)
On 22.08.2023 10:27, Nicola Vetrini wrote: >>> +C-runtime-failures.c: C-runtime-failures.rst >>> +# sed is used in place of cat to prevent occurrences of '*/' >>> +# in the .rst from breaking the compilation >>> + ( \ >>> + echo "$${MISRA_HEADER}"; \ >>> + sed -e 's|*/|*//*|' $<; \ >>> + echo "$${MISRA_FOOTER}" \ >>> + ) > $@ >> >> The rule of thumb is to generate into a temporary file (then you also >> don't need to wrap everything in parentheses [or braces]), and then >> use mv to produce the final output. This escapes anomalies with failed >> or interrupted commands. >> > > I do see your point for temporary files, though wrapping commands with > parentheses is a > fairly common pattern in Xen Makefiles afaict. Now I'm curious: Grepping for ') >' underneath xen/ I couldn't find a single instance in any makefile. (I'm not going to exclude there are a few uses, but then likely not merely to combine multiple commands' output.) Jan