我的造文件有这样一行的线
CFLAGS = -c -g -D OPT1 -D OPT2
我想通过这样的命令行来通过这些争论
make ARG1= OPT1 ARG2 =OPT2
如果我不通过命令行通过这些参数, 我要使用文件来使用在文件文件中定义的默认值。 我该怎么做?
我的造文件有这样一行的线
CFLAGS = -c -g -D OPT1 -D OPT2
我想通过这样的命令行来通过这些争论
make ARG1= OPT1 ARG2 =OPT2
如果我不通过命令行通过这些参数, 我要使用文件来使用在文件文件中定义的默认值。 我该怎么做?
只是做这样的事情 在文件:
OPT1 = MY_OPT_1 # defaults
OPT2 = MY_OPT_2
CFLAGS = -c -g -D $(OPT1) -D $(OPT2)
然后在命令线上:
$ make -e OPT1=SOME_OTHER_OPT1 OPT2=SOME_OTHER_OPT2
在命令行指定 OPT1
和/或 OPT2
的 flues时,这些功能将超越 makefile 中的默认值。
请注意,您可能希望大多数情况下都使用 -e
选项,使用 make
来强制重新构建所有新 OPT1
, OPT2
。
另一种方式是使用 ? {{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{> 指派运算运算符}}。只有在没有在运行时定义该值时,它才指定该值。
OPT1?=opt1_default
OPT2?=opt2_default
你们在召唤的时候,
make OPT1=a OPT2=b
# OR
make # to use default values
"https://www.gnu.org/ software/ make/manual/html_node/Setting.html" rel="没有跟随 noreferrer"> more info
I m trying to add my file in Visual Studio as command line parameters. I know my code works since when I use fopen("whole path here", "r"), it runs. I then add the file as a command line parameter ...
I ve written a command line utility that uses getopt for parsing arguments given on the command line. I would also like to have a filename be an optional argument, such as it is in other utilities ...
I m generating a large XML document via a Perl script in a command window, however, currently it s printing the document to standard out. The Perl script modifiers do not have a switch to allow to ...
I am trying to retrieve the environment variable to detect whether the system is 32 or 64 bit. But on 64 bit server the environment variable %processor_architecture% is returning x86 instead of AMD64. ...
I am trying to run an analysis by invoking R through the command line as follows: R --no-save < SampleProgram.R > SampleProgram.opt For example, consider the simple R program below: mydata =...
This code will read a line from a text file: set file = CreateObject("Scripting.FileSystemObject").OpenTextFile("c: umber.txt", 1) text = file.ReadLine MsgBox text How can I make it read repeatedly ...
I have a batch script that takes arguments from the command line. One of the arguments has a * in it. In spite of putting the argument in quotes, the * gets expanded before the argument gets used in ...
How can I create an empty file at the DOS/Windows command-line? I tried: copy nul > file.txt But it always displays that a file was copied. Is there another method in the standard cmd? It should ...