Re: [PATCH 1/3] Move libgit.a sources into a libgit/ subdirectory
- From
Jonathan Nieder <jrnieder@gmail.com>
- Date
- Feb 18, 2011, 04:14 UTC
- Message-ID
- <20110218041358.GB15643@elie>
- In-Reply-To
- <AANLkTikFLkXKKhZoDGAgh+i8H2fv+QNEVj7vEVABxee2@mail.gmail.com>
Nguyen Thai Ngoc Duy wrote:
> 2011/2/18 Jonathan Nieder <jrnieder@gmail.com>:
Show 6 quoted lines
>> 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@gmail.com> Signed-off-by: Jonathan Nieder <jrnieder@gmail.com> --- 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