this is my second makefile for my Cpp project!
It's designed for multi folders!
It's direction:
warrior@warrior-ThinkPad:~/CreazyCode/CPPproject/Mdemo$ tree
.
├── inc
│ ├── demo.h
│ └── main.h
├── log
│ └── info.log
├── makefile
├── obj
├── src
│ ├── demo.cc
│ ├── main.cc
│ └── out.cc
└── tags
The makefile content:
阅读(39) | 评论(0) | 转发(0) |
<script>window._bd_share_config={"common":{"bdSnsKey":{},"bdText":"","bdMini":"2","bdMiniList":false,"bdPic":"","bdStyle":"0","bdSize":"16"},"share":{}};with(document)0[(getElementsByTagName('head')[0]||body).appendChild(createElement('script')).src='http://bdimg.share.baidu.com/static/api/js/share.js?v=89860593.js?cdnversion='+~(-new Date()/36e5)];</script>
It's designed for multi folders!
It's direction:
warrior@warrior-ThinkPad:~/CreazyCode/CPPproject/Mdemo$ tree
.
├── inc
│ ├── demo.h
│ └── main.h
├── log
│ └── info.log
├── makefile
├── obj
├── src
│ ├── demo.cc
│ ├── main.cc
│ └── out.cc
└── tags
The makefile content:
点击(此处)折叠或打开
- #makefile demo V2.0
- #author: warrior
- #mail:675979646@qq.com
- #date:2015/5/8
-
- CXX := g++
- CFLAGS := -c -g -W -Wall
- SRCDIR := ./src
- INCDIR := -I./inc -I.
- OBJDIR := ./obj
-
- SOURCES := $(shell ls $(SRCDIR)/*.cc)
- OBJS := $(patsubst %.cc,%.o,$(SOURCES))
- TARGET := target
-
-
- ${TARGET} : ${OBJS}
- ${CXX} -o $@ $^
-
- %.o : %.cc
- $(CXX) ${CFLAGS} -o $@ $< $(INCDIR)
-
-
-
-
- .PHONY : clean
- clean :
- -rm -f $(SRCDIR)/*.o target
相关热门文章
给主人留下些什么吧!~~
评论热议