杨东:yangdong101@gmail.com
1. 什么是Bakefile?
引用http://www.bakefile.org的一段介绍:
Bakefile is cross-platform, cross-compiler native makefiles generator. It takes compiler-independent description of build tasks as input and generates native makefile (autoconf's Makefile.in, Visual C++ project, bcc makefile etc.).
许多项目都在使用这个跨平台跨编译器的本地makefile生成器,例如wxWidgets。
2. 安装
下载最新版本bakefile-0.2.5-setup.exe,安装目录追加到PATH环境变量中,检查如下:
3. 用法示例
hello.c程序:
hello.bkl脚本文件:
我的编译环境是VC++2005Express,所以我将用上面这个bkl文件生成nmake的makefile,如下:
生成了makefile.vc,然后:
这样就成功生成hello.exe:
4. 一个小问题
在做clean时,无法删除对应的hello.exe.manifest,可能是Bakefile项目没有及时跟进VC编译器的发展。不过稍微改一下bkl文件就可以解决这个小问题:
再重新生成makefile.vc就可以了。
1. 什么是Bakefile?
引用http://www.bakefile.org的一段介绍:
Bakefile is cross-platform, cross-compiler native makefiles generator. It takes compiler-independent description of build tasks as input and generates native makefile (autoconf's Makefile.in, Visual C++ project, bcc makefile etc.).
许多项目都在使用这个跨平台跨编译器的本地makefile生成器,例如wxWidgets。
2. 安装
下载最新版本bakefile-0.2.5-setup.exe,安装目录追加到PATH环境变量中,检查如下:

3. 用法示例
hello.c程序:
- #include <stdio.h>
- int main()
- {
- printf("Hello, world!/n");
- return 0;
- }
- <?xml version="1.0"?>
- <makefile>
- <exe id="hello">
- <sources>hello.c</sources>
- </exe>
- </makefile>

生成了makefile.vc,然后:

这样就成功生成hello.exe:

4. 一个小问题
在做clean时,无法删除对应的hello.exe.manifest,可能是Bakefile项目没有及时跟进VC编译器的发展。不过稍微改一下bkl文件就可以解决这个小问题:
- <?xml version="1.0"?>
- <makefile>
- <exe id="hello">
- <sources>hello.c</sources>
- <clean-files>*.manifest</clean-files>
- </exe>
- </makefile>
