使用:make (生成目标文件)
make clean(清理中间文件)
# target hello.exe OBJS = hello.o # a macro CC = g++ # the compiler DEBUG = -g CFLAG = -Wall -c $(DEBUG) # compile to .obj LFLAG = -Wall $(DEBUG) # link to .exe hello.exe : $(OBJS) $(CC) $(LFLAG) $(OBJS) -o hello.exe hello.o : hello.cpp $(CC) $(CFLAG) hello.cpp clean : del *.o