使用 GNU make,人们可以说
make -npf /dev/null
(或在 Windows 上 NUL
)以显示内置规则。其中 -n
表示 --just-print
,-p
表示 --print-data-base
,-f
指定要使用的 make 文件。
我怎样才能用
nmake
达到同样的效果?
当在没有 makefile 的文件夹中输入命令
nmake -p
时,将给出环境变量列表,后跟内置规则列表:
INFERENCE RULES:
.asm.obj::
commands: $(AS) $(AFLAGS) /c $<
.asm.exe:
commands: $(AS) $(AFLAGS) $<
.c.obj::
commands: $(CC) $(CFLAGS) /c $<
.c.exe:
commands: $(CC) $(CFLAGS) $<
.cc.obj::
commands: $(CC) $(CFLAGS) /c $<
.cc.exe:
commands: $(CC) $(CFLAGS) $<
.cpp.obj::
commands: $(CPP) $(CPPFLAGS) /c $<
.cpp.exe:
commands: $(CPP) $(CPPFLAGS) $<
.cxx.obj::
commands: $(CXX) $(CXXFLAGS) /c $<
.cxx.exe:
commands: $(CXX) $(CXXFLAGS) $<
.rc.res:
commands: $(RC) $(RFLAGS) /r $<
.SUFFIXES: .obj .asm .c .cc .cpp .cxx .f .f90 .for .rc
其他开关请参见
nmake /?
,例如 -n
。另请参阅我的答案,了解旧版nmake
文档的一些有用参考。