多文件多目录的Makefile文件编写
来源:互联网 发布:js函数有返回值吗 编辑:程序博客网 时间:2024/05/22 03:39
文件目录为:
stu_sys
|-- Makefile
|-- include
| |-- other
| | `-- other.h
| |-- student
| | `-- student.h
| |-- student_public.h
| `-- teacher
| `-- teacher.h
|-- src
| |-- Makefile
| |-- lib
| | |-- Makefile
| | |-- other
| | | `-- other.c
| | |-- student
| | | |-- Makefile
| | | `-- student.c
| | `-- teacher
| | `-- teacher.c
| `-- scli
| |-- Makefile
| |-- other
| | |-- Makefile
| | |-- other
| | |-- other.c
| | `-- other.db
| |-- student
| | |-- Makefile
| | |-- student
| | |-- student.c
| | `-- student.db
| `-- teacher
| |-- Makefile
| |-- teacher
| |-- teacher.c
| `-- teacher.db
`-- target
|-- other
| `-- other
|-- student
| `-- student
`-- teacher
`-- teacher
stu_sys目录中的Makefile文件编写为:
STUDENT = /root/xiangm/stu_sys/src/scli/student/student
TEACHER = /root/xiangm/stu_sys/src/scli/teacher/teacher
OTHER = /root/xiangm/stu_sys/src/scli/other/other
STALLS = /root/xiangm/stu_sys/target/student/
STALLT = /root/xiangm/stu_sys/target/teacher/
STALLO = /root/xiangm/stu_sys/target/other/
ALL:
make -C src
install:
cp $(STUDENT) $(STALLS)
cp $(TEACHER) $(STALLT)
cp $(OTHER) $(STALLO)
~
-----------------------------------------------------------------------------------------------------------------------------------
src目录中的Makefile文件编写为:
SUBDIRS = lib scli
SRC:
make -C scli
~
-----------------------------------------------------------------------------------------------------------------------------------
lib文件目录中的Makefile编写为:
SUBDIRS = student teacher other
release:
for I in $(SUBDIRS); do /
make -C $$I; /
done
~----------------------------------------------------------------------------------------------------------------------------
scli 目录中的Makefile文件编写为:
SUBDIRS = student teacher other
SCLI:
for I in ${SUBDIRS}; do /
make -C $$I || exit 1;/
done
~
-----------------------------------------------------------------------------------------------------------------------------
student目录下编写的Makefile文件为:
STUDENTC = /root/xiangm/stu_sys/src/lib/student/student.c
STUDENTH = /root/xiangm/stu_sys/include/
STUDENTH1 = /root/xiangm/stu_sys/include/student
STUDENT:
gcc -o student student.c ${STUDENTC} -I ${STUDENTH} -I ${STUDENTH1}
--------------------------------------------------------------------------------------------------------------------------------
teacher目录下变编写的Makefile文件为:
TEACHERC = /root/xiangm/stu_sys/src/lib/teacher/teacher.c
TEACHERH = /root/xiangm/stu_sys/include/
TEACHERH1 = /root/xiangm/stu_sys/include/teacher
TEACHER:
gcc -o teacher teacher.c ${TEACHERC} -I ${TEACHERH} -I ${TEACHERH1}
-------------------------------------------------------------------------------------------------------------------------------
OTHERC = /root/xiangm/stu_sys/src/lib/other/other.c
OTHERH = /root/xiangm/stu_sys/include
OTHERH1 = /root/xiangm/stu_sys/include/other
OTHER:
gcc -o other other.c ${OTHERC} -I ${OTHERH} -I ${OTHERH1}
转自 http://hi.baidu.com/wangsenlin88/blog/item/95dcb2dcf01a26d68c10293e.html
- 多文件多目录 Makefile文件编写
- 多文件多目录的Makefile文件编写
- 多文件及多目录下MakeFile文件的编写
- 多目录下多文件 makefile编写
- 单目录下多文件 makefile编写
- 多文件、多目录的Makefile的编写
- 多层目录编译的makefile文件编写
- OpenCV 多文件编译的Makefile编写
- makefile 多文件,多目录的实现
- 多文件目录Makefile的写法
- 编写多文件,多目录makefile(借鉴网上的一篇文章来自己练手)
- 【Linux】多文件标准工程目录的Makefile编写及通用模板
- makefile多文件如何编写
- makefile多目录多文件
- Makefile文件的编写
- makefile文件的编写
- Makefile文件的编写
- makefile文件的编写
- iPhone程序中将内容分享到新浪微博
- SSH框架数据库连接信息和保存进数据库的某些特殊字段加密(jasypt)
- IMF选战背后的“潜规则”
- 热火最后一节太给力
- 关于SilverLight webPart 在SharePoint调试问题。
- 多文件多目录的Makefile文件编写
- 关于SCI、SSCI、EI、ASPT来源刊、CJFD收录期刊
- Oracle 误删数据库表空间文件后的恢复
- 欧拉回路,poj 1041
- 拷贝构造函数总结
- 生活如此··
- zthread学习 实例九 任务终止(二)——中断方式
- Android帮助文档翻译——开发指南(三)任务和Back Stack
- 其它