string - Build Command in build setting in Eclipse C/C++ -
in cdt eclipse, have project own makefile. in properties of project, add configuration. use c/c++ build-> build variable give makefile variable.
for example in build variable, declare:
name type value _foo string x232 _plop string list blue || red
after that, write in c/c++ build-> build command::
make -f pathofmymakefile foo={_foo} plop={_plop}
the make command is: make -f pathofmymakefile foo=x232 plop=blue red
the makefile doesn't understand red(it's normal..). list of variable . know if possible give string list makefile. add variable in list.
thanks lot.
as make concerned, setting multi-word value done in same manner single-word value.
as matter of fact, in exact same category of variables, no matter if value contains space (2 words or more), or none (one word).
you can set values make variables, in 1 of following three:
1. environment 2. makefile 3. command-line
in example, values set command-line, long variable , value in one argument, of value, including spaces within value, set value of variable.
usually, in unix-shell, done sort of quoting.
for example, given makefile, like:
all:: : $(foo)
here run make, different command-line assignment foo
:
# one-word value $ make foo=a : # multi-word value $ make foo='a b' : b # multi-word value $ make foo="a b" : b # multi-word value $ make foo=a\ b : b
as can see, same.
as shell removes quoting, , passed - make - single argument is: "foo= b", make parse single assignment, i.e.: foo variable name, , a b value.
but, compare following:
# try multi-word assignment in command-line, without quoting $ make foo=a b make: *** no rule make target 'b'. stop.
this is, because unix-shell, force new argument after white-space, make see following arguments:
argumnet 0: make argumnet 1: foo=a argumnet 2: b
now, argument 1 variable assignment, one-word value. 2nd argumnet b, not variable assignment, doesn't contain equal ('=') sign, , therefore treated non-option argumnet (i.e. argument without '-' or '--' prefix), , therefore taken explicit 'default goal', overriding implicit 'all' target in our makefile.
Comments
Post a Comment