![make V=s 中的 make[number] 是什麼意思?](https://rvso.com/image/38799/make%20V%3Ds%20%E4%B8%AD%E7%9A%84%20make%5Bnumber%5D%20%E6%98%AF%E4%BB%80%E9%BA%BC%E6%84%8F%E6%80%9D%EF%BC%9F.png)
當我能夠make V=s
讀取make
.我總是make[numer]
在日誌中看到。
例如:
datle@debian:~/workspace/cpx/trunk$ make
rm -rf openwrt/tmp
cp config/defaut.config openwrt/.config
cd openwrt && make
make[1]: Entering directory `/home/datle/workspace/cpx/trunk/openwrt'
make[1]: Leaving directory `/home/datle/workspace/cpx/trunk/openwrt'
make[1]: Entering directory `/home/datle/workspace/cpx/trunk/openwrt'
make[2]: Entering directory `/home/datle/workspace/cpx/trunk/openwrt'
Collecting package info: done
Collecting target info: done
Checking 'working-make'... ok.
Checking 'case-sensitive-fs'... ok.
Checking 'getopt'... ok.
Checking 'fileutils'... ok.
Checking 'working-gcc'... ok.
Checking 'working-g++'... ok.
Checking 'ncurses'... ok.
Checking 'zlib'... ok.
Checking 'gawk'... ok.
Checking 'unzip'... ok.
Checking 'bzip2'... ok.
Checking 'patch'... ok.
Checking 'perl'... ok.
Checking 'python'... ok.
Checking 'wget'... ok.
Checking 'git'... ok.
Checking 'gnutar'... ok.
Checking 'svn'... ok.
Checking 'gnu-find'... ok.
Checking 'getopt-extended'... ok.
Checking 'non-root'... ok.
make[3]: Entering directory `/home/datle/workspace/cpx/trunk/openwrt'
Checking 'openssl'... ok.
make[3]: Leaving directory `/home/datle/workspace/cpx/trunk/openwrt'
make[2]: Leaving directory `/home/datle/workspace/cpx/trunk/openwrt'
WARNING: your configuration is out of sync. Please run make menuconfig, oldconfig or defconfig!
make[2] world
make[3] target/compile
make[4] -C target/linux compile
make[3] package/cleanup
make[3] package/compile
make[4] -C package/toolchain compile
make[4] -C package/wireless-tools compile
我讀了製作手冊但我沒有找到任何關於此的細節。
答案1
這些數字代表 for makelevel
,這讓我們知道 sub-make 與頂層的關係如何make
。
這是make的遞歸使用,看更多詳情這裡。
深入研究make
原始碼,你可以看到更清晰的東西。
在main.c
:
/* Value of the MAKELEVEL variable at startup (or 0). */
unsigned int makelevel;
進而:
/* Figure out the level of recursion. */
{
struct variable *v = lookup_variable (STRING_SIZE_TUPLE (MAKELEVEL_NAME));
if (v && v->value[0] != '\0' && v->value[0] != '-')
makelevel = (unsigned int) atoi (v->value);
else
makelevel = 0;
}
在output.c
:
/* Use entire sentences to give the translators a fighting chance. */
if (makelevel == 0)
if (starting_directory == 0)
if (entering)
fmt = _("%s: Entering an unknown directory\n");
else
fmt = _("%s: Leaving an unknown directory\n");
else
if (entering)
fmt = _("%s: Entering directory '%s'\n");
else
fmt = _("%s: Leaving directory '%s'\n");
else
並在列印前格式化輸出:
if (makelevel == 0)
if (starting_directory == 0)
sprintf (p, fmt , program);
else
sprintf (p, fmt, program, starting_directory);
else if (starting_directory == 0)
sprintf (p, fmt, program, makelevel);
else
sprintf (p, fmt, program, makelevel, starting_directory);
_outputs (NULL, 0, buf);
筆記
- 來源製作