您的位置:首页 > 其它

修正了cgit 项目中makefile的一个Bug

2010-07-15 22:47 316 查看
今天在编译cgit
的时候,发现了makefile的一个bug,就是在make clean的时候,仍然编译依赖性文件,因为它写了-include

From 34e02bbf386cda9009da3cce112658e738efb175 Mon Sep 17 00:00:00 2001
From: Lynn Lin <Lin_Lynn@emc.com>
Date: Thu, 15 Jul 2010 14:38:06 +0800
Subject: [PATCH] When envoking clean target,make should not perform the dependency file generation triggered by include

---
Makefile |    4 +++-
1 files changed, 3 insertions(+), 1 deletions(-)

diff --git a/Makefile b/Makefile
index 3a4d974..8b426fe 100644
--- a/Makefile
+++ b/Makefile
@@ -139,7 +139,9 @@ cgit: $(OBJECTS) libgit

cgit.o: VERSION

--include $(OBJECTS:.o=.d)
+ifneq "$(MAKECMDGOALS)" "clean"
+  -include $(OBJECTS:.o=.d)
+endif

libgit:
$(QUIET_SUBDIR0)git $(QUIET_SUBDIR1) NO_CURL=1 $(GIT_OPTIONS) libgit.a
--
1.7.1


在收到clean 目标的时候,就不用include .d文件,自然就不会编译了,因为在clean的时候没有必要去编译

希望patch能够被接受
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: