小编Ala*_*anT的帖子

重用 makefile 规则

我正在学习 makefile,并试图找出如何重用规则。现在我有以下内容:

CPP = cl

CPPFLAGS = /Od /D "WIN32" /D "_CONSOLE" /D "_UNICODE" /D "UNICODE" /Gm /EHsc /RTC1 /MDd /Fo"Debug\\" /Fd"Debug\vc90.pdb" /W3 /nologo /c /ZI /TP /errorReport:prompt

.SUFFIXES: .exe .cpp

Exercise35.exe:
    $(CPP) Exercise35.cpp $(CPPFLAGS)

debug:
    $(CPP) Exercise35.cpp $(CPPFLAGS) /D "_DEBUG"
Run Code Online (Sandbox Code Playgroud)

该规则本质上是使用额外的命令行参数debug重复该规则,这似乎很糟糕。Exercise35有没有更好的办法?

nmake makefile

6
推荐指数
1
解决办法
3689
查看次数

标签 统计

makefile ×1

nmake ×1