Re: [PATCH 1/3] Move libgit.a sources into a libgit/ subdirectory

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Nguyen Thai Ngoc Duy wrote:
> 2011/2/18 Jonathan Nieder <jrnieder@xxxxxxxxx>:

>> Move sources for libgit.a to a libgit/ subdirectory. ÂThis way, a
>> person wanting to tackle the reusable part of git will know where to
>> look, and those looking to work on individual commands know to look
>> elsewhere.
>
> You missed a few (on purpose?): block-sha1, ppc and compat.

Yes, on purpose.  They're separately reusable.

> libgit.a is produced at toplevel so I need a few more keystrokes to
> reach files inside libgit. Maybe move libgit.a to libgit too?

Mm, good idea.

> With die() all over the place in libgit.a, I doubt it would become an
> independent project. Although this certainly makes it easier to
> reimplement libgit as a thin wrapper around libgit2.

I think it's more realistic to replace functions in libgit one by one
with reentrant versions.

Jonathan

-- 8< --
Subject: Rename libgit.a to libgit/lib.a

This makes the libgit files easier to reach through tab completion.

cgit uses "make -C git libgit.a" in its build process.  Make sure
that continues to work by installing a symlink libgit.a -> libgit/lib.a
on request.

Requested-by: Nguyán ThÃi Ngác Duy <pclouds@xxxxxxxxx>
Signed-off-by: Jonathan Nieder <jrnieder@xxxxxxxxx>
---
 Makefile                |    5 ++++-
 contrib/svn-fe/Makefile |    6 +++---
 2 files changed, 7 insertions(+), 4 deletions(-)

diff --git a/Makefile b/Makefile
index b812c1e..3d701d2 100644
--- a/Makefile
+++ b/Makefile
@@ -487,7 +487,7 @@ endif
 export PERL_PATH
 export PYTHON_PATH
 
-LIB_FILE=libgit.a
+LIB_FILE=libgit/lib.a
 XDIFF_LIB=xdiff/lib.a
 VCSSVN_LIB=vcs-svn/lib.a
 
@@ -2029,6 +2029,9 @@ $(REMOTE_CURL_PRIMARY): remote-curl.o http.o http-walker.o $(GITLIBS)
 $(LIB_FILE): $(LIB_OBJS)
 	$(QUIET_AR)$(RM) $@ && $(AR) rcs $@ $(LIB_OBJS)
 
+libgit.a: $(LIB_FILE)
+	ln -sf $(LIB_FILE) $@
+
 $(XDIFF_LIB): $(XDIFF_OBJS)
 	$(QUIET_AR)$(RM) $@ && $(AR) rcs $@ $(XDIFF_OBJS)
 
diff --git a/contrib/svn-fe/Makefile b/contrib/svn-fe/Makefile
index 360d8da..9dcad63 100644
--- a/contrib/svn-fe/Makefile
+++ b/contrib/svn-fe/Makefile
@@ -10,7 +10,7 @@ ALL_CFLAGS = $(CFLAGS)
 ALL_LDFLAGS = $(LDFLAGS)
 EXTLIBS =
 
-GIT_LIB = ../../libgit.a
+GIT_LIB = ../../libgit/lib.a
 VCSSVN_LIB = ../../vcs-svn/lib.a
 LIBS = $(VCSSVN_LIB) $(GIT_LIB) $(EXTLIBS)
 
@@ -54,8 +54,8 @@ svn-fe.1: svn-fe.txt
 ../../vcs-svn/lib.a: FORCE
 	$(QUIET_SUBDIR0)../.. $(QUIET_SUBDIR1) vcs-svn/lib.a
 
-../../libgit.a: FORCE
-	$(QUIET_SUBDIR0)../.. $(QUIET_SUBDIR1) libgit.a
+../../libgit/lib.a: FORCE
+	$(QUIET_SUBDIR0)../.. $(QUIET_SUBDIR1) libgit/lib.a
 
 clean:
 	$(RM) svn-fe$X svn-fe.o svn-fe.html svn-fe.xml svn-fe.1
-- 
1.7.4.1

--
To unsubscribe from this list: send the line "unsubscribe git" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[Index of Archives]     [Linux Kernel Development]     [Gcc Help]     [IETF Annouce]     [DCCP]     [Netdev]     [Networking]     [Security]     [V4L]     [Bugtraq]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux SCSI]     [Fedora Users]