当前位置:网站首页>Black cat takes you to learn Makefile Part 11: When the header file a.h changes, how to recompile all the .c files that depend on the header file a.h

Black cat takes you to learn Makefile Part 11: When the header file a.h changes, how to recompile all the .c files that depend on the header file a.h

2022-08-10 22:00:00 Senior black cat

This article is compiled/written based on personal work/study experience and online materials. Paid content is prohibited from being reproduced.
The column where this article is located "Black cat takes you to learn Makefile"

Steps:
(1) Use the gcc -MM command to list the dependencies
(2) Put the dependencies in a custom file
(3) Use sinclude/-include/includeExpand dependencies of custom files

Example:

%.d: %.c$(CC) -MM $< > [email protected] $(SRCS:.c=
原网站

版权声明
本文为[Senior black cat]所创,转载请带上原文链接,感谢
https://yzsam.com/2022/222/202208102109577325.html