如题,不知道mke文件能否支持参数传递?
或者,-ddebug这类参数是如何在mke文件中判断的?
您要传递参数的具体需求是什么?mke文件本身其实是作为bmake程序的一个参数传递的,-ddebug也是bmake的一个参数。您可以通过输入bmake -?获得所有支持的参数如下:
Bentley Systems Make Utility. Version 10.00.00.26, Mar 15 2018 Mon May 23 19:38:04 2022 usage: bmake [<+|->options] filename If no filename is specified, try to use a make file with the same name as the current working directory. - Option is local to current make file + Option is global to all make files a Always build all targets C Print conditional level D Delete targets dTEST=1 Define macro (TEST = 1) fEXT Filter targets (only build files with extension EXT) i Ignore errors l List targets m Missing files are OK n No execution p Print macros q Quiet mode (no salutations) s Silent mode t Touch files v Print macros verbose mode w Stop on warnings I Include (.mki) file path P Always process this makefile x<x.exe> Run executable on error L Log file path X Generate _MakeFilePath using DOS 8.3 Format Environment variables: BMAKE_REDIRECT_STDOUT_STDERR Setting the environment variable to 1 directs bmake to properly combine stdout and stderr for redirection to a file. Unless this option is specified, stdout and stderr will be buffered into different streams A side effect is that CreateProcess() is used instead of system(). The blending of stdout and stderr is temporally disabled if redirection is used within the .mke file BMAKE_CommandTimingLog Contains the full file specification of an optional log file that records commands executed and their duration. This option is useful for generating logs needed to compare build times from multiple runs. The format of the log file is: <sequence_number>,<bmake_nesting_level>,<command_execution_time_in_milliseconds>,<command_exit_status>,<command_string> BMAKE_CommandTimingLogMaxLineLength Specifies the maximum number of characters of <command_string> that are written to the log file. The default length is the first 130l characters. BMAKE_EOE_PARAMS Setting the environment variable to the optional parameters used by the program specified by the "-x" parameter.
比如,实现像VS编译时,debug和release不同输出路径
我们一般都是将最终的DLL直接生成到mdlapps文件夹下的,不分Debug和Release位置。如果调试好后想要发布版本,再次执行一次bmake即可。个人感觉没有什么不方便的,也许是长期使用bmake养成的习惯。
Answer Verified By: Chao Cheng