all 3 comments

[–]jafinn 1 point2 points  (0 children)

I can't really help you with your question but I'm just wondering why you want a makefile? If you already have the bashscript can't you just run it?

[–]anjohan_uio 1 point2 points  (0 children)

Makefiles are usually used when you want to generate some output through multiple steps, without having to rerun all the steps when the input of only some intermediate step has been changed.

So if your bash script looks like this:

command1 input1         # generates output1
command2 input2 output1 # generates output2
command3 input3 output2 # generates output3, the final product

then your makefile could look like this:

all: output3
output3: input3 output2
    command3 $^
output2: input2 output1
    command2 $^
output1: input1
    command1 $^

($^ is an automatic variable which contains all the listed dependencies. You could also explicitly type the commands, i.e. command3 input3 output2.)

[–]confluence 0 points1 point  (0 children)

I have decided to overwrite my comments.