2006/12/25

最简化的GNUMakefile


## GNU Makefile with MinGW/MSYS
## MinGW 下面简化的Makefile 需要 MSYS
## It can be invoked like `mingw32-make hello.exe`
## This will compile the hello.cpp to hello.exe

CXXFLAGS=-I. -O3

## 没有下面这条指令, 后缀通配指令不能识别 .cpp.exe
.SUFFIXES: .exe

.cpp.exe:
g++ -Wall $(CXXFLAGS) -o $@ $<


.PHONY : clean
clean:
rm -f *.exe *.obj *.o

发表评论