Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

makefile question?

29 views
Skip to first unread message

Tom

unread,
Nov 12, 2012, 3:23:53 PM11/12/12
to
Greetings,

I have a make commandline like so:

make FVEND=altera FOO=1 BAR="FOO BAR"

In the default target I would like to simply echo out the command line
argumnets passed to make:

@echo "Command line Arguments are: ???"

but unfortunately I can't find the make equvilant or $ARGV[0] or
$*. IS there any way to do this in make?

Thanks for any help in advance!

Tom

Aaron W. Hsu

unread,
Nov 12, 2012, 11:05:32 PM11/12/12
to
Tom <zi...@yahoo.com> writes:

> I have a make commandline like so:
>
> make FVEND=altera FOO=1 BAR="FOO BAR"
>
> In the default target I would like to simply echo out the command line
> argumnets passed to make:
>
> @echo "Command line Arguments are: ???"
>
> but unfortunately I can't find the make equvilant or $ARGV[0] or
> $*. IS there any way to do this in make?

I have a feeling that you are trying to use make incorrectly.
Generally speaking, you don't pass "command line arguments" to
make(1); instead, you can alter make variables on the command line,
which is something different. What you have above is a set of
three variables that you set on the command line of the invocation
of make(1), if you want to print them, you just use their
names, which are ${FVEND}, ${FOO}, and ${BAR}, respectively.

Could you explain why you want some sort of ARGV? Perhaps an
explanation of your goal would help suggest a solution.

--
Aaron W. Hsu | arc...@sacrideo.us | http://www.sacrideo.us
Programming is just another word for the lost art of thinking.

Dave Gibson

unread,
Nov 13, 2012, 6:34:26 AM11/13/12
to
Tom <zi...@yahoo.com> wrote:
> Greetings,
>
> I have a make commandline like so:
>
> make FVEND=altera FOO=1 BAR="FOO BAR"
>
> In the default target I would like to simply echo out the command line
> argumnets passed to make:
>
> @echo "Command line Arguments are: ???"
>
> but unfortunately I can't find the make equvilant or $ARGV[0] or
> $*. IS there any way to do this in make?

Try $(MAKEFLAGS).

Tom

unread,
Nov 13, 2012, 7:06:53 AM11/13/12
to
On Tuesday, November 13, 2012 6:37:19 AM UTC-5, Dave Gibson wrote:

> Try $(MAKEFLAGS).

Thanks Dave! that was it.

To let everyone know the why. I'm intergrating my build environment into
Electric Commander (a Continuous Integration Tool) with Platform LSF. I'm having a problem passing all of the variable into make (some quotes need to be escaped) and need to know what make is seeing for a command line. The $(MAKEFLAGS) gets what's on the command line.

Thanks Again!
Tom
0 new messages