神奇好望角 The Magical Cape of Good Hope

庸人不必自扰,智者何需千虑?
posts - 26, comments - 50, trackbacks - 0, articles - 11
  BlogJava :: 首页 ::  :: 联系 :: 聚合  :: 管理
用 NetBeans 开发一个简单的 Windows XP 程序 - 其三 Developing A simple Windows XP Application with NetBeans - Part 3
  新建一个名为 MyMakefile.mk 的 Makefile,内容如下:     Create a new Makefile named MyMakefile.mk of the following content:
  1. PRJ=dist/Release/WinHello.exe
  2. OBJ=build/Release/WinHello.o build/Release/Resource.o
  3. CC=gcc
  4. CFLAGS=-mwindows -s
  5. RES=windres
  6. LIB=-lcomctl32
  7. $(PRJ): $(OBJ)
  8.     mkdir -p dist/Release
  9.     $(CC) $(CFLAGS) -o dist/Release/WinHello $(OBJ) $(LIB)
  10. build/Release/WinHello.o: WinHello.c
  11.     mkdir -p build/Release
  12.     $(CC) $(CFLAGS) -c -O4 -o build/Release/WinHello.o WinHello.c
  13. build/Release/Resource.o: Resource.rc
  14.     mkdir -p build/Release
  15.     $(RES) -o build/Release/Resource.o Resource.rc
  16. .PHONY: clean
  17. clean:
  18.     ${RM} $(OBJ) $(PRJ)
  注意由于排版问题,制表符被扩展成了空格。把这个 Makefile 添加进项目,在上面右键选择“make”,就能得到如下的预期效果了:     Note that because of typesetting, tabs are expanded to spaces. Add this Makefile to the project, right click and select "make", and the following result is shown as expected:

只有注册用户登录后才能发表评论。


网站导航: