繁体   English   中英

Makefile 创建子目录 Makefile

[英]Makefile creation for subdirectories Makefile

我是Makefile的新手,我必须为我的项目创建一个Makefile

project
├── Makefile
|
├── application
│   |── code1
│   |   ├── header-->header1.h(Inside the header1 folder)
│   |   |── source-->main1.c(Inside the source1 folder)
|   |   ├── doc-->Makefile
|   |
|   |── code2
|   |   ├── header-->header2.h(Inside the header2 folder)
|   |   |── source-->main2.c(Inside the source2 folder)
|   |   ├── doc-->Makefile

For this project , how can I write the Makefile for inside the code1 & code2 and the overall one Makefile How to create the overall Makefile to run the subdirectories Makefile

像这样的东西?

.PHONY: all
all: application/code1/exe1 application/code2/exe2

application/code1/exe1: application/code1/source/main1.c application/code1/header/header1.c

application/code2/exe2: application/code2/source/main2.c application/code2/header/header2.c

application/级别增加了这里的痛苦; 也许你应该删除它。 或者,可以将Makefile放入application并删除上面的顶级目录。

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM