How to feed rule with files from two lists?

Hi,

Is it possible to make the Makefile read directory and parse it in pairs? So what i have a list of files in ./mydir/ that have an infix _A1_ and _A2_. What I would like to do is to read the content of mydir and paste files in a pairwise manner in parallel so that i have multople paste commands that execute:

paste My_A1_001.txt My_A2_001.txt > My_001.txt
paste My_A1_002.txt My_A2_002.txt > My_002.txt
paste My_A1_003.txt My_A2_003.txt > My_003.txt
...

So each in its own thread …

my attempt:

L1= $(wildcard *_A1_*)
L2= $(wildcard *_A2_*)


%.paste: %.$(L1) %.$(L2)
        (paste ....have no clue what to do here... )

Is this even possible with makefiles ?

Thank you

I have no idea either, but maybe ask this question somewhere else as this doesn’t have to do with ROOT.

1 Like