@@ -155,8 +155,10 @@ export SHELL=/bin/bash
155
155
# "Build all" targets prefix
156
156
BUILD_ALL := build_all
157
157
158
+ .PHONY : all
158
159
all : precommit
159
160
161
+ .PHONY : $(BUILD_DIRS_NATIVE )
160
162
$(BUILD_DIRS_NATIVE ) : prerequisites
161
163
$(Q ) if [ " $$ TOOLCHAIN" == " " ]; \
162
164
then \
@@ -177,18 +179,21 @@ $(BUILD_DIRS_NATIVE): prerequisites
177
179
(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]} ) ) || \
178
180
(echo "CMake run failed. See "`pwd`"/cmake.log for details."; exit 1;); \
179
181
182
+ .PHONY : $(BUILD_DIRS_STM32F3 )
180
183
$(BUILD_DIRS_STM32F3 ) : prerequisites
181
184
$(Q ) mkdir -p $@
182
185
$(Q ) cd $@ && \
183
186
(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]} ) ) || \
184
187
(echo "CMake run failed. See "`pwd`"/cmake.log for details."; exit 1;)
185
188
189
+ .PHONY : $(BUILD_DIRS_STM32F4 )
186
190
$(BUILD_DIRS_STM32F4 ) : prerequisites
187
191
$(Q ) mkdir -p $@
188
192
$(Q ) cd $@ && \
189
193
(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]} ) ) || \
190
194
(echo "CMake run failed. See "`pwd`"/cmake.log for details."; exit 1;)
191
195
196
+ .PHONY : $(JERRY_LINUX_TARGETS )
192
197
$(JERRY_LINUX_TARGETS ) : $(BUILD_DIR ) /native
193
198
$(Q ) mkdir -p $(OUT_DIR ) /$@
194
199
$(Q ) [ " $( STATIC_CHECK) " = " OFF" ] || ($( MAKE) -C $( BUILD_DIR) /native VERBOSE=1 cppcheck.$@ 2>&1 | tee $( OUT_DIR) /$@ /cppcheck.log $( QLOG) ; ( exit $$ {PIPESTATUS[0]} ) ) || \
@@ -197,6 +202,7 @@ $(JERRY_LINUX_TARGETS): $(BUILD_DIR)/native
197
202
(echo "Build failed. See $(OUT_DIR)/$@/make.log for details."; exit 1;)
198
203
$(Q) cp $(BUILD_DIR)/native/$@ $(OUT_DIR)/$@/jerry
199
204
205
+ .PHONY : unittests
200
206
unittests : $(BUILD_DIR ) /native
201
207
$(Q ) mkdir -p $(OUT_DIR ) /$@
202
208
$(Q ) [ " $( STATIC_CHECK) " = " OFF" ] || ($( MAKE) -C $( BUILD_DIR) /native VERBOSE=1 cppcheck.$@ 2>&1 | tee $( OUT_DIR) /$@ /cppcheck.log $( QLOG) ; ( exit $$ {PIPESTATUS[0]} ) ) || \
@@ -205,6 +211,7 @@ unittests: $(BUILD_DIR)/native
205
211
(echo "Build failed. See $(OUT_DIR)/$@/make.log for details."; exit 1;)
206
212
$(Q) cp $(BUILD_DIR)/native/unit-test-* $(OUT_DIR)/$@
207
213
214
+ .PHONY : $(BUILD_ALL ) _native
208
215
$(BUILD_ALL ) _native : $(BUILD_DIRS_NATIVE )
209
216
$(Q ) mkdir -p $(OUT_DIR ) /$@
210
217
$(Q ) ($( MAKE) -C $( BUILD_DIR) /native jerry-libc-all VERBOSE=1 2>&1 | tee $( OUT_DIR) /$@ /make.log $( QLOG) ; ( exit $$ {PIPESTATUS[0]} ) ) || \
@@ -214,6 +221,7 @@ $(BUILD_ALL)_native: $(BUILD_DIRS_NATIVE)
214
221
$(Q) ($(MAKE) -C $(BUILD_DIR)/native $(JERRY_LINUX_TARGETS) unittests VERBOSE=1 2>&1 | tee $(OUT_DIR)/$@/make.log $(QLOG) ; ( exit $${PIPESTATUS[0]} ) ) || \
215
222
(echo "Build failed. See $(OUT_DIR)/$@/make.log for details."; exit 1;)
216
223
224
+ .PHONY : $(JERRY_STM32F3_TARGETS )
217
225
$(JERRY_STM32F3_TARGETS ) : $(BUILD_DIR ) /stm32f3
218
226
$(Q ) mkdir -p $(OUT_DIR ) /$@
219
227
$(Q ) [ " $( STATIC_CHECK) " = " OFF" ] || ($( MAKE) -C $( BUILD_DIR) /stm32f3 VERBOSE=1 cppcheck.$@ 2>&1 | tee $( OUT_DIR) /$@ /cppcheck.log $( QLOG) ; ( exit $$ {PIPESTATUS[0]} ) ) || \
@@ -223,13 +231,15 @@ $(JERRY_STM32F3_TARGETS): $(BUILD_DIR)/stm32f3
223
231
$(Q) cp $(BUILD_DIR)/stm32f3/$@ $(OUT_DIR)/$@/jerry
224
232
$(Q) cp $(BUILD_DIR)/stm32f3/
[email protected] $(OUT_DIR)/$@/jerry.bin
225
233
234
+ .PHONY : $(BUILD_ALL ) _stm32f3
226
235
$(BUILD_ALL ) _stm32f3 : $(BUILD_DIRS_STM32F3 )
227
236
$(Q ) mkdir -p $(OUT_DIR ) /$@
228
237
$(Q ) ($( MAKE) -C $( BUILD_DIR) /stm32f3 jerry-libc-all VERBOSE=1 2>&1 | tee $( OUT_DIR) /$@ /make.log $( QLOG) ; ( exit $$ {PIPESTATUS[0]} ) ) || \
229
238
(echo "Build failed. See $(OUT_DIR)/$@/make.log for details."; exit 1;)
230
239
$(Q) ($(MAKE) -C $(BUILD_DIR)/stm32f3 $(JERRY_STM32F3_TARGETS) VERBOSE=1 2>&1 | tee $(OUT_DIR)/$@/make.log $(QLOG) ; ( exit $${PIPESTATUS[0]} ) ) || \
231
240
(echo "Build failed. See $(OUT_DIR)/$@/make.log for details."; exit 1;)
232
241
242
+ .PHONY : $(JERRY_STM32F4_TARGETS )
233
243
$(JERRY_STM32F4_TARGETS ) : $(BUILD_DIR ) /stm32f4
234
244
$(Q ) mkdir -p $(OUT_DIR ) /$@
235
245
$(Q ) [ " $( STATIC_CHECK) " = " OFF" ] || ($( MAKE) -C $( BUILD_DIR) /stm32f4 VERBOSE=1 cppcheck.$@ 2>&1 | tee $( OUT_DIR) /$@ /cppcheck.log $( QLOG) ; ( exit $$ {PIPESTATUS[0]} ) ) || \
@@ -239,49 +249,60 @@ $(JERRY_STM32F4_TARGETS): $(BUILD_DIR)/stm32f4
239
249
$(Q) cp $(BUILD_DIR)/stm32f4/$@ $(OUT_DIR)/$@/jerry
240
250
$(Q) cp $(BUILD_DIR)/stm32f4/
[email protected] $(OUT_DIR)/$@/jerry.bin
241
251
252
+ .PHONY : $(BUILD_ALL ) _stm32f4
242
253
$(BUILD_ALL ) _stm32f4 : $(BUILD_DIRS_STM32F4 )
243
254
$(Q ) mkdir -p $(OUT_DIR ) /$@
244
255
$(Q ) ($( MAKE) -C $( BUILD_DIR) /stm32f4 jerry-libc-all VERBOSE=1 2>&1 | tee $( OUT_DIR) /$@ /make.log $( QLOG) ; ( exit $$ {PIPESTATUS[0]} ) ) || \
245
256
(echo "Build failed. See $(OUT_DIR)/$@/make.log for details."; exit 1;)
246
257
$(Q) ($(MAKE) -C $(BUILD_DIR)/stm32f4 $(JERRY_STM32F4_TARGETS) VERBOSE=1 2>&1 | tee $(OUT_DIR)/$@/make.log $(QLOG) ; ( exit $${PIPESTATUS[0]} ) ) || \
247
258
(echo "Build failed. See $(OUT_DIR)/$@/make.log for details."; exit 1;)
248
259
260
+ .PHONY : build_all
249
261
build_all : $(BUILD_ALL ) _native $(BUILD_ALL ) _stm32f3 $(BUILD_ALL ) _stm32f4
250
262
251
263
#
252
264
# build - build_all, then run cppcheck and copy output to OUT_DIR
253
265
# Prebuild is needed to avoid race conditions between make instances running in parallel
254
266
#
267
+ .PHONY : build
255
268
build : $(BUILD_ALL )
256
269
$(Q ) mkdir -p $(OUT_DIR ) /$@
257
270
$(Q ) ($( MAKE) VERBOSE=1 $( JERRY_TARGETS) 2>&1 | tee $( OUT_DIR) /$@ /make.log $( QLOG) ; ( exit $$ {PIPESTATUS[0]} ) ) || \
258
271
(echo "Build failed. See $(OUT_DIR)/$@/make.log for details."; exit 1;)
259
272
$(Q) rm -rf $(OUT_DIR)/$(BUILD_ALL)* $(OUT_DIR)/$@
260
273
274
+ .PHONY : $(FLASH_TARGETS )
261
275
$(FLASH_TARGETS ) : $(BUILD_DIR ) /mcu
262
276
$(Q ) $(MAKE ) -C $(BUILD_DIR ) /mcu VERBOSE=1 $@ $(QLOG )
263
277
278
+ .PHONY : push
264
279
push : ./tools/git-scripts/push.sh
265
280
$(Q ) ./tools/git-scripts/push.sh
266
281
282
+ .PHONY : pull
267
283
pull : ./tools/git-scripts/pull.sh
268
284
$(Q ) ./tools/git-scripts/pull.sh
269
285
286
+ .PHONY : log
270
287
log : ./tools/git-scripts/log.sh
271
288
$(Q ) ./tools/git-scripts/log.sh
272
289
290
+ .PHONY : precommit
273
291
precommit : clean prerequisites
274
292
$(Q ) ./tools/precommit.sh " $( MAKE) " " $( OUT_DIR) " " $( PRECOMMIT_CHECK_TARGETS_LIST) "
275
293
294
+ .PHONY : unittests_run
276
295
unittests_run : unittests
277
296
$(Q ) rm -rf $(OUT_DIR ) /unittests/check
278
297
$(Q ) mkdir -p $(OUT_DIR ) /unittests/check
279
298
$(Q ) ./tools/runners/run-unittests.sh $(OUT_DIR ) /unittests || \
280
299
(echo "Unit tests run failed. See $(OUT_DIR)/unittests/unit_tests_run.log for details."; exit 1;)
281
300
301
+ .PHONY : clean
282
302
clean :
283
303
$(Q ) rm -rf $(BUILD_DIR_PREFIX ) * $(OUT_DIR )
284
304
305
+ .PHONY : prerequisites
285
306
prerequisites : $(PREREQUISITES_STATE_DIR ) /.prerequisites
286
307
287
308
$(PREREQUISITES_STATE_DIR ) /.prerequisites :
@@ -291,8 +312,7 @@ $(PREREQUISITES_STATE_DIR)/.prerequisites:
291
312
(echo "Prerequisites setup failed. See $(PREREQUISITES_STATE_DIR)/prerequisites.log for details."; exit 1;)
292
313
@ echo "Prerequisites setup succeeded"
293
314
315
+ .PHONY : prerequisites_clean
294
316
prerequisites_clean :
295
317
$(Q ) ./tools/prerequisites.sh $(PREREQUISITES_STATE_DIR ) /.prerequisites clean
296
318
$(Q ) rm -rf $(PREREQUISITES_STATE_DIR )
297
-
298
- .PHONY : prerequisites_clean prerequisites clean build unittests_run $(BUILD_DIRS_ALL ) $(JERRY_TARGETS ) $(FLASH_TARGETS )
0 commit comments