root下的Makefile
include build/core/main.mk
會展開main.mk位於build/core
build/core/main.mk
內有clean
下make clean 就會呼叫到這裡
.PHONY: clean
dirs_to_clean := \
$(PRODUCT_OUT) \
$(TARGET_COMMON_OUT_ROOT) \
$(HOST_OUT) \
$(HOST_COMMON_OUT_ROOT)
clean:
@for dir in $(dirs_to_clean) ; do \
echo "Cleaning $$dir..."; \
rm -rf $$dir; \
done
@echo "Clean."; \
所以要知道會刪除哪些資料就要知道這些參數的定義
$(PRODUCT_OUT)
$(TARGET_COMMON_OUT_ROOT)
$(HOST_OUT)
$(HOST_COMMON_OUT_ROOT)
可以從envsetup.mk知道
以下是結果
TARGET_COMMON_OUT_ROOT = out/target/common
PRODUCT_OUT := $(TARGET_PRODUCT_OUT_ROOT)/$(TARGET_DEVICE) = out/target/product/imx51_bbg
HOST_OUT = out/host/linux-x86
HOST_COMMON_OUT_ROOT = out/host/common
怎麼知道envsetup.mk有跟main.mk有關系呢
main.mk會include config.mk
./main.mk:55:include $(BUILD_SYSTEM)/config.mk
config.mk會include envsetup.mk
./config.mk:122:include $(BUILD_SYSTEM)/envsetup.mk
而BUILD_SYSTEM就是build/core
沒有留言:
張貼留言