71
71
# Verbosity
72
72
ifdef VERBOSE
73
73
Q :=
74
+ QLOG :=
74
75
else
75
76
Q := @
77
+ QLOG := >/dev/null
76
78
endif
77
79
78
80
# External build configuration
@@ -171,77 +173,77 @@ $(BUILD_DIRS_NATIVE): prerequisites
171
173
fi; \
172
174
mkdir -p $@ && \
173
175
cd $@ && \
174
- cmake -DENABLE_VALGRIND=$(VALGRIND ) -DENABLE_LOG=$(LOG ) -DENABLE_LTO=$(LTO ) -DCMAKE_TOOLCHAIN_FILE=$$TOOLCHAIN ../../.. &> cmake.log || \
176
+ ( cmake -DENABLE_VALGRIND=$(VALGRIND ) -DENABLE_LOG=$(LOG ) -DENABLE_LTO=$(LTO ) -DCMAKE_TOOLCHAIN_FILE=$$TOOLCHAIN ../../.. 2>&1 | tee cmake.log $( QLOG ) ; ( exit $${PIPESTATUS[0]} ) ) || \
175
177
(echo "CMake run failed. See "` pwd ` "/cmake.log for details."; exit 1;); \
176
178
echo "$$TOOLCHAIN" > toolchain.config
177
179
178
180
$(BUILD_DIRS_STM32F3 ) : prerequisites
179
181
$(Q ) mkdir -p $@ && \
180
182
cd $@ && \
181
- cmake -DENABLE_VALGRIND=$(VALGRIND) -DENABLE_LTO=$(LTO) -DCMAKE_TOOLCHAIN_FILE=build/configs/toolchain_mcu_stm32f3.cmake ../../.. &> cmake.log || \
183
+ ( 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]} ) ) || \
182
184
(echo "CMake run failed. See "`pwd`"/cmake.log for details."; exit 1;)
183
185
184
186
$(BUILD_DIRS_STM32F4 ) : prerequisites
185
187
$(Q ) mkdir -p $@ && \
186
188
cd $@ && \
187
- cmake -DENABLE_VALGRIND=$(VALGRIND) -DENABLE_LTO=$(LTO) -DCMAKE_TOOLCHAIN_FILE=build/configs/toolchain_mcu_stm32f4.cmake ../../.. &> cmake.log || \
189
+ ( 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]} ) ) || \
188
190
(echo "CMake run failed. See "`pwd`"/cmake.log for details."; exit 1;)
189
191
190
192
$(JERRY_LINUX_TARGETS ) : $(BUILD_DIR ) /native
191
193
$(Q ) mkdir -p $(OUT_DIR ) /$@
192
- $(Q ) [ " $( STATIC_CHECK) " = " OFF" ] || $(MAKE ) -C $(BUILD_DIR ) /native VERBOSE=1 cppcheck.$@ & > $(OUT_DIR ) /$@ /cppcheck.log || \
194
+ $(Q ) [ " $( STATIC_CHECK) " = " OFF" ] || ( $( MAKE) -C $( BUILD_DIR) /native VERBOSE=1 cppcheck.$@ 2>&1 | tee $( OUT_DIR) /$@ /cppcheck.log $( QLOG ) ; ( exit $$ {PIPESTATUS[0]} ) ) || \
193
195
(echo "cppcheck run failed. See $(OUT_DIR)/$@/cppcheck.log for details."; exit 1;)
194
- $(Q) $(MAKE) -C $(BUILD_DIR)/native VERBOSE=1 $@ &> $(OUT_DIR)/$@/make.log || \
196
+ $(Q) ( $(MAKE) -C $(BUILD_DIR)/native VERBOSE=1 $@ 2>&1 | tee $(OUT_DIR)/$@/make.log $(QLOG) ; ( exit $${PIPESTATUS[0]} ) ) || \
195
197
(echo "Build failed. See $(OUT_DIR)/$@/make.log for details."; exit 1;)
196
198
$(Q) cp $(BUILD_DIR)/native/$@ $(OUT_DIR)/$@/jerry
197
199
198
200
unittests : $(BUILD_DIR ) /native
199
201
$(Q ) mkdir -p $(OUT_DIR ) /$@
200
- $(Q ) [ " $( STATIC_CHECK) " = " OFF" ] || $(MAKE ) -C $(BUILD_DIR ) /native VERBOSE=1 cppcheck.$@ & > $(OUT_DIR ) /$@ /cppcheck.log || \
202
+ $(Q ) [ " $( STATIC_CHECK) " = " OFF" ] || ( $( MAKE) -C $( BUILD_DIR) /native VERBOSE=1 cppcheck.$@ 2>&1 | tee $( OUT_DIR) /$@ /cppcheck.log $( QLOG ) ; ( exit $$ {PIPESTATUS[0]} ) ) || \
201
203
(echo "cppcheck run failed. See $(OUT_DIR)/$@/cppcheck.log for details."; exit 1;)
202
- $(Q) $(MAKE) -C $(BUILD_DIR)/native VERBOSE=1 $@ &> $(OUT_DIR)/$@/make.log || \
204
+ $(Q) ( $(MAKE) -C $(BUILD_DIR)/native VERBOSE=1 $@ 2>&1 | tee $(OUT_DIR)/$@/make.log $(QLOG) ; ( exit $${PIPESTATUS[0]} ) ) || \
203
205
(echo "Build failed. See $(OUT_DIR)/$@/make.log for details."; exit 1;)
204
206
$(Q) cp $(BUILD_DIR)/native/unit-test-* $(OUT_DIR)/$@
205
207
206
208
$(BUILD_ALL ) _native : $(BUILD_DIRS_NATIVE )
207
209
$(Q ) mkdir -p $(OUT_DIR ) /$@
208
- $(Q ) $(MAKE ) -C $(BUILD_DIR ) /native jerry-libc-all VERBOSE=1 & > $(OUT_DIR ) /$@ /make.log || \
210
+ $(Q ) ( $( MAKE) -C $( BUILD_DIR) /native jerry-libc-all VERBOSE=1 2>&1 | tee $( OUT_DIR) /$@ /make.log $( QLOG ) ; ( exit $$ {PIPESTATUS[0]} ) ) || \
209
211
(echo "Build failed. See $(OUT_DIR)/$@/make.log for details."; exit 1;)
210
- $(Q) $(MAKE) -C $(BUILD_DIR)/native jerry-fdlibm-all VERBOSE=1 &> $(OUT_DIR)/$@/make.log || \
212
+ $(Q) ( $(MAKE) -C $(BUILD_DIR)/native jerry-fdlibm-all VERBOSE=1 2>&1 | tee $(OUT_DIR)/$@/make.log $(QLOG) ; ( exit $${PIPESTATUS[0]} ) ) || \
211
213
(echo "Build failed. See $(OUT_DIR)/$@/make.log for details."; exit 1;)
212
- $(Q) $(MAKE) -C $(BUILD_DIR)/native $(JERRY_LINUX_TARGETS) unittests VERBOSE=1 &> $(OUT_DIR)/$@/make.log || \
214
+ $(Q) ( $(MAKE) -C $(BUILD_DIR)/native $(JERRY_LINUX_TARGETS) unittests VERBOSE=1 2>&1 | tee $(OUT_DIR)/$@/make.log $(QLOG) ; ( exit $${PIPESTATUS[0]} ) ) || \
213
215
(echo "Build failed. See $(OUT_DIR)/$@/make.log for details."; exit 1;)
214
216
215
217
$(JERRY_STM32F3_TARGETS ) : $(BUILD_DIR ) /stm32f3
216
218
$(Q ) mkdir -p $(OUT_DIR ) /$@
217
- $(Q ) [ " $( STATIC_CHECK) " = " OFF" ] || $(MAKE ) -C $(BUILD_DIR ) /stm32f3 VERBOSE=1 cppcheck.$@ & > $(OUT_DIR ) /$@ /cppcheck.log || \
219
+ $(Q ) [ " $( STATIC_CHECK) " = " OFF" ] || ( $( MAKE) -C $( BUILD_DIR) /stm32f3 VERBOSE=1 cppcheck.$@ 2>&1 | tee $( OUT_DIR) /$@ /cppcheck.log $( QLOG ) ; ( exit $$ {PIPESTATUS[0]} ) ) || \
218
220
(echo "cppcheck run failed. See $(OUT_DIR)/$@/cppcheck.log for details."; exit 1;)
219
- $(Q) $(MAKE) -C $(BUILD_DIR)/stm32f3 VERBOSE=1
[email protected] &> $(OUT_DIR)/$@/make.log || \
221
+ $(Q)
( $(MAKE) -C $(BUILD_DIR)/stm32f3 VERBOSE=1
[email protected] 2>&1 | tee $(OUT_DIR)/$@/make.log
$(QLOG) ; ( exit $${PIPESTATUS[0]} ) ) || \
220
222
(echo "Build failed. See $(OUT_DIR)/$@/make.log for details."; exit 1;)
221
223
$(Q) cp $(BUILD_DIR)/stm32f3/$@ $(OUT_DIR)/$@/jerry
222
224
$(Q) cp $(BUILD_DIR)/stm32f3/
[email protected] $(OUT_DIR)/$@/jerry.bin
223
225
224
226
$(BUILD_ALL ) _stm32f3 : $(BUILD_DIRS_STM32F3 )
225
227
$(Q ) mkdir -p $(OUT_DIR ) /$@
226
- $(Q ) $(MAKE ) -C $(BUILD_DIR ) /stm32f3 jerry-libc-all VERBOSE=1 & > $(OUT_DIR ) /$@ /make.log || \
228
+ $(Q ) ( $( MAKE) -C $( BUILD_DIR) /stm32f3 jerry-libc-all VERBOSE=1 2>&1 | tee $( OUT_DIR) /$@ /make.log $( QLOG ) ; ( exit $$ {PIPESTATUS[0]} ) ) || \
227
229
(echo "Build failed. See $(OUT_DIR)/$@/make.log for details."; exit 1;)
228
- $(Q) $(MAKE) -C $(BUILD_DIR)/stm32f3 $(JERRY_STM32F3_TARGETS) VERBOSE=1 &> $(OUT_DIR)/$@/make.log || \
230
+ $(Q) ( $(MAKE) -C $(BUILD_DIR)/stm32f3 $(JERRY_STM32F3_TARGETS) VERBOSE=1 2>&1 | tee $(OUT_DIR)/$@/make.log $(QLOG) ; ( exit $${PIPESTATUS[0]} ) ) || \
229
231
(echo "Build failed. See $(OUT_DIR)/$@/make.log for details."; exit 1;)
230
232
231
233
$(JERRY_STM32F4_TARGETS ) : $(BUILD_DIR ) /stm32f4
232
234
$(Q ) mkdir -p $(OUT_DIR ) /$@
233
- $(Q ) [ " $( STATIC_CHECK) " = " OFF" ] || $(MAKE ) -C $(BUILD_DIR ) /stm32f4 VERBOSE=1 cppcheck.$@ & > $(OUT_DIR ) /$@ /cppcheck.log || \
235
+ $(Q ) [ " $( STATIC_CHECK) " = " OFF" ] || ( $( MAKE) -C $( BUILD_DIR) /stm32f4 VERBOSE=1 cppcheck.$@ 2>&1 | tee $( OUT_DIR) /$@ /cppcheck.log $( QLOG ) ; ( exit $$ {PIPESTATUS[0]} ) ) || \
234
236
(echo "cppcheck run failed. See $(OUT_DIR)/$@/cppcheck.log for details."; exit 1;)
235
- $(Q) $(MAKE) -C $(BUILD_DIR)/stm32f4 VERBOSE=1
[email protected] &> $(OUT_DIR)/$@/make.log || \
237
+ $(Q)
( $(MAKE) -C $(BUILD_DIR)/stm32f4 VERBOSE=1
[email protected] 2>&1 | tee $(OUT_DIR)/$@/make.log
$(QLOG) ; ( exit $${PIPESTATUS[0]} ) ) || \
236
238
(echo "Build failed. See $(OUT_DIR)/$@/make.log for details."; exit 1;)
237
239
$(Q) cp $(BUILD_DIR)/stm32f4/$@ $(OUT_DIR)/$@/jerry
238
240
$(Q) cp $(BUILD_DIR)/stm32f4/
[email protected] $(OUT_DIR)/$@/jerry.bin
239
241
240
242
$(BUILD_ALL ) _stm32f4 : $(BUILD_DIRS_STM32F4 )
241
243
$(Q ) mkdir -p $(OUT_DIR ) /$@
242
- $(Q ) $(MAKE ) -C $(BUILD_DIR ) /stm32f4 jerry-libc-all VERBOSE=1 & > $(OUT_DIR ) /$@ /make.log || \
244
+ $(Q ) ( $( MAKE) -C $( BUILD_DIR) /stm32f4 jerry-libc-all VERBOSE=1 2>&1 | tee $( OUT_DIR) /$@ /make.log $( QLOG ) ; ( exit $$ {PIPESTATUS[0]} ) ) || \
243
245
(echo "Build failed. See $(OUT_DIR)/$@/make.log for details."; exit 1;)
244
- $(Q) $(MAKE) -C $(BUILD_DIR)/stm32f4 $(JERRY_STM32F4_TARGETS) VERBOSE=1 &> $(OUT_DIR)/$@/make.log || \
246
+ $(Q) ( $(MAKE) -C $(BUILD_DIR)/stm32f4 $(JERRY_STM32F4_TARGETS) VERBOSE=1 2>&1 | tee $(OUT_DIR)/$@/make.log $(QLOG) ; ( exit $${PIPESTATUS[0]} ) ) || \
245
247
(echo "Build failed. See $(OUT_DIR)/$@/make.log for details."; exit 1;)
246
248
247
249
build_all : $(BUILD_ALL ) _native $(BUILD_ALL ) _stm32f3 $(BUILD_ALL ) _stm32f4
@@ -252,12 +254,12 @@ build_all: $(BUILD_ALL)_native $(BUILD_ALL)_stm32f3 $(BUILD_ALL)_stm32f4
252
254
#
253
255
build : $(BUILD_ALL )
254
256
$(Q ) mkdir -p $(OUT_DIR ) /$@
255
- $(Q ) $(MAKE ) VERBOSE=1 $(JERRY_TARGETS ) & > $(OUT_DIR ) /$@ /make.log || \
257
+ $(Q ) ( $( MAKE) VERBOSE=1 $( JERRY_TARGETS) 2>&1 | tee $( OUT_DIR) /$@ /make.log $( QLOG ) ; ( exit $$ {PIPESTATUS[0]} ) ) || \
256
258
(echo "Build failed. See $(OUT_DIR)/$@/make.log for details."; exit 1;)
257
259
$(Q) rm -rf $(OUT_DIR)/$(BUILD_ALL)* $(OUT_DIR)/$@
258
260
259
261
$(FLASH_TARGETS ) : $(BUILD_DIR ) /mcu
260
- $(Q ) $(MAKE ) -C $(BUILD_DIR ) /mcu VERBOSE=1 $@ 1> /dev/null
262
+ $(Q ) $(MAKE ) -C $(BUILD_DIR ) /mcu VERBOSE=1 $@ $( QLOG )
261
263
262
264
push : ./tools/git-scripts/push.sh
263
265
$(Q ) ./tools/git-scripts/push.sh
@@ -285,7 +287,7 @@ prerequisites: $(PREREQUISITES_STATE_DIR)/.prerequisites
285
287
$(PREREQUISITES_STATE_DIR ) /.prerequisites :
286
288
@ echo " Setting up prerequisites... (log file: $( PREREQUISITES_STATE_DIR) /prerequisites.log)"
287
289
$(Q ) mkdir -p $(PREREQUISITES_STATE_DIR )
288
- $(Q ) ./tools/prerequisites.sh $(PREREQUISITES_STATE_DIR ) /.prerequisites >& $(PREREQUISITES_STATE_DIR ) /prerequisites.log || \
290
+ $(Q ) ( ./tools/prerequisites.sh $( PREREQUISITES_STATE_DIR) /.prerequisites 2>&1 | tee $( PREREQUISITES_STATE_DIR) /prerequisites.log $( QLOG ) ; ( exit $$ {PIPESTATUS[0]} ) ) || \
289
291
(echo "Prerequisites setup failed. See $(PREREQUISITES_STATE_DIR)/prerequisites.log for details."; exit 1;)
290
292
@ echo "Prerequisites setup succeeded"
291
293
0 commit comments