From f8ee565016b2706f48488bacf98788281389d6c0 Mon Sep 17 00:00:00 2001 From: Akos Kiss Date: Wed, 15 Jul 2015 17:00:28 +0200 Subject: [PATCH] Split independent commands in make recipes Mostly, there is no need for joining commands with `&&` in recipes since make already applies the exit-on-error functionality to each executed line, unless there is a shell interdependency between them (like setting environment variables in one command and using it in another, or changing the working directory, which would not work because of the new-subshell-per-line behaviour of make). Thus, some independent commands can be split in the `Makefile` to improve readability. (Some space/tab inconsistensies are also fixed.) JerryScript-DCO-1.0-Signed-off-by: Akos Kiss akiss@inf.u-szeged.hu --- Makefile | 24 ++++++++++++------------ 1 file changed, 12 insertions(+), 12 deletions(-) diff --git a/Makefile b/Makefile index 57a5f3069..b0cff7faf 100644 --- a/Makefile +++ b/Makefile @@ -167,25 +167,25 @@ $(BUILD_DIRS_NATIVE): prerequisites fi; \ TOOLCHAIN="build/configs/toolchain_linux_$$arch.cmake"; \ fi; \ - if [ -d "$@" ]; \ - then \ - grep -s -q "$$TOOLCHAIN" $@/toolchain.config || rm -rf $@ ; \ - fi; \ - mkdir -p $@ && \ - cd $@ && \ - (cmake -DENABLE_VALGRIND=$(VALGRIND) -DENABLE_LOG=$(LOG) -DENABLE_LTO=$(LTO) -DCMAKE_TOOLCHAIN_FILE=$$TOOLCHAIN ../../.. 2>&1 | tee cmake.log $(QLOG) ; ( exit $${PIPESTATUS[0]} ) ) || \ + if [ -d "$@" ]; \ + then \ + grep -s -q "$$TOOLCHAIN" $@/toolchain.config || rm -rf $@ ; \ + fi; \ + mkdir -p $@; \ + echo "$$TOOLCHAIN" > $@/toolchain.config + $(Q) cd $@ && \ + (cmake -DENABLE_VALGRIND=$(VALGRIND) -DENABLE_LOG=$(LOG) -DENABLE_LTO=$(LTO) -DCMAKE_TOOLCHAIN_FILE=`cat toolchain.config` ../../.. 2>&1 | tee cmake.log $(QLOG) ; ( exit $${PIPESTATUS[0]} ) ) || \ (echo "CMake run failed. See "`pwd`"/cmake.log for details."; exit 1;); \ - echo "$$TOOLCHAIN" > toolchain.config $(BUILD_DIRS_STM32F3): prerequisites - $(Q) mkdir -p $@ && \ - cd $@ && \ + $(Q) mkdir -p $@ + $(Q) cd $@ && \ (cmake -DENABLE_VALGRIND=$(VALGRIND) -DENABLE_LTO=$(LTO) -DCMAKE_TOOLCHAIN_FILE=build/configs/toolchain_mcu_stm32f3.cmake ../../.. 2>&1 | tee cmake.log $(QLOG) ; ( exit $${PIPESTATUS[0]} ) ) || \ (echo "CMake run failed. See "`pwd`"/cmake.log for details."; exit 1;) $(BUILD_DIRS_STM32F4): prerequisites - $(Q) mkdir -p $@ && \ - cd $@ && \ + $(Q) mkdir -p $@ + $(Q) cd $@ && \ (cmake -DENABLE_VALGRIND=$(VALGRIND) -DENABLE_LTO=$(LTO) -DCMAKE_TOOLCHAIN_FILE=build/configs/toolchain_mcu_stm32f4.cmake ../../.. 2>&1 | tee cmake.log $(QLOG) ; ( exit $${PIPESTATUS[0]} ) ) || \ (echo "CMake run failed. See "`pwd`"/cmake.log for details."; exit 1;)