From e631373f40e088031990ca05b8ea63bce5926c5d Mon Sep 17 00:00:00 2001 From: Aleksey Chubukov Date: Mon, 9 Oct 2023 21:04:55 +0400 Subject: [PATCH] fix automatic makefile regeneration --- make.py | 23 ++++++++++++----------- 1 file changed, 12 insertions(+), 11 deletions(-) mode change 100644 => 100755 make.py diff --git a/make.py b/make.py old mode 100644 new mode 100755 index b44ac93..9ea2baa --- a/make.py +++ b/make.py @@ -34,7 +34,8 @@ out_formats = { with open(path_makefile_gen, 'w') as makefile: targets_list = list() # makefile: skeleton rules - makefile.write(".PHONY: all clean stickers/\n") + makefile.write(".PHONY: all default clean stickers/\n") + makefile.write("default: all\n") makefile.write('stickers:\n\tmkdir stickers\n') makefile.write('clean:\n\trm -vrf stickers\n') for sticker_description_file in path_stickers_data_dir.glob('*.yaml'): @@ -43,19 +44,19 @@ with open(path_makefile_gen, 'w') as makefile: sticker_description = safe_load(yaml_file) log.debug("stuff %s", sticker_description) target_filename = path_stickers_output_dir \ - / ( sticker_description['name'] \ - + '.' \ - + out_formats[output_ext]['extension'] ) + / ( sticker_description['name'] \ + + '.' \ + + out_formats[output_ext]['extension'] ) + prerequisite_filename=f"{sticker_description_file} " if sticker_description['input']['base'].get('format','') \ - not in ('lavfi', 'image2'): - prerequisite_filename = str(path_stickers_source_dir \ - / sticker_description['input']['base']['input']) - else: - prerequisite_filename = '' + not in ('lavfi', 'image2'): + prerequisite_filename += str( + path_stickers_source_dir \ + / sticker_description['input']['base']['input'] + ).replace(' ', '\\ ') targets_list.append(f"{target_filename}") # makefile: rule declaration - escaped_prereq = prerequisite_filename.replace(' ', '\\ ') - makefile.write(f"{target_filename}: {escaped_prereq} | stickers\n") + makefile.write(f"{target_filename}: {prerequisite_filename} | stickers\n") # makefile: recipe ffmpeg base makefile.write('\tffmpeg ') # makefile: specify format if present