fix automatic makefile regeneration
This commit is contained in:
parent
41e930c5c5
commit
e631373f40
15
make.py
Normal file → Executable file
15
make.py
Normal file → Executable file
@ -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'):
|
||||
@ -46,16 +47,16 @@ with open(path_makefile_gen, 'w') as makefile:
|
||||
/ ( 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 = ''
|
||||
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
|
||||
|
Loading…
Reference in New Issue
Block a user