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