diff --git a/build/build_sbl.sh b/build/build_sbl.sh index 0ca678a..9eb86dc 100755 --- a/build/build_sbl.sh +++ b/build/build_sbl.sh @@ -50,10 +50,10 @@ export product_line=PLC export PATH=/opt/kunlun2/bin/:$PATH set -o errexit -make -C .. clobber +# make -j -C .. clobber # clean phy lib etc. -make -C .. sbl_clean +# make -j -C .. sbl_clean # build klx ram -make -C .. sbl opt_build=1 +make -j -C .. sbl opt_build=1 diff --git a/build/build_time_cost_test.py b/build/build_time_cost_test.py index 9e30c98..054c815 100755 --- a/build/build_time_cost_test.py +++ b/build/build_time_cost_test.py @@ -13,6 +13,9 @@ if __name__ == "__main__": cmd=f"{' '.join(sys.argv[1:])} > build_log.log" if not ('not_clean' in sys.argv[1:]): os.system("python3 ../clear_output.py > /dev/null") + os.remove("../make_flags.txt") + os.remove("../python_script_log.log") + os.system("python3 ../praper_vscode.py clear >> ../python_script_log.log") path="../tools/gen_img/customer" if os.path.exists(path): shutil.rmtree(path) diff --git a/build/makefile.cfg b/build/makefile.cfg index 5f1e507..5396a35 100644 --- a/build/makefile.cfg +++ b/build/makefile.cfg @@ -71,7 +71,14 @@ GET_SRCS = $(wildcard $(1)/*.c) $(wildcard $(1)/*.cpp) $(wildcard $(1)/*.S) # local .c SRCS += $(call GET_SRCS, .) # every sub dir's .c -SRCS += $(foreach dirname, $(SUB_DIRS), $(call GET_SRCS, $(dirname))) +# 如果子文件夹包含makefile文件 则不包含这个目录的源文件 +SRC_DIRS = $(shell for dir in $(SUB_DIRS); do \ + if [ ! -f "$$dir/Makefile" ]; then \ + echo "$$dir"; \ + fi \ + done) + +SRCS += $(foreach dirname, $(SRC_DIRS), $(call GET_SRCS, $(dirname))) # ext src SRCS += $(EXT_SRC) # all the obj names @@ -312,6 +319,7 @@ $(OUTPUT_FULL_NAME): $(OUTPUT_DIR) $(BIN_DIR)/.sub_dirs $(BIN_DIR)/.ext_src $(OB @python3 $(TOPDIR)/praper_vscode.py $(TOPDIR)/make_flags.txt $@ >> $(TOPDIR)/python_script_log.log @for d in $(SUB_DIRS); do\ if [ -e "$$d/Makefile" ]; then\ + echo "enter $$d";\ $(MAKE) -C $$d || exit 1;\ if [ 2 -eq $(OUTPUT_TYPE) ];then\ if [ -e $(OUTPUT_FULL_NAME) ]; then \ @@ -402,27 +410,21 @@ clean: -$(RM) $(OUTPUT_FULL_NAME) $(OBJECTS) $(DEPS) $(BIN_DIR)/.sub_dirs $(BIN_DIR)/.ext_src @for d in $(SUB_DIRS) ; do\ if [ -e "$$d/Makefile" ]; then\ + echo "clean $$d";\ $(MAKE) -C $$d $@ ;\ fi;\ done -$(RM) $(OUTDIR) clobber: - @for d in $(SUB_DIRS); do\ - if [ -e "$$d/Makefile" ]; then\ - $(MAKE) -C $$d $@ ;\ - fi;\ - done - @-$(RM) $(TOPDIR)/make_flags.txt - @-$(RM) $(TOPDIR)/python_script_log.log - @-python3 $(TOPDIR)/praper_vscode.py clear >> $(TOPDIR)/python_script_log.log - @-$(RM) $(OUTDIR) + @echo clobber # clean obj files only clean_objs: -$(RM) $(OBJECTS) @for d in $(SUB_DIRS); do\ if [ -e "$$d/Makefile" ]; then\ + echo "clean_objs $$d";\ $(MAKE) -C $$d $@ ;\ fi;\ done diff --git a/sbl/src/boot.c b/sbl/src/boot.c index 0b1d1f7..498c0dd 100644 --- a/sbl/src/boot.c +++ b/sbl/src/boot.c @@ -68,6 +68,7 @@ void start_boot(void) int sbl_main(int fboot_flag) { + // 保存rom传递的快速启动标志 sbl_fastboot_flag_set((uint32_t)fboot_flag); start_boot();