Afficher un message
Vieux 19/10/2007, 12h48   #1
Dave Programmer
Aucun Avatar
 
Messages: n/a
Hébergeur:
Par défaut make: are command line variables stored in a macro?

In a Makefile, I have something like the following:

# makefile start

X = "default_x"
Y = "default_y"

targA:
dosomething -x $(X) -y $(Y)

targB:
$(MAKE) targA X=newX

#makefile end

I'd like to be able to have the option to specify another value of Y
on the command line when making targB and have that passed correctly
to "dosomething"

make targB Y=new_Y

In fact, in my real makefile, I have several such variables I'd like
to be able to modify on the command line. The only way I've been able
to come up with to do this is to modify targB so

targB:
$(MAKE) targA X=newX Y=$(Y)

but this gets unwieldy for several variables. Is there a better way to
do this? Is there a Make macro in which command line variables/macros
are stored?

  Réponse avec citation
 
Page generated in 0,04811 seconds with 9 queries