That executable probably expects data in its standard input rather than command line arguments: run: The executable doesn't take the input unless I type 100 7 4 again and press enter. Running an executable with input using makefile all: runīTW, I presume you already have some rules for building prog1 in your Makefile, and hence have not included it in the above shown Makefile.Īn alternative would be to just invoke make explicitly with the run target, i.e. If you make run a pre-requisite for all and mark both all and run as PHONY targets, you should be good to go. By convention all is the name of such a target. If you run make without specifying any targets, it would execute the first target it finds within the Makefile.
0 Comments
Leave a Reply. |