Skip to content

Commit e0d1598

Browse files
committed
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 [email protected]
1 parent 3b15201 commit e0d1598

File tree

1 file changed

+12
-12
lines changed

1 file changed

+12
-12
lines changed

Makefile

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -167,25 +167,25 @@ $(BUILD_DIRS_NATIVE): prerequisites
167167
fi; \
168168
TOOLCHAIN="build/configs/toolchain_linux_$$arch.cmake"; \
169169
fi; \
170-
if [ -d "$@" ]; \
171-
then \
172-
grep -s -q "$$TOOLCHAIN" $@/toolchain.config || rm -rf $@ ; \
173-
fi; \
174-
mkdir -p $@ && \
175-
cd $@ && \
176-
(cmake -DENABLE_VALGRIND=$(VALGRIND) -DENABLE_LOG=$(LOG) -DENABLE_LTO=$(LTO) -DCMAKE_TOOLCHAIN_FILE=$$TOOLCHAIN ../../.. 2>&1 | tee cmake.log $(QLOG) ; ( exit $${PIPESTATUS[0]} ) ) || \
170+
if [ -d "$@" ]; \
171+
then \
172+
grep -s -q "$$TOOLCHAIN" $@/toolchain.config || rm -rf $@ ; \
173+
fi; \
174+
mkdir -p $@; \
175+
echo "$$TOOLCHAIN" > $@/toolchain.config
176+
$(Q) cd $@ && \
177+
(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]} ) ) || \
177178
(echo "CMake run failed. See "`pwd`"/cmake.log for details."; exit 1;); \
178-
echo "$$TOOLCHAIN" > toolchain.config
179179

180180
$(BUILD_DIRS_STM32F3): prerequisites
181-
$(Q) mkdir -p $@ && \
182-
cd $@ && \
181+
$(Q) mkdir -p $@
182+
$(Q) cd $@ && \
183183
(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]} ) ) || \
184184
(echo "CMake run failed. See "`pwd`"/cmake.log for details."; exit 1;)
185185

186186
$(BUILD_DIRS_STM32F4): prerequisites
187-
$(Q) mkdir -p $@ && \
188-
cd $@ && \
187+
$(Q) mkdir -p $@
188+
$(Q) cd $@ && \
189189
(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]} ) ) || \
190190
(echo "CMake run failed. See "`pwd`"/cmake.log for details."; exit 1;)
191191

0 commit comments

Comments
 (0)