Make file with command line arguments.

Nov 6, 2013 at 4:38pm
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.
Nov 6, 2013 at 5:16pm
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
Nov 6, 2013 at 5:43pm
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.
Nov 6, 2013 at 6:34pm
1
2
postfix: program.bin
	./program.bin $(test_data)

$ make postfix test_data=data3-1.txt
Last edited on Nov 6, 2013 at 6:34pm
Topic archived. No new replies allowed.