I'm trying to figure out how to run a program with inputs from the command line using a makefile.
For example, let's say I have a program foo that takes in two integers and adds them and returns the result. In the make file when I type in make test for example it'll go into my makefile and it'd look like this
test: ./foo 1 1 ./foo 2 2 and so on, but when I'm trying to do it it doesn't run. Is there something I am missing?
makecommand, are you in the directory wherefoois? What if you use an absolute path to the program? Oh, and what error(s) do you get?$PWD/project/program/fooexists (and has the x-bit set)? BTW, the error complains aboutproject/program/foo, but you have in your makefile. Maybe you are looking at the wrong place for the error. In any case, I would put als -las the first command below the test target in your makefile. Also, in casefoohappens to be a shell script, I would call it with-x. Maybe this foo does run, but then tries to execute a different foo in another directory, which causes the error.