# [PATCH] add install-lib target to install libgit.a library plus headers.

3 messages from 2007-02-14 to 2007-02-14. Participants: Gerrit Pape, Johannes Schindelin, Junio C Hamano.
Thread: https://gitlist.dev/t/6819

## Gerrit Pape, 2007-02-14 14:57

Subject: [PATCH] add install-lib target to install libgit.a library plus headers.
Message-ID: <20070214145725.2827.qmail@0b3a4e2ad592dc.315fe32.mid.smarden.org>
URL: https://gitlist.dev/e/20070214145725.2827.qmail%400b3a4e2ad592dc.315fe32.mid.smarden.org

```
Patch from Luca Falavigna to install git static library and header files
into $(prefix)/lib/, $(prefix)/include/git/, see

 http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=407722

Signed-off-by: Gerrit Pape <pape@smarden.org>
---
 Makefile |   10 +++++++++-
 1 files changed, 9 insertions(+), 1 deletions(-)

diff --git a/Makefile b/Makefile
index ebecbbd..19fe3d5 100644
--- a/Makefile
+++ b/Makefile
@@ -123,6 +123,8 @@ STRIP ?= strip
 prefix = $(HOME)
 bindir = $(prefix)/bin
 gitexecdir = $(bindir)
+headerdir = $(prefix)/include/git
+libdir = $(prefix)/lib
 template_dir = $(prefix)/share/git-core/templates/
 # DESTDIR=
 
@@ -588,6 +590,8 @@ SHA1_HEADER_SQ = $(subst ','\'',$(SHA1_HEADER))
 DESTDIR_SQ = $(subst ','\'',$(DESTDIR))
 bindir_SQ = $(subst ','\'',$(bindir))
 gitexecdir_SQ = $(subst ','\'',$(gitexecdir))
+headerdir_SQ = $(subst ','\'',$(headerdir))
+libdir_SQ = $(subst ','\'',$(libdir))
 template_dir_SQ = $(subst ','\'',$(template_dir))
 prefix_SQ = $(subst ','\'',$(prefix))
 
@@ -863,7 +867,11 @@ install-doc:
 quick-install-doc:
 	$(MAKE) -C Documentation quick-install
 
-
+install-lib: $(LIB_FILE)
+	$(INSTALL) -d -m0755 '$(DESTDIR_SQ)$(headerdir_SQ)'
+	$(INSTALL) -d -m0755 '$(DESTDIR_SQ)$(libdir_SQ)'
+	$(INSTALL) -m0644 $(LIB_H) '$(DESTDIR_SQ)$(headerdir_SQ)'
+	$(INSTALL) -m0644 $(LIB_FILE) '$(DESTDIR_SQ)$(libdir_SQ)'
 
 ### Maintainer's dist rules
 
-- 
1.5.0

```

## Johannes Schindelin, 2007-02-14 15:51

Subject: Re: [PATCH] add install-lib target to install libgit.a library plus headers.
Message-ID: <Pine.LNX.4.63.0702141650400.22628@wbgn013.biozentrum.uni-wuerzburg.de>
URL: https://gitlist.dev/e/Pine.LNX.4.63.0702141650400.22628%40wbgn013.biozentrum.uni-wuerzburg.de
In-Reply-To: <20070214145725.2827.qmail@0b3a4e2ad592dc.315fe32.mid.smarden.org>

```
Hi,

On Wed, 14 Feb 2007, Gerrit Pape wrote:

> Patch from Luca Falavigna to install git static library and header files
> into $(prefix)/lib/, $(prefix)/include/git/, see

This would make sense, _iff_ libgit.a was libified. As it is, too many 
functions assume that you can die() anytime something goes awry.

Ciao,
Dscho

```

## Junio C Hamano, 2007-02-14 18:24

Subject: Re: [PATCH] add install-lib target to install libgit.a library plus headers.
Message-ID: <7v4ppopph2.fsf@assigned-by-dhcp.cox.net>
URL: https://gitlist.dev/e/7v4ppopph2.fsf%40assigned-by-dhcp.cox.net
In-Reply-To: <20070214145725.2827.qmail@0b3a4e2ad592dc.315fe32.mid.smarden.org>

```
Sorry, but libgit.a is not a publically usable/useful library at
this moment, as its internal API is not cast in stone yet.

Installing it in /usr/lib and /usr/include would give the false
impression to the users that linking with user's programs is
supported and upgrading git won't break them.  Please do not
create libgit-dev package.

```
