Whamcloud - gitweb
LU-1016 build: no sub-builds in sub-shells
The make program paradigm is to have command failures fail the make.
Invoking a failing "make" in a subshell will cause the subshell
to exit returning non-zero to the invoking shell. However, the
invoking shell will *NOT* exit. Therefore, to correctly use a
subshell in a make file scriptlet, use the following template:
( do-some-stuff ) || false
this will work as expected. You want "false" instead of "exit 1"
in case make as been invoked with the "-i" ("--ignore-errors")
option.
WRT the code in question, there really is no need of even using
a subshell. So this patch fixes two (related) things:
1. the "for subdir in $(RPM_SUBDIR)" is now done in one process
and will cause the superior make to stop if any subdirectory
make fails.
2. The tests for BUILD_TESTS and BUILD_SERVER for building RPMs
need to take into account the possibility that these are not
necessarily defined in all autoMakefile.am's that use the
autoMakefile.am.toplevel file.
Signed-off-by: Bruce Korb <bruce_korb@xyratex.com>
Xyratex-bug-id: MRP-361
Change-Id: Icbfd453d42a69a2b65d66677e02d89f746533121
Reviewed-on: http://review.whamcloud.com/2012
Tested-by: Hudson
Tested-by: Maloo <whamcloud.maloo@gmail.com>
Reviewed-by: Minh Diep <mdiep@whamcloud.com>
Reviewed-by: Brian J. Murrell <brian@whamcloud.com>
Reviewed-by: Andreas Dilger <adilger@whamcloud.com>