使 LLVM 无法包含 $(LLVM_SRC_ROOT)/Makefile.rules

Making LLVM fails to include $(LLVM_SRC_ROOT)/Makefile.rules

我正在尝试在 Windows 上构建 LLVM,我已经运行 llvm/configure,它运行正确。 The guide I'm following 配置后说我需要用 Make 构建 LLVM。我运行了 Make 命令,但出现以下错误:

Makefile:151: /Makefile.rules: No such file or directory
make: *** No rule to make target '/Makefile.rules'. Stop

Makefile 的第 151 行如下:

include $(LLVM_SRC_ROOT)/Makefile.rules

任何帮助将不胜感激,因为我不熟悉 LLVM 和 Make。谢谢。

您可能想使用cmake 来编译LLVM。只需安装 cmake,创建一个构建目录并从该目录中调用

cmake -G "Visual Studio 11 2012 Win64" path\to\llvm\source\root

这将为 x64 创建 Visual Studio 2012 解决方案。如果您使用不同的 Visual Studio 版本或想使用 nmake,那么您可以在 manual. Also have a look at the LLVM docs 关于使用 cmake 构建 LLVM 中找到其他生成器的列表。