From 51c29273f3fbfc0f9aff308ca0ade6f7a4295919 Mon Sep 17 00:00:00 2001 From: lzy Date: Sat, 13 Apr 2024 18:12:27 +0800 Subject: [PATCH] =?UTF-8?q?=E7=AC=AC=E5=8D=81=E7=AB=A0=E5=AE=8C=E7=BB=93?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Chapter10/Makefile.md | 11 +++++++++++ Chapter10/testmake/main.c | 13 +++++++++++++ Chapter10/testmake/tool1.c | 9 +++++++++ Chapter10/testmake/tool1.h | 6 ++++++ Chapter10/testmake/tool2.c | 9 +++++++++ Chapter10/testmake/tool2.h | 6 ++++++ 6 files changed, 54 insertions(+) create mode 100644 Chapter10/Makefile.md create mode 100644 Chapter10/testmake/main.c create mode 100644 Chapter10/testmake/tool1.c create mode 100644 Chapter10/testmake/tool1.h create mode 100644 Chapter10/testmake/tool2.c create mode 100644 Chapter10/testmake/tool2.h diff --git a/Chapter10/Makefile.md b/Chapter10/Makefile.md new file mode 100644 index 0000000..c599b5b --- /dev/null +++ b/Chapter10/Makefile.md @@ -0,0 +1,11 @@ +# Makefile + +## makefile与Makefile的区别 + +`make`会优先使用`makefile`,发布的项目一般是一个`Makefile`,方便用户写自己的`makefile`。 + + + +## 参考资料 + +[跟我一起写Makefile — 跟我一起写Makefile 1.0 文档 (seisman.github.io)]( \ No newline at end of file diff --git a/Chapter10/testmake/main.c b/Chapter10/testmake/main.c new file mode 100644 index 0000000..70cad75 --- /dev/null +++ b/Chapter10/testmake/main.c @@ -0,0 +1,13 @@ +#include +#include + +#include "tool1.h" +#include "tool2.h" + +int main() +{ + mytool1(); + mytool2(); + + return 0; +} \ No newline at end of file diff --git a/Chapter10/testmake/tool1.c b/Chapter10/testmake/tool1.c new file mode 100644 index 0000000..7da54bb --- /dev/null +++ b/Chapter10/testmake/tool1.c @@ -0,0 +1,9 @@ +#include +#include + +#include "tool1.h" + +void mytool1(void) +{ + printf("tool1 print\n"); +} \ No newline at end of file diff --git a/Chapter10/testmake/tool1.h b/Chapter10/testmake/tool1.h new file mode 100644 index 0000000..dd82f21 --- /dev/null +++ b/Chapter10/testmake/tool1.h @@ -0,0 +1,6 @@ +#ifndef TOOL1_H__ +#define TOOL1_H__ + +void mytool1(void); + +#endif diff --git a/Chapter10/testmake/tool2.c b/Chapter10/testmake/tool2.c new file mode 100644 index 0000000..97ed8a8 --- /dev/null +++ b/Chapter10/testmake/tool2.c @@ -0,0 +1,9 @@ +#include +#include + +#include "tool2.h" + +void mytool2(void) +{ + printf("tool2 print\n"); +} \ No newline at end of file diff --git a/Chapter10/testmake/tool2.h b/Chapter10/testmake/tool2.h new file mode 100644 index 0000000..9b6a908 --- /dev/null +++ b/Chapter10/testmake/tool2.h @@ -0,0 +1,6 @@ +#ifndef TOOL2_H__ +#define TOOL2_H__ + +void mytool2(void); + +#endif