Command line argument make.

I have to pass an argument when I run make postfix. I am confused on how to do this. And I really need any kind of help. Thank you.

MAKE COMMAND : make postfix
File I want to give : data3-1.txt

Makefile for the make postfix is:
1
2
3
4
5
postfix.o: postfix.cpp ${STRING_DIR}string.hpp stack.hpp 
	${CPP} ${CPP_FLAGS} ${INCLUDE_OPT} -c postfix.cpp

postfix: postfix.o string.o
	${CPP} ${CPP_FLAGS} postfix.o string.o -o postfix


I have tried looking up the answer and the best I got is to change the Makefile,
1
2
postfix: postfix.o string.o
	${CPP} ${CPP_FLAGS} $(argument) postfix.o string.o -o postfi

and then type on the command line something like.
$ : make postfix argument="data3-1.txt"

But I get some errors about .txt not being a regonized format. Do I have it in the wrong place or am I completely wrong?
Thank you.
$ make postfix argument="data3-1.txt"

¿what do you expect to happen when you write that?

With that rule you'll have
$ g++ data3-1.txt postfix.o string.o -o postfi
¿does that make sense to you?
¿what is a *.txt doing in a build command?
Thats why I was wondering if that was right. Which I did not think it was. I am just trying to figure out how to give a command line argument with a make command.
I'll ask again, ¿what do you want to happen?
I figured it out. It was
$: make postfix
$: ./postfix "data3-1.txt"
Thanks for your help though.
Topic archived. No new replies allowed.