makefile 调用其他makefile文件
2008-04-22 08:31
441 查看
.
|-- Makefile
|-- test1
| |-- Makefile
| |-- bin
| | `-- test
| |-- hello.o
| |-- include
| | `-- hello.h
| `-- src
| `-- hello.c
`-- test2
|-- Makefile
|-- bin
| `-- test
|-- hello.o
|-- include
| `-- hello.h
|-- obj
`-- src
`-- hello.c
根目录下的Makefile文件调用test2中的Makefile文件:
根目录下的Makefile文件
SUBDIR = ./test2
MAKE = make
subsystem:
cd $(SUBDIR) && $(MAKE)
test2中的Makefile文件:
all: ./bin/test
CC = gcc
INCLUDE = ./include
vpath %.c ./src
vpath %.h ./include
./bin/test: hello.o
$(CC) -o $@ $^
hello.o: hello.c hello.h
$(CC) -c $< -I$(INCLUDE)
.PHONY: clean
clean:
-rm *.o
|-- Makefile
|-- test1
| |-- Makefile
| |-- bin
| | `-- test
| |-- hello.o
| |-- include
| | `-- hello.h
| `-- src
| `-- hello.c
`-- test2
|-- Makefile
|-- bin
| `-- test
|-- hello.o
|-- include
| `-- hello.h
|-- obj
`-- src
`-- hello.c
根目录下的Makefile文件调用test2中的Makefile文件:
根目录下的Makefile文件
SUBDIR = ./test2
MAKE = make
subsystem:
cd $(SUBDIR) && $(MAKE)
test2中的Makefile文件:
all: ./bin/test
CC = gcc
INCLUDE = ./include
vpath %.c ./src
vpath %.h ./include
./bin/test: hello.o
$(CC) -o $@ $^
hello.o: hello.c hello.h
$(CC) -c $< -I$(INCLUDE)
.PHONY: clean
clean:
-rm *.o
相关文章推荐
- makefile 调用其他makefile文件
- makefile 和shell文件相互调用
- C语言中怎样调用其他文件定义的结构体
- makefile 和shell文件相互调用
- 如何在其他文件中调用结构体变量
- OC多文件开发简单例子实现(重点:self在对象方法中调用其他对象方法的3种方法)
- C++ 调用其他文件的变量或函数
- Pixhawk_Ardupilot_Makefile文件调用关系
- makefile 和shell文件相互调用
- linux命令之---chmod命令用于文件调用权限分配:文件拥有者、群组、其他
- Linux makefile 和shell文件相互调用实例详解
- 【python】如何在某.py文件中调用其他.py内的函数
- 【python】如何在某.py文件中调用其他.py内的函数
- 注意啊!在cmd/bat文件如果要调用其他cmd/bat文件,一定要用call关键字啊!
- VC++6.0 中主函数调用其他文件函数的工程建立方法
- Makefile中如何调用python和perl文件为自己提供需要的数据
- python文件中的__name__=='__main__'的使用及调用其他py文件中的函数方法
- Java中调用本地的其他文件。运行,命令窗口
- C++程序中调用其他exe可执行文件方法
- VC下如何调用控制台命令以及其他可执行文件