aboutsummaryrefslogtreecommitdiff
path: root/documentation/content/zh-cn/books/porters-handbook/porting-samplem/_index.adoc
diff options
context:
space:
mode:
Diffstat (limited to 'documentation/content/zh-cn/books/porters-handbook/porting-samplem/_index.adoc')
-rw-r--r--documentation/content/zh-cn/books/porters-handbook/porting-samplem/_index.adoc128
1 files changed, 128 insertions, 0 deletions
diff --git a/documentation/content/zh-cn/books/porters-handbook/porting-samplem/_index.adoc b/documentation/content/zh-cn/books/porters-handbook/porting-samplem/_index.adoc
new file mode 100644
index 0000000000..fe294a557d
--- /dev/null
+++ b/documentation/content/zh-cn/books/porters-handbook/porting-samplem/_index.adoc
@@ -0,0 +1,128 @@
+---
+title: 第 13 章 示范的 Makefile
+prev: books/porters-handbook/porting-dads
+next: books/porters-handbook/keeping-up
+showBookMenu: true
+weight: 13
+path: "/books/porters-handbook/porting-samplem/"
+---
+
+[[porting-samplem]]
+= 示范的 [.filename]#Makefile#
+:doctype: book
+:toc: macro
+:toclevels: 1
+:icons: font
+:sectnums:
+:sectnumlevels: 6
+:sectnumoffset: 13
+:partnums:
+:source-highlighter: rouge
+:experimental:
+:images-path: books/porters-handbook/
+
+ifdef::env-beastie[]
+ifdef::backend-html5[]
+:imagesdir: ../../../../images/{images-path}
+endif::[]
+ifndef::book[]
+include::shared/authors.adoc[]
+include::shared/mirrors.adoc[]
+include::shared/releases.adoc[]
+include::shared/attributes/attributes-{{% lang %}}.adoc[]
+include::shared/{{% lang %}}/teams.adoc[]
+include::shared/{{% lang %}}/mailing-lists.adoc[]
+include::shared/{{% lang %}}/urls.adoc[]
+toc::[]
+endif::[]
+ifdef::backend-pdf,backend-epub3[]
+include::../../../../../shared/asciidoctor.adoc[]
+endif::[]
+endif::[]
+
+ifndef::env-beastie[]
+toc::[]
+include::../../../../../shared/asciidoctor.adoc[]
+endif::[]
+
+这里是一个您可以在建立新 port 时参考的 [.filename]#Makefile#。 请务必删除不需要的那些注释 (方括号中间的文字)!
+
+建议您按照下面这样的格式 (变量顺序, 小节之间的空行等) 来编写。 这个格式的作用是便于查找重要的信息。 我们建议您使用 <<porting-portlint,portlint>> 来检查 [.filename]#Makefile#。
+
+[.programlisting]
+....
+[头部... 主要是让我们更容易地分辨不同的 port。]
+# New ports collection makefile for: xdvi
+[版本这行, 只有在 PORTVERSION 变量不足以描述 port 时才需要]
+# Date created: 26 May 1995
+[这是最初将软件移植到 FreeBSD 上的日期, 一般来说是建立这份 Makefile 的日期。
+请注意不要在之后再次修改这个日期。]
+# Whom: Satoshi Asami <asami@FreeBSD.org>
+#
+# $FreeBSD$
+[ ^^^^^^^^^ 这是 CVS 在文件 commit 到我们的代码库时, 自动进行替换的 RCS ID。
+如果您正在升级 port, 不要把它改回 "$FreeBSD$"。
+CVS 会自动进行处理。]
+#
+
+[这个小节描述 port 本身以及主要下载站点 - PORTNAME 和 PORTVERSION
+ 应放在最前面, 随后是 CATEGORIES, 然后是 MASTER_SITES, 接下来是
+ MASTER_SITE_SUBDIR。 如果需要的话, 接下来应指定
+ PKGNAMEPREFIX 和 PKGNAMESUFFIX。 随后是 DISTNAME, EXTRACT_SUFX,
+ 以及 DISTFILES, EXTRACT_ONLY, 如果需要的话。]
+PORTNAME= xdvi
+PORTVERSION= 18.2
+CATEGORIES= print
+[如果不想使用 MASTER_SITE_* 宏, 一定不要忘记结尾的斜线 ("/")!]
+MASTER_SITES= ${MASTER_SITE_XCONTRIB}
+MASTER_SITE_SUBDIR= applications
+PKGNAMEPREFIX= ja-
+DISTNAME= xdvi-pl18
+[如果源代码包不是标准的 ".tar.gz" 形式, 就需要设置这个]
+EXTRACT_SUFX= .tar.Z
+
+[分散的补丁 -- 可以为空]
+PATCH_SITES= ftp://ftp.sra.co.jp/pub/X11/japanese/
+PATCHFILES= xdvi-18.patch1.gz xdvi-18.patch2.gz
+
+[监护人(maintainer); *必须有*! 这是某个资源处理 port 更新、 联编失败,
+ 以及回答用户直接提问或汇报 bug 的人。 为了保证 Ports Collection
+ 有尽可能高的品质, 我们不再接受指定给 "ports@FreeBSD.org" 的新 port。]
+MAINTAINER= asami@FreeBSD.org
+COMMENT= A DVI Previewer for the X Window System
+
+[依赖的其它软件包 -- 可以为空]
+RUN_DEPENDS= gs:${PORTSDIR}/print/ghostscript
+LIB_DEPENDS= Xpm.5:${PORTSDIR}/graphics/xpm
+
+[这节是其它不适合上几节的标准 bsd.port.mk 变量]
+[如果需要在 configure、 build 或 install 过程中提问...]
+IS_INTERACTIVE= yes
+[如果解压缩到 ${DISTNAME} 以外的目录...]
+WRKSRC= ${WRKDIR}/xdvi-new
+[如果作者发布的补丁不是相对于 ${WRKSRC} 的, 可能需要调整这个]
+PATCH_DIST_STRIP= -p1
+[如果需要运行由 GNU autoconf 生成的 "configure" 脚本]
+GNU_CONFIGURE= yes
+[如果需要使用 GNU make, 而不是 /usr/bin/make 来完成联编...]
+USE_GMAKE= yes
+[如果是一个 X 应用程序, 并使用 "xmkmf -a" 来运行...]
+USE_IMAKE= yes
+[et cetera.]
+
+[将在接下来的部分使用的非标准的变量]
+MY_FAVORITE_RESPONSE= "yeah, right"
+
+[接下来是特殊规则, 按调用顺序排列]
+pre-fetch:
+ i go fetch something, yeah
+
+post-patch:
+ i need to do something after patch, great
+
+pre-install:
+ and then some more stuff before installing, wow
+
+[结语]
+.include <bsd.port.mk>
+....