fix automatic makefile regeneration
This commit is contained in:
parent
41e930c5c5
commit
e631373f40
23
make.py
Normal file → Executable file
23
make.py
Normal file → Executable file
@ -34,7 +34,8 @@ out_formats = {
|
|||||||
with open(path_makefile_gen, 'w') as makefile:
|
with open(path_makefile_gen, 'w') as makefile:
|
||||||
targets_list = list()
|
targets_list = list()
|
||||||
# makefile: skeleton rules
|
# 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('stickers:\n\tmkdir stickers\n')
|
||||||
makefile.write('clean:\n\trm -vrf stickers\n')
|
makefile.write('clean:\n\trm -vrf stickers\n')
|
||||||
for sticker_description_file in path_stickers_data_dir.glob('*.yaml'):
|
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)
|
sticker_description = safe_load(yaml_file)
|
||||||
log.debug("stuff %s", sticker_description)
|
log.debug("stuff %s", sticker_description)
|
||||||
target_filename = path_stickers_output_dir \
|
target_filename = path_stickers_output_dir \
|
||||||
/ ( sticker_description['name'] \
|
/ ( sticker_description['name'] \
|
||||||
+ '.' \
|
+ '.' \
|
||||||
+ out_formats[output_ext]['extension'] )
|
+ out_formats[output_ext]['extension'] )
|
||||||
|
prerequisite_filename=f"{sticker_description_file} "
|
||||||
if sticker_description['input']['base'].get('format','') \
|
if sticker_description['input']['base'].get('format','') \
|
||||||
not in ('lavfi', 'image2'):
|
not in ('lavfi', 'image2'):
|
||||||
prerequisite_filename = str(path_stickers_source_dir \
|
prerequisite_filename += str(
|
||||||
/ sticker_description['input']['base']['input'])
|
path_stickers_source_dir \
|
||||||
else:
|
/ sticker_description['input']['base']['input']
|
||||||
prerequisite_filename = ''
|
).replace(' ', '\\ ')
|
||||||
targets_list.append(f"{target_filename}")
|
targets_list.append(f"{target_filename}")
|
||||||
# makefile: rule declaration
|
# makefile: rule declaration
|
||||||
escaped_prereq = prerequisite_filename.replace(' ', '\\ ')
|
makefile.write(f"{target_filename}: {prerequisite_filename} | stickers\n")
|
||||||
makefile.write(f"{target_filename}: {escaped_prereq} | stickers\n")
|
|
||||||
# makefile: recipe ffmpeg base
|
# makefile: recipe ffmpeg base
|
||||||
makefile.write('\tffmpeg ')
|
makefile.write('\tffmpeg ')
|
||||||
# makefile: specify format if present
|
# makefile: specify format if present
|
||||||
|
Loading…
Reference in New Issue
Block a user