I am converting .sup files to .ass files using the following recipes:

%.idx %.sub: %.sup
    bdsup2subpp --language en -o $*.sub $<

%.srt: %.sub
    vobsub2srt $*

%.ass: %.srt
    ffmpeg -hide_banner -y -nostdin -i $< $@

Make will delete all the intermediate .sub and .srt files, but it does not seem to notice the .idx files. Adding the %.idx dependency to the vobsub2srt recipe will cause it to delete either the .idx or .sub files depending on which came first, but never both.

Is there a way to get make to recognise that both intermediates were generated from this single pattern rule, and thus delete them once everything is made?

1 Answer 1


I don't know if this is the best way, but

%.idx: %sup
  bdsup2subpp --language en -o $*.sub $<

%.sub: %.idx

It has some problems. It may not try to generate the %.sub, I originally had it the other way around

%.sub: %sup
  bdsup2subpp --language en -o $@ $<

%.idx: %.sub

But realised that it would not trigger the 2nd rule.

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .