[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Passing multiple arguments to makefile

From: Henrik Carlqvist
Subject: Re: Passing multiple arguments to makefile
Date: Wed, 08 Dec 2010 15:04:08 -0000
User-agent: Pan/0.14.2 (This is not a psychotic episode. It's a cleansing moment of clarity.)

Duke Normandin <> wrote:
> I want to do the following:
> `make ARGS= "exec_file src_1 src_2 etc"'
> I realize that $(ARGS) will contain _all_ the arguments. I need to
> come up with a way to split out each argument to get to:
> EXEC-FILE = exec_file
> SRCS = src_1 src_2 src_3

Then why not simply do:

make EXEC-FILE=exec_file SRCS="src_1 src_2 src_3"

But if you really want to use your syntax you could also do:

EXEC-FILE= $(word 1, $(ARGS))
SRCS = $(wordlist 2, 999, $(ARGS))
> I'm trying to create a "generic" makefile for a non-C compiler. Is
> this possible? TIA...

Of course it is possible to do other things than compiling C code. Make
simply tries to create files when it finds that some other files are newer.
This creation of files could be done by running a C compiler, but it could
also be done with any other tool of your choice.

regards Henrik
The address in the header is only to prevent spam. My real address is:
hc123(at) Examples of addresses which go to spammers:
root@localhost postmaster@localhost

reply via email to

[Prev in Thread] Current Thread [Next in Thread]