添加struct里使用lambda测试

This commit is contained in:
2025-06-20 17:26:36 +08:00
parent 362dc08ba5
commit 3e3c62941d
3 changed files with 38 additions and 14 deletions

22
make.py
View File

@@ -132,7 +132,8 @@ def build_depend(src:list):
if(ret):
exit()
else:
print(f"{i} 没有更新源文件")
# print(f"{i} 没有更新源文件")
pass
# 生成中间文件
def build_object(src:list):
@@ -150,13 +151,15 @@ def build_object(src:list):
if(check_rebuild(dst,read_depend_files(cd))):
cmd=f"{CC} -c {i} -o {dst} {flags}"
else:
print(f"{i} 没有更新依赖关系")
# print(f"{i} 没有更新依赖关系")
pass
elif(file_type in ['s','S','asm','ASM']):
if(check_rebuild(dst,[i])):
# cmd=f"{AS} -c {i} -o {dst} {flags}"
pass
else:
print(f"{i} 没有更新依赖关系")
# print(f"{i} 没有更新依赖关系")
pass
if(len(cmd)>0):
print(cmd)
ret=os.system(cmd)
@@ -179,29 +182,26 @@ def build_target(src:list):
if(ret):
exit()
else:
print(f"{dst} 没有更新的链接文件")
# print(f"{dst} 没有更新的链接文件")
pass
def main():
global CSRC
global ASRC
if(not os.path.exists(BUILD_DIR)):
os.makedirs(BUILD_DIR)
CSRC+=find_type('soft',['c','C'])
CSRC+=find_type('cpu',['c','C'])
CSRC=search_lambda(CSRC)
# ASRC+=find_type('./',['s','S','asm','ASM'])
if(not os.path.exists(BUILD_DIR)):
os.makedirs(BUILD_DIR)
print("生成依赖关系")
build_depend(CSRC)
print("生成对象文件")
build_object(CSRC)
# build_object(ASRC)
print("生成目标文件")
build_target(CSRC+ASRC)
# os.system(f"{HEX} {BUILD_DIR}/{TARGET} {BUILD_DIR}/{TARGET}.hex")
# os.system(f"{BIN} {BUILD_DIR}/{TARGET} {BUILD_DIR}/{TARGET}.bin")
if __name__ == "__main__":
main()