使用专门的make命令生成 src_files.txt

This commit is contained in:
2025-01-17 19:55:18 +08:00
parent e202cbfdbe
commit 01283e9f23
3 changed files with 19 additions and 2 deletions

View File

@@ -953,6 +953,7 @@ build_obj_func() {
# ./make.py -j APP=${APP_SELECTION} -C .. clobber # ./make.py -j APP=${APP_SELECTION} -C .. clobber
# fi # fi
# ./make.py -j PLATFORM=${DEF_PLATFORM_TYPE} cco=1 APP=${APP_SELECTION} FLASH_SIZE=${FLASH_SIZE_nM} -C .. # ./make.py -j PLATFORM=${DEF_PLATFORM_TYPE} cco=1 APP=${APP_SELECTION} FLASH_SIZE=${FLASH_SIZE_nM} -C ..
./make.py -j APP=${APP_SELECTION} -C .. creat_src_file
build_use_ninja ${DEF_PLATFORM_TYPE} ${APP_SELECTION} ${FLASH_SIZE_nM} build_use_ninja ${DEF_PLATFORM_TYPE} ${APP_SELECTION} ${FLASH_SIZE_nM}
if [ "${APP_SELECTION}" == "${DEF_CUS_APP}" ]; then if [ "${APP_SELECTION}" == "${DEF_CUS_APP}" ]; then
#kl3 customer demo, cus_core. #kl3 customer demo, cus_core.

View File

@@ -84,8 +84,8 @@ SRCS += $(EXT_SRC)
# all the obj names # all the obj names
OBJECTS = $(addprefix $(BIN_DIR)/, $(patsubst %.S, %.o, $(patsubst %.c, %.o, $(patsubst %.cpp, %.o, $(SRCS))))) OBJECTS = $(addprefix $(BIN_DIR)/, $(patsubst %.S, %.o, $(patsubst %.c, %.o, $(patsubst %.cpp, %.o, $(SRCS)))))
$(shell echo $(SRCS) > "src_files.txt") # $(shell echo $(SRCS) > "src_files.txt")
$(shell echo $(ADD_INCLUDE) >> "src_files.txt") # $(shell echo $(ADD_INCLUDE) >> "src_files.txt")
endif endif
PLATFORM ?= FPGA PLATFORM ?= FPGA
@@ -422,6 +422,17 @@ clean:
clobber: clobber:
@echo clobber @echo clobber
creat_src_file:src_files.txt
src_files.txt:
@echo $(SRCS) > "src_files.txt"
@echo $(ADD_INCLUDE) >> "src_files.txt"
@for d in $(SUB_DIRS) ; do\
if [ -e "$$d/Makefile" ]; then\
$(MAKE) -C $$d $@ ;\
fi;\
done
# clean obj files only # clean obj files only
clean_objs: clean_objs:
-$(RM) $(OBJECTS) -$(RM) $(OBJECTS)

View File

@@ -15,6 +15,10 @@ def clear(dir_path:str,rm_dir:str):
shutil.rmtree(path) shutil.rmtree(path)
else: else:
clear(path,rm_dir) clear(path,rm_dir)
elif os.path.isfile(path):
if item == rm_dir:
print('remove: ',path)
os.remove(path)
@@ -22,4 +26,5 @@ def clear(dir_path:str,rm_dir:str):
if __name__ == "__main__": if __name__ == "__main__":
clear('../','.output') clear('../','.output')
clear('../','src_files.txt')