Make file with command line arguments.

I have to run a program by the command "make postfix".
The program also needs a command line argument which would be a file "data3-1.txt"
I am confused on how to run the make command with the argument. I have tried looking it up but that is not helping. Thank you in advance.
1
2
3
4
5
6
#phony if we don't pretend to create a file with it
.PHONY: postfix

#creating a rule
postfix: program.bin data3-1.txt
	./program.bin data3-1.txt
i was looking more to now change the makefile itself.

like
$bash : make postfix (somehow put argument in)

I was looking online and they said somthing like
make argument abd ="abd"
$(abd)

Which did not make sense to me.
1
2
postfix: program.bin
	./program.bin $(test_data)

$ make postfix test_data=data3-1.txt
Last edited on
Topic archived. No new replies allowed.