> For the complete documentation index, see [llms.txt](https://book.bsdcn.org/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://book.bsdcn.org/porters-handbook/di-5-zhang-pei-zhi-makefile/5.1.-zuo-zhe-fa-bu-de-dai-ma.md).

# 5.1.原始来源

配置 **Makefile** 非常简单，再次建议在开始之前查看现有的示例。此外，本手册中有个 [示例 Makefile](https://docs.freebsd.org/en/books/porters-handbook/porting-samplem/#porting-samplem)，请查看并遵循该模板中的变量和部分的顺序，以便其他人更容易阅读 Port。

在设计新的 **Makefile** 时，请按顺序考虑以下问题：

***

它是否以类似 **foozolix-1.2.tar.gz** 的标准 `gzip` 压缩 tarball 存储在 `DISTDIR` 中？如果是，继续下一步。如果不是，分发文件格式可能需要覆盖 `DISTVERSION`、`DISTNAME`、`EXTRACT_CMD`、`EXTRACT_BEFORE_ARGS`、`EXTRACT_AFTER_ARGS`、`EXTRACT_SUFX` 或 `DISTFILES` 中的一个或多个。

在最坏的情况下，可以创建自定义的 `do-extract` 目标来覆盖默认设置。但这种情况很少发生，几乎不需要。


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter, and the optional `goal` query parameter:

```
GET https://book.bsdcn.org/porters-handbook/di-5-zhang-pei-zhi-makefile/5.1.-zuo-zhe-fa-bu-de-dai-ma.md?ask=<question>&goal=<endgoal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is optional and describes the broader end goal you are ultimately trying to accomplish on behalf of the user. GitBook uses it to tailor the answer towards what is most useful for that goal.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
