Posted on 2007-11-26 21:25
蜀山兆孨龘 阅读(441)
评论(0) 编辑 收藏
用 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: |
- PRJ=dist/Release/WinHello.exe
- OBJ=build/Release/WinHello.o build/Release/Resource.o
- CC=gcc
- CFLAGS=-mwindows -s
- RES=windres
- LIB=-lcomctl32
-
- $(PRJ): $(OBJ)
- mkdir -p dist/Release
- $(CC) $(CFLAGS) -o dist/Release/WinHello $(OBJ) $(LIB)
-
- build/Release/WinHello.o: WinHello.c
- mkdir -p build/Release
- $(CC) $(CFLAGS) -c -O4 -o build/Release/WinHello.o WinHello.c
-
- build/Release/Resource.o: Resource.rc
- mkdir -p build/Release
- $(RES) -o build/Release/Resource.o Resource.rc
-
- .PHONY: clean
- clean:
- ${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: |
|