c++ Makefile demo

there are three files: T.h , T.cpp and main.cpp .I wanna get a executive file named demo,I can vi this Makefile as follows:

 

  1. demo:main.o T.o
  2.         g++ *.o -o demo
  3. T.o:T.h T.cpp
  4.         g++ -c T.cpp
  5. main.o:main.cpp
  6.         g++ -c main.cpp
  7. #T.o:T.h T.cpp
  8. #       g++ -c T.cpp
  9. clean:
  10.         rm -f *.o

 

posted @ 2011-06-23 11:32  Podevor  阅读(183)  评论(0编辑  收藏  举报