Makefile questions.

Hey guys, just started making makefile and encountered a problem.

I am supposed to read a text file, use them as arguments of another program and run it. I just wonder if makefile can do this.

Let's say, a text called "input", with 3 lines, each line is a argument.

arg1
arg2
arg3

Then, I want to run my main program like this:

a.out arg1 arg2 arg3


Can anybody help me with this please?
Makefiles are not designed to process text files that way. You need another utility, like awk or sed.

To execute a command and get its output in a makefile, use the "shell" command:

 
$(shell myprog arg1 arg2 arg3)

Does this answer your question?
$ ./program.bin $(cat args)
if there are no spaces in the arguments.
Hey, guys, can I ask like this question ; SUPPOSE that I have wrot in a text file data value.
First I must open this text file, (ofstream) use the data in a program and the results must be present in other output file.
I tread to do this, but doesn't function.
Can anybody help me?
Thank you in advance.
Topic archived. No new replies allowed.