public inbox for git@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH] osxkeychain: define build targets in the top-level Makefile.
@ 2026-02-10 18:01 Koji Nakamaru via GitGitGadget
  2026-02-10 19:50 ` Junio C Hamano
  2026-02-11  1:59 ` [PATCH v2] " Koji Nakamaru via GitGitGadget
  0 siblings, 2 replies; 20+ messages in thread
From: Koji Nakamaru via GitGitGadget @ 2026-02-10 18:01 UTC (permalink / raw)
  To: git; +Cc: Koji Nakamaru, Koji Nakamaru

From: Koji Nakamaru <koji.nakamaru@gree.net>

The fix for git-credential-osxkeychain in 4580bcd235 (osxkeychain: avoid
incorrectly skipping store operation) introduced linkage with libgit.a,
and its Makefile was adjusted accordingly. However, the build fails as
of 864f55e190 because several macOS-specific refinements were applied to
the top-level Makefile and config.mak.uname, such as:

  - 363837afe7 (macOS: make Homebrew use configurable, 2025-12-24)
  - cee341e9dd (macOS: use iconv from Homebrew if needed and present,
    2025-12-24)
  - d281241518 (utf8.c: enable workaround for iconv under macOS 14/15,
    2026-01-12)

Since libgit.a and its corresponding header files depend on many flags
defined in the top-level Makefile, these flags must be consistently
defined when building git-credential-osxkeychain. Continuing to manually
adjust the git-credential-osxkeychain Makefile is cumbersome and
fragile.

Define the build targets for git-credential-osxkeychain in the top-level
Makefile and modify its local Makefile to simply rely on those targets.

Signed-off-by: Koji Nakamaru <koji.nakamaru@gree.net>
---
    osxkeychain: define build targets in the top-level Makefile.

Published-As: https://github.com/gitgitgadget/git/releases/tag/pr-2046%2FKojiNakamaru%2Ffix%2Fosxkeychain-makefile-v1
Fetch-It-Via: git fetch https://github.com/gitgitgadget/git pr-2046/KojiNakamaru/fix/osxkeychain-makefile-v1
Pull-Request: https://github.com/gitgitgadget/git/pull/2046

 Makefile                                | 17 +++++++
 contrib/credential/osxkeychain/Makefile | 65 +++----------------------
 2 files changed, 23 insertions(+), 59 deletions(-)

diff --git a/Makefile b/Makefile
index 4ac44331ea..97196c6afa 100644
--- a/Makefile
+++ b/Makefile
@@ -4060,3 +4060,20 @@ $(LIBGIT_HIDDEN_EXPORT): $(LIBGIT_PARTIAL_EXPORT)
 
 contrib/libgit-sys/libgitpub.a: $(LIBGIT_HIDDEN_EXPORT)
 	$(AR) $(ARFLAGS) $@ $^
+
+contrib/credential/osxkeychain/git-credential-osxkeychain: contrib/credential/osxkeychain/git-credential-osxkeychain.o $(LIB_FILE) GIT-LDFLAGS
+	$(QUIET_LINK)$(CC) $(ALL_CFLAGS) -o $@ $(ALL_LDFLAGS) \
+		$(filter %.o,$^) $(LIB_FILE) $(EXTLIBS) -framework Security -framework CoreFoundation
+
+contrib/credential/osxkeychain/git-credential-osxkeychain.o: contrib/credential/osxkeychain/git-credential-osxkeychain.c GIT-CFLAGS
+	$(QUIET_LINK)$(CC) -o $@ -c $(dep_args) $(compdb_args) $(ALL_CFLAGS) $(EXTRA_CPPFLAGS) $<
+
+install-git-credential-osxkeychain: contrib/credential/osxkeychain/git-credential-osxkeychain
+	$(INSTALL) -d -m 755 '$(DESTDIR_SQ)$(gitexec_instdir_SQ)'
+	$(INSTALL) $(INSTALL_STRIP) $< '$(DESTDIR_SQ)$(gitexec_instdir_SQ)'
+
+.PHONY: clean-git-credential-osxkeychain
+clean-git-credential-osxkeychain:
+	$(RM) \
+		contrib/credential/osxkeychain/git-credential-osxkeychain \
+		contrib/credential/osxkeychain/git-credential-osxkeychain.o
diff --git a/contrib/credential/osxkeychain/Makefile b/contrib/credential/osxkeychain/Makefile
index c68445b82d..ddb29f0563 100644
--- a/contrib/credential/osxkeychain/Makefile
+++ b/contrib/credential/osxkeychain/Makefile
@@ -1,66 +1,13 @@
 # The default target of this Makefile is...
 all:: git-credential-osxkeychain
 
-include ../../../config.mak.uname
--include ../../../config.mak.autogen
--include ../../../config.mak
+git-credential-osxkeychain:
+	cd ../../..; make contrib/credential/osxkeychain/git-credential-osxkeychain
 
-ifdef ZLIB_NG
-	BASIC_CFLAGS += -DHAVE_ZLIB_NG
-        ifdef ZLIB_NG_PATH
-		BASIC_CFLAGS += -I$(ZLIB_NG_PATH)/include
-		EXTLIBS += $(call libpath_template,$(ZLIB_NG_PATH)/$(lib))
-        endif
-	EXTLIBS += -lz-ng
-else
-        ifdef ZLIB_PATH
-		BASIC_CFLAGS += -I$(ZLIB_PATH)/include
-		EXTLIBS += $(call libpath_template,$(ZLIB_PATH)/$(lib))
-        endif
-	EXTLIBS += -lz
-endif
-ifndef NO_ICONV
-        ifdef NEEDS_LIBICONV
-                ifdef ICONVDIR
-			BASIC_CFLAGS += -I$(ICONVDIR)/include
-			ICONV_LINK = $(call libpath_template,$(ICONVDIR)/$(lib))
-                else
-			ICONV_LINK =
-                endif
-                ifdef NEEDS_LIBINTL_BEFORE_LIBICONV
-			ICONV_LINK += -lintl
-                endif
-		EXTLIBS += $(ICONV_LINK) -liconv
-        endif
-endif
-ifndef LIBC_CONTAINS_LIBINTL
-	EXTLIBS += -lintl
-endif
-
-prefix ?= /usr/local
-gitexecdir ?= $(prefix)/libexec/git-core
-
-CC ?= gcc
-CFLAGS ?= -g -O2 -Wall -I../../.. $(BASIC_CFLAGS)
-LDFLAGS ?= $(BASIC_LDFLAGS) $(EXTLIBS)
-INSTALL ?= install
-RM ?= rm -f
-
-%.o: %.c
-	$(CC) $(CFLAGS) $(CPPFLAGS) -o $@ -c $<
-
-git-credential-osxkeychain: git-credential-osxkeychain.o ../../../libgit.a
-	$(CC) $(CFLAGS) -o $@ $^ $(LDFLAGS) \
-		-framework Security -framework CoreFoundation
-
-install: git-credential-osxkeychain
-	$(INSTALL) -d -m 755 $(DESTDIR)$(gitexecdir)
-	$(INSTALL) -m 755 $< $(DESTDIR)$(gitexecdir)
-
-../../../libgit.a:
-	cd ../../..; make libgit.a
+install:
+	cd ../../..; make install-git-credential-osxkeychain
 
 clean:
-	$(RM) git-credential-osxkeychain git-credential-osxkeychain.o
+	cd ../../..; make clean-git-credential-osxkeychain
 
-.PHONY: all install clean
+.PHONY: all git-credential-osxkeychain install clean

base-commit: 864f55e1906897b630333675a52874c0fec2a45c
-- 
gitgitgadget

^ permalink raw reply related	[flat|nested] 20+ messages in thread

* Re: [PATCH] osxkeychain: define build targets in the top-level Makefile.
  2026-02-10 18:01 [PATCH] osxkeychain: define build targets in the top-level Makefile Koji Nakamaru via GitGitGadget
@ 2026-02-10 19:50 ` Junio C Hamano
  2026-02-10 23:16   ` Koji Nakamaru
  2026-02-11  1:59 ` [PATCH v2] " Koji Nakamaru via GitGitGadget
  1 sibling, 1 reply; 20+ messages in thread
From: Junio C Hamano @ 2026-02-10 19:50 UTC (permalink / raw)
  To: Koji Nakamaru via GitGitGadget; +Cc: git, Koji Nakamaru

"Koji Nakamaru via GitGitGadget" <gitgitgadget@gmail.com> writes:

>  Makefile                                | 17 +++++++
>  contrib/credential/osxkeychain/Makefile | 65 +++----------------------
>  2 files changed, 23 insertions(+), 59 deletions(-)

Nice simplification overall.

> diff --git a/contrib/credential/osxkeychain/Makefile b/contrib/credential/osxkeychain/Makefile
> index c68445b82d..ddb29f0563 100644
> --- a/contrib/credential/osxkeychain/Makefile
> +++ b/contrib/credential/osxkeychain/Makefile
> @@ -1,66 +1,13 @@
>  # The default target of this Makefile is...
>  all:: git-credential-osxkeychain
>  
> -include ../../../config.mak.uname
> --include ../../../config.mak.autogen
> --include ../../../config.mak
> +git-credential-osxkeychain:
> +	cd ../../..; make contrib/credential/osxkeychain/git-credential-osxkeychain

Let's not write "make", but stick to $(MAKE), perhaps like

	$(MAKE) -C ../../.. contrib/credential/osxkeychain/$@

> +install:
> +	cd ../../..; make install-git-credential-osxkeychain
>  
>  clean:
> -	$(RM) git-credential-osxkeychain git-credential-osxkeychain.o
> +	cd ../../..; make clean-git-credential-osxkeychain

Likewise.

^ permalink raw reply	[flat|nested] 20+ messages in thread

* Re: [PATCH] osxkeychain: define build targets in the top-level Makefile.
  2026-02-10 19:50 ` Junio C Hamano
@ 2026-02-10 23:16   ` Koji Nakamaru
  0 siblings, 0 replies; 20+ messages in thread
From: Koji Nakamaru @ 2026-02-10 23:16 UTC (permalink / raw)
  To: Junio C Hamano; +Cc: Koji Nakamaru via GitGitGadget, git

On Wed, Feb 11, 2026 at 4:50 AM Junio C Hamano <gitster@pobox.com> wrote:
>
> "Koji Nakamaru via GitGitGadget" <gitgitgadget@gmail.com> writes:
>
> >  Makefile                                | 17 +++++++
> >  contrib/credential/osxkeychain/Makefile | 65 +++----------------------
> >  2 files changed, 23 insertions(+), 59 deletions(-)
>
> Nice simplification overall.
>
> > diff --git a/contrib/credential/osxkeychain/Makefile b/contrib/credential/osxkeychain/Makefile
> > index c68445b82d..ddb29f0563 100644
> > --- a/contrib/credential/osxkeychain/Makefile
> > +++ b/contrib/credential/osxkeychain/Makefile
> > @@ -1,66 +1,13 @@
> >  # The default target of this Makefile is...
> >  all:: git-credential-osxkeychain
> >
> > -include ../../../config.mak.uname
> > --include ../../../config.mak.autogen
> > --include ../../../config.mak
> > +git-credential-osxkeychain:
> > +     cd ../../..; make contrib/credential/osxkeychain/git-credential-osxkeychain
>
> Let's not write "make", but stick to $(MAKE), perhaps like
>
>         $(MAKE) -C ../../.. contrib/credential/osxkeychain/$@
>
> > +install:
> > +     cd ../../..; make install-git-credential-osxkeychain
> >
> >  clean:
> > -     $(RM) git-credential-osxkeychain git-credential-osxkeychain.o
> > +     cd ../../..; make clean-git-credential-osxkeychain
>
> Likewise.

Thank you for the review. I'll apply these changes and submit the next
iteration soon.

--
Koji Nakamaru

^ permalink raw reply	[flat|nested] 20+ messages in thread

* [PATCH v2] osxkeychain: define build targets in the top-level Makefile.
  2026-02-10 18:01 [PATCH] osxkeychain: define build targets in the top-level Makefile Koji Nakamaru via GitGitGadget
  2026-02-10 19:50 ` Junio C Hamano
@ 2026-02-11  1:59 ` Koji Nakamaru via GitGitGadget
  2026-02-11 15:37   ` Junio C Hamano
  2026-02-18  5:14   ` [PATCH v3] " Koji Nakamaru via GitGitGadget
  1 sibling, 2 replies; 20+ messages in thread
From: Koji Nakamaru via GitGitGadget @ 2026-02-11  1:59 UTC (permalink / raw)
  To: git; +Cc: Junio C Hamano, Koji Nakamaru, Koji Nakamaru

From: Koji Nakamaru <koji.nakamaru@gree.net>

The fix for git-credential-osxkeychain in 4580bcd235 (osxkeychain: avoid
incorrectly skipping store operation) introduced linkage with libgit.a,
and its Makefile was adjusted accordingly. However, the build fails as
of 864f55e190 because several macOS-specific refinements were applied to
the top-level Makefile and config.mak.uname, such as:

  - 363837afe7 (macOS: make Homebrew use configurable, 2025-12-24)
  - cee341e9dd (macOS: use iconv from Homebrew if needed and present,
    2025-12-24)
  - d281241518 (utf8.c: enable workaround for iconv under macOS 14/15,
    2026-01-12)

Since libgit.a and its corresponding header files depend on many flags
defined in the top-level Makefile, these flags must be consistently
defined when building git-credential-osxkeychain. Continuing to manually
adjust the git-credential-osxkeychain Makefile is cumbersome and
fragile.

Define the build targets for git-credential-osxkeychain in the top-level
Makefile and modify its local Makefile to simply rely on those targets.

Helped-by: Junio C Hamano <gitster@pobox.com>
Signed-off-by: Koji Nakamaru <koji.nakamaru@gree.net>
---
    osxkeychain: define build targets in the top-level Makefile.
    
    Changes since v1:
    
     * Use $(MAKE) -C to build targets in the top-level Makefile.

Published-As: https://github.com/gitgitgadget/git/releases/tag/pr-2046%2FKojiNakamaru%2Ffix%2Fosxkeychain-makefile-v2
Fetch-It-Via: git fetch https://github.com/gitgitgadget/git pr-2046/KojiNakamaru/fix/osxkeychain-makefile-v2
Pull-Request: https://github.com/gitgitgadget/git/pull/2046

Range-diff vs v1:

 1:  0aa80d1d17 ! 1:  8c5d75f0c6 osxkeychain: define build targets in the top-level Makefile.
     @@ Commit message
          Define the build targets for git-credential-osxkeychain in the top-level
          Makefile and modify its local Makefile to simply rely on those targets.
      
     +    Helped-by: Junio C Hamano <gitster@pobox.com>
          Signed-off-by: Koji Nakamaru <koji.nakamaru@gree.net>
      
       ## Makefile ##
     @@ contrib/credential/osxkeychain/Makefile
      --include ../../../config.mak.autogen
      --include ../../../config.mak
      +git-credential-osxkeychain:
     -+	cd ../../..; make contrib/credential/osxkeychain/git-credential-osxkeychain
     ++	$(MAKE) -C  ../../.. contrib/credential/osxkeychain/git-credential-osxkeychain
       
      -ifdef ZLIB_NG
      -	BASIC_CFLAGS += -DHAVE_ZLIB_NG
     @@ contrib/credential/osxkeychain/Makefile
      -../../../libgit.a:
      -	cd ../../..; make libgit.a
      +install:
     -+	cd ../../..; make install-git-credential-osxkeychain
     ++	$(MAKE) -C  ../../.. install-git-credential-osxkeychain
       
       clean:
      -	$(RM) git-credential-osxkeychain git-credential-osxkeychain.o
     -+	cd ../../..; make clean-git-credential-osxkeychain
     ++	$(MAKE) -C  ../../.. clean-git-credential-osxkeychain
       
      -.PHONY: all install clean
      +.PHONY: all git-credential-osxkeychain install clean


 Makefile                                | 17 +++++++
 contrib/credential/osxkeychain/Makefile | 65 +++----------------------
 2 files changed, 23 insertions(+), 59 deletions(-)

diff --git a/Makefile b/Makefile
index 4ac44331ea..97196c6afa 100644
--- a/Makefile
+++ b/Makefile
@@ -4060,3 +4060,20 @@ $(LIBGIT_HIDDEN_EXPORT): $(LIBGIT_PARTIAL_EXPORT)
 
 contrib/libgit-sys/libgitpub.a: $(LIBGIT_HIDDEN_EXPORT)
 	$(AR) $(ARFLAGS) $@ $^
+
+contrib/credential/osxkeychain/git-credential-osxkeychain: contrib/credential/osxkeychain/git-credential-osxkeychain.o $(LIB_FILE) GIT-LDFLAGS
+	$(QUIET_LINK)$(CC) $(ALL_CFLAGS) -o $@ $(ALL_LDFLAGS) \
+		$(filter %.o,$^) $(LIB_FILE) $(EXTLIBS) -framework Security -framework CoreFoundation
+
+contrib/credential/osxkeychain/git-credential-osxkeychain.o: contrib/credential/osxkeychain/git-credential-osxkeychain.c GIT-CFLAGS
+	$(QUIET_LINK)$(CC) -o $@ -c $(dep_args) $(compdb_args) $(ALL_CFLAGS) $(EXTRA_CPPFLAGS) $<
+
+install-git-credential-osxkeychain: contrib/credential/osxkeychain/git-credential-osxkeychain
+	$(INSTALL) -d -m 755 '$(DESTDIR_SQ)$(gitexec_instdir_SQ)'
+	$(INSTALL) $(INSTALL_STRIP) $< '$(DESTDIR_SQ)$(gitexec_instdir_SQ)'
+
+.PHONY: clean-git-credential-osxkeychain
+clean-git-credential-osxkeychain:
+	$(RM) \
+		contrib/credential/osxkeychain/git-credential-osxkeychain \
+		contrib/credential/osxkeychain/git-credential-osxkeychain.o
diff --git a/contrib/credential/osxkeychain/Makefile b/contrib/credential/osxkeychain/Makefile
index c68445b82d..2044a33f41 100644
--- a/contrib/credential/osxkeychain/Makefile
+++ b/contrib/credential/osxkeychain/Makefile
@@ -1,66 +1,13 @@
 # The default target of this Makefile is...
 all:: git-credential-osxkeychain
 
-include ../../../config.mak.uname
--include ../../../config.mak.autogen
--include ../../../config.mak
+git-credential-osxkeychain:
+	$(MAKE) -C  ../../.. contrib/credential/osxkeychain/git-credential-osxkeychain
 
-ifdef ZLIB_NG
-	BASIC_CFLAGS += -DHAVE_ZLIB_NG
-        ifdef ZLIB_NG_PATH
-		BASIC_CFLAGS += -I$(ZLIB_NG_PATH)/include
-		EXTLIBS += $(call libpath_template,$(ZLIB_NG_PATH)/$(lib))
-        endif
-	EXTLIBS += -lz-ng
-else
-        ifdef ZLIB_PATH
-		BASIC_CFLAGS += -I$(ZLIB_PATH)/include
-		EXTLIBS += $(call libpath_template,$(ZLIB_PATH)/$(lib))
-        endif
-	EXTLIBS += -lz
-endif
-ifndef NO_ICONV
-        ifdef NEEDS_LIBICONV
-                ifdef ICONVDIR
-			BASIC_CFLAGS += -I$(ICONVDIR)/include
-			ICONV_LINK = $(call libpath_template,$(ICONVDIR)/$(lib))
-                else
-			ICONV_LINK =
-                endif
-                ifdef NEEDS_LIBINTL_BEFORE_LIBICONV
-			ICONV_LINK += -lintl
-                endif
-		EXTLIBS += $(ICONV_LINK) -liconv
-        endif
-endif
-ifndef LIBC_CONTAINS_LIBINTL
-	EXTLIBS += -lintl
-endif
-
-prefix ?= /usr/local
-gitexecdir ?= $(prefix)/libexec/git-core
-
-CC ?= gcc
-CFLAGS ?= -g -O2 -Wall -I../../.. $(BASIC_CFLAGS)
-LDFLAGS ?= $(BASIC_LDFLAGS) $(EXTLIBS)
-INSTALL ?= install
-RM ?= rm -f
-
-%.o: %.c
-	$(CC) $(CFLAGS) $(CPPFLAGS) -o $@ -c $<
-
-git-credential-osxkeychain: git-credential-osxkeychain.o ../../../libgit.a
-	$(CC) $(CFLAGS) -o $@ $^ $(LDFLAGS) \
-		-framework Security -framework CoreFoundation
-
-install: git-credential-osxkeychain
-	$(INSTALL) -d -m 755 $(DESTDIR)$(gitexecdir)
-	$(INSTALL) -m 755 $< $(DESTDIR)$(gitexecdir)
-
-../../../libgit.a:
-	cd ../../..; make libgit.a
+install:
+	$(MAKE) -C  ../../.. install-git-credential-osxkeychain
 
 clean:
-	$(RM) git-credential-osxkeychain git-credential-osxkeychain.o
+	$(MAKE) -C  ../../.. clean-git-credential-osxkeychain
 
-.PHONY: all install clean
+.PHONY: all git-credential-osxkeychain install clean

base-commit: 864f55e1906897b630333675a52874c0fec2a45c
-- 
gitgitgadget

^ permalink raw reply related	[flat|nested] 20+ messages in thread

* Re: [PATCH v2] osxkeychain: define build targets in the top-level Makefile.
  2026-02-11  1:59 ` [PATCH v2] " Koji Nakamaru via GitGitGadget
@ 2026-02-11 15:37   ` Junio C Hamano
  2026-02-11 23:06     ` Koji Nakamaru
  2026-02-18  5:14   ` [PATCH v3] " Koji Nakamaru via GitGitGadget
  1 sibling, 1 reply; 20+ messages in thread
From: Junio C Hamano @ 2026-02-11 15:37 UTC (permalink / raw)
  To: Koji Nakamaru via GitGitGadget; +Cc: git, Koji Nakamaru

"Koji Nakamaru via GitGitGadget" <gitgitgadget@gmail.com> writes:

>      -+	cd ../../..; make install-git-credential-osxkeychain
>      ++	$(MAKE) -C  ../../.. install-git-credential-osxkeychain

Will replace and mark for 'next'.  Will squash the double spaces
after "-C" into one while doing so.

Thanks.

^ permalink raw reply	[flat|nested] 20+ messages in thread

* Re: [PATCH v2] osxkeychain: define build targets in the top-level Makefile.
  2026-02-11 15:37   ` Junio C Hamano
@ 2026-02-11 23:06     ` Koji Nakamaru
  2026-02-16 23:45       ` D. Ben Knoble
  0 siblings, 1 reply; 20+ messages in thread
From: Koji Nakamaru @ 2026-02-11 23:06 UTC (permalink / raw)
  To: Junio C Hamano; +Cc: Koji Nakamaru via GitGitGadget, git

On Thu, Feb 12, 2026 at 12:37 AM Junio C Hamano <gitster@pobox.com> wrote:
>
> "Koji Nakamaru via GitGitGadget" <gitgitgadget@gmail.com> writes:
>
> >      -+       cd ../../..; make install-git-credential-osxkeychain
> >      ++       $(MAKE) -C  ../../.. install-git-credential-osxkeychain
>
> Will replace and mark for 'next'.  Will squash the double spaces
> after "-C" into one while doing so.

Thank you again for the squash and for marking it for 'next'.

--
Koji Nakamaru

^ permalink raw reply	[flat|nested] 20+ messages in thread

* Re: [PATCH v2] osxkeychain: define build targets in the top-level Makefile.
  2026-02-11 23:06     ` Koji Nakamaru
@ 2026-02-16 23:45       ` D. Ben Knoble
  2026-02-17  1:09         ` Koji Nakamaru
  0 siblings, 1 reply; 20+ messages in thread
From: D. Ben Knoble @ 2026-02-16 23:45 UTC (permalink / raw)
  To: Koji Nakamaru; +Cc: Junio C Hamano, Koji Nakamaru via GitGitGadget, git

On Wed, Feb 11, 2026 at 6:06 PM Koji Nakamaru <koji.nakamaru@gree.net> wrote:
>
> On Thu, Feb 12, 2026 at 12:37 AM Junio C Hamano <gitster@pobox.com> wrote:
> >
> > "Koji Nakamaru via GitGitGadget" <gitgitgadget@gmail.com> writes:
> >
> > >      -+       cd ../../..; make install-git-credential-osxkeychain
> > >      ++       $(MAKE) -C  ../../.. install-git-credential-osxkeychain
> >
> > Will replace and mark for 'next'.  Will squash the double spaces
> > after "-C" into one while doing so.
>
> Thank you again for the squash and for marking it for 'next'.
>
> --
> Koji Nakamaru
>

Homebrew picked this patch on top of 2.53.0, and on a recent build on
older macOS I needed to

    mkdir contrib/credential/osxkeychain/.depend

in order to make their build work, since otherwise:

    error: error opening
'contrib/credential/osxkeychain/.depend/git-credential-osxkeychain.o.d':
No such file or directory
    1 error generated.
    make[1]: ***
[contrib/credential/osxkeychain/git-credential-osxkeychain.o] Error 1


-- 
D. Ben Knoble

^ permalink raw reply	[flat|nested] 20+ messages in thread

* Re: [PATCH v2] osxkeychain: define build targets in the top-level Makefile.
  2026-02-16 23:45       ` D. Ben Knoble
@ 2026-02-17  1:09         ` Koji Nakamaru
  2026-02-17 13:10           ` D. Ben Knoble
  0 siblings, 1 reply; 20+ messages in thread
From: Koji Nakamaru @ 2026-02-17  1:09 UTC (permalink / raw)
  To: D. Ben Knoble; +Cc: Junio C Hamano, Koji Nakamaru via GitGitGadget, git

On Tue, Feb 17, 2026 at 8:45 AM D. Ben Knoble <ben.knoble@gmail.com> wrote:
> ...
>
> Homebrew picked this patch on top of 2.53.0, and on a recent build on
> older macOS I needed to
>
>     mkdir contrib/credential/osxkeychain/.depend
>
> in order to make their build work, since otherwise:
>
>     error: error opening
> 'contrib/credential/osxkeychain/.depend/git-credential-osxkeychain.o.d':
> No such file or directory
>     1 error generated.
>     make[1]: ***
> [contrib/credential/osxkeychain/git-credential-osxkeychain.o] Error 1

I tried to reproduce this using the current Homebrew formula for git [1]
on macOS 15.7.4 and 14.8.4 (both relatively newer) with the following
steps:

  brew tap --force homebrew/core
  cd "$(brew --repository homebrew/core)"
  git checkout -B main origin/main
  git pull
  HOMEBREW_NO_INSTALL_FROM_API=1 brew reinstall --build-from-source git

In my environment, the build finished successfully. The patch doesn't
seem to trigger any issues during a local "make" either. How exactly are
you performing your build?

[1] https://github.com/Homebrew/homebrew-core/blob/9ec3da0dcd3ccd1cd4d892a71377b251770212d7/Formula/g/git.rb

^ permalink raw reply	[flat|nested] 20+ messages in thread

* Re: [PATCH v2] osxkeychain: define build targets in the top-level Makefile.
  2026-02-17  1:09         ` Koji Nakamaru
@ 2026-02-17 13:10           ` D. Ben Knoble
  2026-02-17 13:12             ` D. Ben Knoble
  0 siblings, 1 reply; 20+ messages in thread
From: D. Ben Knoble @ 2026-02-17 13:10 UTC (permalink / raw)
  To: Koji Nakamaru; +Cc: Junio C Hamano, Koji Nakamaru via GitGitGadget, git

On Mon, Feb 16, 2026 at 8:09 PM Koji Nakamaru <koji.nakamaru@gree.net> wrote:
>
> On Tue, Feb 17, 2026 at 8:45 AM D. Ben Knoble <ben.knoble@gmail.com> wrote:
> > ...
> >
> > Homebrew picked this patch on top of 2.53.0, and on a recent build on
> > older macOS I needed to
> >
> >     mkdir contrib/credential/osxkeychain/.depend
> >
> > in order to make their build work, since otherwise:
> >
> >     error: error opening
> > 'contrib/credential/osxkeychain/.depend/git-credential-osxkeychain.o.d':
> > No such file or directory
> >     1 error generated.
> >     make[1]: ***
> > [contrib/credential/osxkeychain/git-credential-osxkeychain.o] Error 1
>
> I tried to reproduce this using the current Homebrew formula for git [1]
> on macOS 15.7.4 and 14.8.4 (both relatively newer) with the following
> steps:
>
>   brew tap --force homebrew/core
>   cd "$(brew --repository homebrew/core)"
>   git checkout -B main origin/main
>   git pull
>   HOMEBREW_NO_INSTALL_FROM_API=1 brew reinstall --build-from-source git
>
> In my environment, the build finished successfully. The patch doesn't
> seem to trigger any issues during a local "make" either. How exactly are
> you performing your build?
>
> [1] https://github.com/Homebrew/homebrew-core/blob/9ec3da0dcd3ccd1cd4d892a71377b251770212d7/Formula/g/git.rb

macOS 12.7.6 ;) hence tier 3 Homebrew support + all packages build
from source. So just

    brew upgrade git

built 2.53.0 + patches from source. "brew --version" says I have
"Homebrew 5.0.14-59-g45db1ce"; it doesn't print a homebrew-core line,
so I'm not sure off-hand if that includes the core tap version or not
anymore.

I ended up having to use `brew upgrade --debug git`, fix the build
error ("mkdir …") and manually perform a few steps when it arose, etc.

-- 
D. Ben Knoble

^ permalink raw reply	[flat|nested] 20+ messages in thread

* Re: [PATCH v2] osxkeychain: define build targets in the top-level Makefile.
  2026-02-17 13:10           ` D. Ben Knoble
@ 2026-02-17 13:12             ` D. Ben Knoble
  2026-02-17 18:05               ` Koji Nakamaru
  0 siblings, 1 reply; 20+ messages in thread
From: D. Ben Knoble @ 2026-02-17 13:12 UTC (permalink / raw)
  To: Koji Nakamaru; +Cc: Junio C Hamano, Koji Nakamaru via GitGitGadget, git

On Tue, Feb 17, 2026 at 8:10 AM D. Ben Knoble <ben.knoble@gmail.com> wrote:
>
> On Mon, Feb 16, 2026 at 8:09 PM Koji Nakamaru <koji.nakamaru@gree.net> wrote:
> >
> > On Tue, Feb 17, 2026 at 8:45 AM D. Ben Knoble <ben.knoble@gmail.com> wrote:
> > > ...
> > >
> > > Homebrew picked this patch on top of 2.53.0, and on a recent build on
> > > older macOS I needed to
> > >
> > >     mkdir contrib/credential/osxkeychain/.depend
> > >
> > > in order to make their build work, since otherwise:
> > >
> > >     error: error opening
> > > 'contrib/credential/osxkeychain/.depend/git-credential-osxkeychain.o.d':
> > > No such file or directory
> > >     1 error generated.
> > >     make[1]: ***
> > > [contrib/credential/osxkeychain/git-credential-osxkeychain.o] Error 1
> >
> > I tried to reproduce this using the current Homebrew formula for git [1]
> > on macOS 15.7.4 and 14.8.4 (both relatively newer) with the following
> > steps:
> >
> >   brew tap --force homebrew/core
> >   cd "$(brew --repository homebrew/core)"
> >   git checkout -B main origin/main
> >   git pull
> >   HOMEBREW_NO_INSTALL_FROM_API=1 brew reinstall --build-from-source git
> >
> > In my environment, the build finished successfully. The patch doesn't
> > seem to trigger any issues during a local "make" either. How exactly are
> > you performing your build?
> >
> > [1] https://github.com/Homebrew/homebrew-core/blob/9ec3da0dcd3ccd1cd4d892a71377b251770212d7/Formula/g/git.rb
>
> macOS 12.7.6 ;) hence tier 3 Homebrew support + all packages build
> from source. So just
>
>     brew upgrade git
>
> built 2.53.0 + patches from source. "brew --version" says I have
> "Homebrew 5.0.14-59-g45db1ce"; it doesn't print a homebrew-core line,
> so I'm not sure off-hand if that includes the core tap version or not
> anymore.

To rule out differing versions, I also diff'd the Homebrew formula
from GitHub against "brew edit git", and the only difference is the
bottle stanza on GitHub.

> I ended up having to use `brew upgrade --debug git`, fix the build
> error ("mkdir …") and manually perform a few steps when it arose, etc.

-- 
D. Ben Knoble

^ permalink raw reply	[flat|nested] 20+ messages in thread

* Re: [PATCH v2] osxkeychain: define build targets in the top-level Makefile.
  2026-02-17 13:12             ` D. Ben Knoble
@ 2026-02-17 18:05               ` Koji Nakamaru
  2026-02-17 21:54                 ` D. Ben Knoble
  0 siblings, 1 reply; 20+ messages in thread
From: Koji Nakamaru @ 2026-02-17 18:05 UTC (permalink / raw)
  To: D. Ben Knoble; +Cc: Junio C Hamano, Koji Nakamaru via GitGitGadget, git

On Tue, Feb 17, 2026 at 10:12 PM D. Ben Knoble <ben.knoble@gmail.com> wrote:
>
> On Tue, Feb 17, 2026 at 8:10 AM D. Ben Knoble <ben.knoble@gmail.com> wrote:
> >
> > On Mon, Feb 16, 2026 at 8:09 PM Koji Nakamaru <koji.nakamaru@gree.net> wrote:
> > >
> > > On Tue, Feb 17, 2026 at 8:45 AM D. Ben Knoble <ben.knoble@gmail.com> wrote:
> > > > ...
> > > >
> > > > Homebrew picked this patch on top of 2.53.0, and on a recent build on
> > > > older macOS I needed to
> > > >
> > > >     mkdir contrib/credential/osxkeychain/.depend
> > > >
> > > > in order to make their build work, since otherwise:
> > > >
> > > >     error: error opening
> > > > 'contrib/credential/osxkeychain/.depend/git-credential-osxkeychain.o.d':
> > > > No such file or directory
> > > >     1 error generated.
> > > >     make[1]: ***
> > > > [contrib/credential/osxkeychain/git-credential-osxkeychain.o] Error 1
> > >
> > > I tried to reproduce this using the current Homebrew formula for git [1]
> > > on macOS 15.7.4 and 14.8.4 (both relatively newer) with the following
> > > steps:
> > >
> > >   brew tap --force homebrew/core
> > >   cd "$(brew --repository homebrew/core)"
> > >   git checkout -B main origin/main
> > >   git pull
> > >   HOMEBREW_NO_INSTALL_FROM_API=1 brew reinstall --build-from-source git
> > >
> > > In my environment, the build finished successfully. The patch doesn't
> > > seem to trigger any issues during a local "make" either. How exactly are
> > > you performing your build?
> > >
> > > [1] https://github.com/Homebrew/homebrew-core/blob/9ec3da0dcd3ccd1cd4d892a71377b251770212d7/Formula/g/git.rb
> >
> > macOS 12.7.6 ;) hence tier 3 Homebrew support + all packages build
> > from source. So just
> >
> >     brew upgrade git
> >
> > built 2.53.0 + patches from source. "brew --version" says I have
> > "Homebrew 5.0.14-59-g45db1ce"; it doesn't print a homebrew-core line,
> > so I'm not sure off-hand if that includes the core tap version or not
> > anymore.
>
> To rule out differing versions, I also diff'd the Homebrew formula
> from GitHub against "brew edit git", and the only difference is the
> bottle stanza on GitHub.
>
> > I ended up having to use `brew upgrade --debug git`, fix the build
> > error ("mkdir …") and manually perform a few steps when it arose, etc.

Thank you for the details. The current Makefile rule performs the
following to generate dependency files

  contrib/credential/osxkeychain/git-credential-osxkeychain.o:
contrib/credential/osxkeychain/git-credential-osxkeychain.c GIT-CFLAGS
          $(QUIET_CC)$(CC) -o $@ -c $(dep_args) $(compdb_args)
$(ALL_CFLAGS) $(EXTRA_CPPFLAGS) $<

where the compiler implicitly creates
contrib/credential/osxkeychain/.depend/ if it doesn't exist. This
behavior seems to be supported at least since Apple clang 15.0.0. The
following should work for older versions of clang that might not support
this behavior.

  contrib/credential/osxkeychain/git-credential-osxkeychain.o:
contrib/credential/osxkeychain/git-credential-osxkeychain.c GIT-CFLAGS
          @mkdir -p contrib/credential/osxkeychain/.depend
          $(QUIET_CC)$(CC) -o $@ -c $(dep_args) $(compdb_args)
$(ALL_CFLAGS) $(EXTRA_CPPFLAGS) $<

Can you try this modification in your environment? You can confirm
whether this works as below.

  git clone https://github.com/git/git.git
  cd git
  git checkout v2.53.0
  curl https://raw.githubusercontent.com/Homebrew/homebrew-core/46d746f92167fd0559af22f4ccb79c9ff35fbe33/Patches/git/2.53.0-osxkeychain-top-level-makefile.patch
| patch

  # The next should fail in your environment.
  make contrib/credential/osxkeychain/git-credential-osxkeychain

  # Please edit Makefile as described and try again. This should
  # succeed.
  make contrib/credential/osxkeychain/git-credential-osxkeychain

--
Koji Nakamaru

^ permalink raw reply	[flat|nested] 20+ messages in thread

* Re: [PATCH v2] osxkeychain: define build targets in the top-level Makefile.
  2026-02-17 18:05               ` Koji Nakamaru
@ 2026-02-17 21:54                 ` D. Ben Knoble
  2026-02-18  4:06                   ` Koji Nakamaru
  0 siblings, 1 reply; 20+ messages in thread
From: D. Ben Knoble @ 2026-02-17 21:54 UTC (permalink / raw)
  To: Koji Nakamaru; +Cc: Junio C Hamano, Koji Nakamaru via GitGitGadget, git

On Tue, Feb 17, 2026 at 1:05 PM Koji Nakamaru <koji.nakamaru@gree.net> wrote:
>
> On Tue, Feb 17, 2026 at 10:12 PM D. Ben Knoble <ben.knoble@gmail.com> wrote:
> >
> > On Tue, Feb 17, 2026 at 8:10 AM D. Ben Knoble <ben.knoble@gmail.com> wrote:
> > >
> > > On Mon, Feb 16, 2026 at 8:09 PM Koji Nakamaru <koji.nakamaru@gree.net> wrote:
> > > >
> > > > On Tue, Feb 17, 2026 at 8:45 AM D. Ben Knoble <ben.knoble@gmail.com> wrote:
> > > > > ...
> > > > >
> > > > > Homebrew picked this patch on top of 2.53.0, and on a recent build on
> > > > > older macOS I needed to
> > > > >
> > > > >     mkdir contrib/credential/osxkeychain/.depend
> > > > >
> > > > > in order to make their build work, since otherwise:
> > > > >
> > > > >     error: error opening
> > > > > 'contrib/credential/osxkeychain/.depend/git-credential-osxkeychain.o.d':
> > > > > No such file or directory
> > > > >     1 error generated.
> > > > >     make[1]: ***
> > > > > [contrib/credential/osxkeychain/git-credential-osxkeychain.o] Error 1
> > > >
> > > > I tried to reproduce this using the current Homebrew formula for git [1]
> > > > on macOS 15.7.4 and 14.8.4 (both relatively newer) with the following
> > > > steps:
> > > >
> > > >   brew tap --force homebrew/core
> > > >   cd "$(brew --repository homebrew/core)"
> > > >   git checkout -B main origin/main
> > > >   git pull
> > > >   HOMEBREW_NO_INSTALL_FROM_API=1 brew reinstall --build-from-source git
> > > >
> > > > In my environment, the build finished successfully. The patch doesn't
> > > > seem to trigger any issues during a local "make" either. How exactly are
> > > > you performing your build?
> > > >
> > > > [1] https://github.com/Homebrew/homebrew-core/blob/9ec3da0dcd3ccd1cd4d892a71377b251770212d7/Formula/g/git.rb
> > >
> > > macOS 12.7.6 ;) hence tier 3 Homebrew support + all packages build
> > > from source. So just
> > >
> > >     brew upgrade git
> > >
> > > built 2.53.0 + patches from source. "brew --version" says I have
> > > "Homebrew 5.0.14-59-g45db1ce"; it doesn't print a homebrew-core line,
> > > so I'm not sure off-hand if that includes the core tap version or not
> > > anymore.
> >
> > To rule out differing versions, I also diff'd the Homebrew formula
> > from GitHub against "brew edit git", and the only difference is the
> > bottle stanza on GitHub.
> >
> > > I ended up having to use `brew upgrade --debug git`, fix the build
> > > error ("mkdir …") and manually perform a few steps when it arose, etc.
>
> Thank you for the details. The current Makefile rule performs the
> following to generate dependency files
>
>   contrib/credential/osxkeychain/git-credential-osxkeychain.o:
> contrib/credential/osxkeychain/git-credential-osxkeychain.c GIT-CFLAGS
>           $(QUIET_CC)$(CC) -o $@ -c $(dep_args) $(compdb_args)
> $(ALL_CFLAGS) $(EXTRA_CPPFLAGS) $<
>
> where the compiler implicitly creates
> contrib/credential/osxkeychain/.depend/ if it doesn't exist. This
> behavior seems to be supported at least since Apple clang 15.0.0.

Aha! I have clang 13. That probably explains it.

> The
> following should work for older versions of clang that might not support
> this behavior.
>
>   contrib/credential/osxkeychain/git-credential-osxkeychain.o:
> contrib/credential/osxkeychain/git-credential-osxkeychain.c GIT-CFLAGS
>           @mkdir -p contrib/credential/osxkeychain/.depend
>           $(QUIET_CC)$(CC) -o $@ -c $(dep_args) $(compdb_args)
> $(ALL_CFLAGS) $(EXTRA_CPPFLAGS) $<
>
> Can you try this modification in your environment? You can confirm
> whether this works as below.
>
>   git clone https://github.com/git/git.git
>   cd git
>   git checkout v2.53.0
>   curl https://raw.githubusercontent.com/Homebrew/homebrew-core/46d746f92167fd0559af22f4ccb79c9ff35fbe33/Patches/git/2.53.0-osxkeychain-top-level-makefile.patch
> | patch

Using git-am worked (patch doesn't apply it)

>   # The next should fail in your environment.
>   make contrib/credential/osxkeychain/git-credential-osxkeychain

Fails as stated.

>   # Please edit Makefile as described and try again. This should
>   # succeed.
>   make contrib/credential/osxkeychain/git-credential-osxkeychain

With the (now obvious!) proposal, indeed succeeds.

Thanks!

-- 
D. Ben Knoble

^ permalink raw reply	[flat|nested] 20+ messages in thread

* Re: [PATCH v2] osxkeychain: define build targets in the top-level Makefile.
  2026-02-17 21:54                 ` D. Ben Knoble
@ 2026-02-18  4:06                   ` Koji Nakamaru
  0 siblings, 0 replies; 20+ messages in thread
From: Koji Nakamaru @ 2026-02-18  4:06 UTC (permalink / raw)
  To: D. Ben Knoble; +Cc: Junio C Hamano, Koji Nakamaru via GitGitGadget, git

On Wed, Feb 18, 2026 at 6:54 AM D. Ben Knoble <ben.knoble@gmail.com> wrote:
>
> On Tue, Feb 17, 2026 at 1:05 PM Koji Nakamaru <koji.nakamaru@gree.net> wrote:
> >
> > On Tue, Feb 17, 2026 at 10:12 PM D. Ben Knoble <ben.knoble@gmail.com> wrote:
> > >
> > > On Tue, Feb 17, 2026 at 8:10 AM D. Ben Knoble <ben.knoble@gmail.com> wrote:
> > > >
> > > > On Mon, Feb 16, 2026 at 8:09 PM Koji Nakamaru <koji.nakamaru@gree.net> wrote:
> > > > >
> > > > > On Tue, Feb 17, 2026 at 8:45 AM D. Ben Knoble <ben.knoble@gmail.com> wrote:
> > > > > > ...
> > > > > >
> > > > > > Homebrew picked this patch on top of 2.53.0, and on a recent build on
> > > > > > older macOS I needed to
> > > > > >
> > > > > >     mkdir contrib/credential/osxkeychain/.depend
> > > > > >
> > > > > > in order to make their build work, since otherwise:
> > > > > >
> > > > > >     error: error opening
> > > > > > 'contrib/credential/osxkeychain/.depend/git-credential-osxkeychain.o.d':
> > > > > > No such file or directory
> > > > > >     1 error generated.
> > > > > >     make[1]: ***
> > > > > > [contrib/credential/osxkeychain/git-credential-osxkeychain.o] Error 1
> > > > >
> > > > > I tried to reproduce this using the current Homebrew formula for git [1]
> > > > > on macOS 15.7.4 and 14.8.4 (both relatively newer) with the following
> > > > > steps:
> > > > >
> > > > >   brew tap --force homebrew/core
> > > > >   cd "$(brew --repository homebrew/core)"
> > > > >   git checkout -B main origin/main
> > > > >   git pull
> > > > >   HOMEBREW_NO_INSTALL_FROM_API=1 brew reinstall --build-from-source git
> > > > >
> > > > > In my environment, the build finished successfully. The patch doesn't
> > > > > seem to trigger any issues during a local "make" either. How exactly are
> > > > > you performing your build?
> > > > >
> > > > > [1] https://github.com/Homebrew/homebrew-core/blob/9ec3da0dcd3ccd1cd4d892a71377b251770212d7/Formula/g/git.rb
> > > >
> > > > macOS 12.7.6 ;) hence tier 3 Homebrew support + all packages build
> > > > from source. So just
> > > >
> > > >     brew upgrade git
> > > >
> > > > built 2.53.0 + patches from source. "brew --version" says I have
> > > > "Homebrew 5.0.14-59-g45db1ce"; it doesn't print a homebrew-core line,
> > > > so I'm not sure off-hand if that includes the core tap version or not
> > > > anymore.
> > >
> > > To rule out differing versions, I also diff'd the Homebrew formula
> > > from GitHub against "brew edit git", and the only difference is the
> > > bottle stanza on GitHub.
> > >
> > > > I ended up having to use `brew upgrade --debug git`, fix the build
> > > > error ("mkdir …") and manually perform a few steps when it arose, etc.
> >
> > Thank you for the details. The current Makefile rule performs the
> > following to generate dependency files
> >
> >   contrib/credential/osxkeychain/git-credential-osxkeychain.o:
> > contrib/credential/osxkeychain/git-credential-osxkeychain.c GIT-CFLAGS
> >           $(QUIET_CC)$(CC) -o $@ -c $(dep_args) $(compdb_args)
> > $(ALL_CFLAGS) $(EXTRA_CPPFLAGS) $<
> >
> > where the compiler implicitly creates
> > contrib/credential/osxkeychain/.depend/ if it doesn't exist. This
> > behavior seems to be supported at least since Apple clang 15.0.0.
>
> Aha! I have clang 13. That probably explains it.
>
> > The
> > following should work for older versions of clang that might not support
> > this behavior.
> >
> >   contrib/credential/osxkeychain/git-credential-osxkeychain.o:
> > contrib/credential/osxkeychain/git-credential-osxkeychain.c GIT-CFLAGS
> >           @mkdir -p contrib/credential/osxkeychain/.depend
> >           $(QUIET_CC)$(CC) -o $@ -c $(dep_args) $(compdb_args)
> > $(ALL_CFLAGS) $(EXTRA_CPPFLAGS) $<
> >
> > Can you try this modification in your environment? You can confirm
> > whether this works as below.
> >
> >   git clone https://github.com/git/git.git
> >   cd git
> >   git checkout v2.53.0
> >   curl https://raw.githubusercontent.com/Homebrew/homebrew-core/46d746f92167fd0559af22f4ccb79c9ff35fbe33/Patches/git/2.53.0-osxkeychain-top-level-makefile.patch
> > | patch
>
> Using git-am worked (patch doesn't apply it)
>
> >   # The next should fail in your environment.
> >   make contrib/credential/osxkeychain/git-credential-osxkeychain
>
> Fails as stated.
>
> >   # Please edit Makefile as described and try again. This should
> >   # succeed.
> >   make contrib/credential/osxkeychain/git-credential-osxkeychain
>
> With the (now obvious!) proposal, indeed succeeds.
>
> Thanks!

Thank you for testing the modification. I'll submit an updated patch
later and also submit it to homebrew (for the current 2.53.0).

--
Koji Nakamaru

^ permalink raw reply	[flat|nested] 20+ messages in thread

* [PATCH v3] osxkeychain: define build targets in the top-level Makefile.
  2026-02-11  1:59 ` [PATCH v2] " Koji Nakamaru via GitGitGadget
  2026-02-11 15:37   ` Junio C Hamano
@ 2026-02-18  5:14   ` Koji Nakamaru via GitGitGadget
  2026-02-18 16:09     ` Kristoffer Haugsbakk
                       ` (2 more replies)
  1 sibling, 3 replies; 20+ messages in thread
From: Koji Nakamaru via GitGitGadget @ 2026-02-18  5:14 UTC (permalink / raw)
  To: git; +Cc: Junio C Hamano, D. Ben Knoble, Koji Nakamaru, Koji Nakamaru

From: Koji Nakamaru <koji.nakamaru@gree.net>

The fix for git-credential-osxkeychain in 4580bcd235 (osxkeychain: avoid
incorrectly skipping store operation) introduced linkage with libgit.a,
and its Makefile was adjusted accordingly. However, the build fails as
of 864f55e190 because several macOS-specific refinements were applied to
the top-level Makefile and config.mak.uname, such as:

  - 363837afe7 (macOS: make Homebrew use configurable, 2025-12-24)
  - cee341e9dd (macOS: use iconv from Homebrew if needed and present,
    2025-12-24)
  - d281241518 (utf8.c: enable workaround for iconv under macOS 14/15,
    2026-01-12)

Since libgit.a and its corresponding header files depend on many flags
defined in the top-level Makefile, these flags must be consistently
defined when building git-credential-osxkeychain. Continuing to manually
adjust the git-credential-osxkeychain Makefile is cumbersome and
fragile.

Define the build targets for git-credential-osxkeychain in the top-level
Makefile and modify its local Makefile to simply rely on those targets.

Helped-by: Junio C Hamano <gitster@pobox.com>
Reported-by: D. Ben Knoble <ben.knoble@gmail.com>
Signed-off-by: Koji Nakamaru <koji.nakamaru@gree.net>
---
    osxkeychain: define build targets in the top-level Makefile.
    
    Changes since v2:
    
     * Squash the double spaces after "-C" into one white.
     * Add explicit mkdir -p contrib/credential/osxkeychain/.depend for
       older versions of clang.

Published-As: https://github.com/gitgitgadget/git/releases/tag/pr-2046%2FKojiNakamaru%2Ffix%2Fosxkeychain-makefile-v3
Fetch-It-Via: git fetch https://github.com/gitgitgadget/git pr-2046/KojiNakamaru/fix/osxkeychain-makefile-v3
Pull-Request: https://github.com/gitgitgadget/git/pull/2046

Range-diff vs v2:

 1:  8c5d75f0c6 ! 1:  25a66e1b7d osxkeychain: define build targets in the top-level Makefile.
     @@ Commit message
          Makefile and modify its local Makefile to simply rely on those targets.
      
          Helped-by: Junio C Hamano <gitster@pobox.com>
     +    Reported-by: D. Ben Knoble <ben.knoble@gmail.com>
          Signed-off-by: Koji Nakamaru <koji.nakamaru@gree.net>
      
       ## Makefile ##
     @@ Makefile: $(LIBGIT_HIDDEN_EXPORT): $(LIBGIT_PARTIAL_EXPORT)
      +		$(filter %.o,$^) $(LIB_FILE) $(EXTLIBS) -framework Security -framework CoreFoundation
      +
      +contrib/credential/osxkeychain/git-credential-osxkeychain.o: contrib/credential/osxkeychain/git-credential-osxkeychain.c GIT-CFLAGS
     ++	@mkdir -p contrib/credential/osxkeychain/.depend
      +	$(QUIET_LINK)$(CC) -o $@ -c $(dep_args) $(compdb_args) $(ALL_CFLAGS) $(EXTRA_CPPFLAGS) $<
      +
      +install-git-credential-osxkeychain: contrib/credential/osxkeychain/git-credential-osxkeychain
     @@ contrib/credential/osxkeychain/Makefile
      --include ../../../config.mak.autogen
      --include ../../../config.mak
      +git-credential-osxkeychain:
     -+	$(MAKE) -C  ../../.. contrib/credential/osxkeychain/git-credential-osxkeychain
     ++	$(MAKE) -C ../../.. contrib/credential/osxkeychain/git-credential-osxkeychain
       
      -ifdef ZLIB_NG
      -	BASIC_CFLAGS += -DHAVE_ZLIB_NG
     @@ contrib/credential/osxkeychain/Makefile
      -../../../libgit.a:
      -	cd ../../..; make libgit.a
      +install:
     -+	$(MAKE) -C  ../../.. install-git-credential-osxkeychain
     ++	$(MAKE) -C ../../.. install-git-credential-osxkeychain
       
       clean:
      -	$(RM) git-credential-osxkeychain git-credential-osxkeychain.o
     -+	$(MAKE) -C  ../../.. clean-git-credential-osxkeychain
     ++	$(MAKE) -C ../../.. clean-git-credential-osxkeychain
       
      -.PHONY: all install clean
      +.PHONY: all git-credential-osxkeychain install clean


 Makefile                                | 18 +++++++
 contrib/credential/osxkeychain/Makefile | 65 +++----------------------
 2 files changed, 24 insertions(+), 59 deletions(-)

diff --git a/Makefile b/Makefile
index 4ac44331ea..1c2019a4cb 100644
--- a/Makefile
+++ b/Makefile
@@ -4060,3 +4060,21 @@ $(LIBGIT_HIDDEN_EXPORT): $(LIBGIT_PARTIAL_EXPORT)
 
 contrib/libgit-sys/libgitpub.a: $(LIBGIT_HIDDEN_EXPORT)
 	$(AR) $(ARFLAGS) $@ $^
+
+contrib/credential/osxkeychain/git-credential-osxkeychain: contrib/credential/osxkeychain/git-credential-osxkeychain.o $(LIB_FILE) GIT-LDFLAGS
+	$(QUIET_LINK)$(CC) $(ALL_CFLAGS) -o $@ $(ALL_LDFLAGS) \
+		$(filter %.o,$^) $(LIB_FILE) $(EXTLIBS) -framework Security -framework CoreFoundation
+
+contrib/credential/osxkeychain/git-credential-osxkeychain.o: contrib/credential/osxkeychain/git-credential-osxkeychain.c GIT-CFLAGS
+	@mkdir -p contrib/credential/osxkeychain/.depend
+	$(QUIET_LINK)$(CC) -o $@ -c $(dep_args) $(compdb_args) $(ALL_CFLAGS) $(EXTRA_CPPFLAGS) $<
+
+install-git-credential-osxkeychain: contrib/credential/osxkeychain/git-credential-osxkeychain
+	$(INSTALL) -d -m 755 '$(DESTDIR_SQ)$(gitexec_instdir_SQ)'
+	$(INSTALL) $(INSTALL_STRIP) $< '$(DESTDIR_SQ)$(gitexec_instdir_SQ)'
+
+.PHONY: clean-git-credential-osxkeychain
+clean-git-credential-osxkeychain:
+	$(RM) \
+		contrib/credential/osxkeychain/git-credential-osxkeychain \
+		contrib/credential/osxkeychain/git-credential-osxkeychain.o
diff --git a/contrib/credential/osxkeychain/Makefile b/contrib/credential/osxkeychain/Makefile
index c68445b82d..219b0d7f49 100644
--- a/contrib/credential/osxkeychain/Makefile
+++ b/contrib/credential/osxkeychain/Makefile
@@ -1,66 +1,13 @@
 # The default target of this Makefile is...
 all:: git-credential-osxkeychain
 
-include ../../../config.mak.uname
--include ../../../config.mak.autogen
--include ../../../config.mak
+git-credential-osxkeychain:
+	$(MAKE) -C ../../.. contrib/credential/osxkeychain/git-credential-osxkeychain
 
-ifdef ZLIB_NG
-	BASIC_CFLAGS += -DHAVE_ZLIB_NG
-        ifdef ZLIB_NG_PATH
-		BASIC_CFLAGS += -I$(ZLIB_NG_PATH)/include
-		EXTLIBS += $(call libpath_template,$(ZLIB_NG_PATH)/$(lib))
-        endif
-	EXTLIBS += -lz-ng
-else
-        ifdef ZLIB_PATH
-		BASIC_CFLAGS += -I$(ZLIB_PATH)/include
-		EXTLIBS += $(call libpath_template,$(ZLIB_PATH)/$(lib))
-        endif
-	EXTLIBS += -lz
-endif
-ifndef NO_ICONV
-        ifdef NEEDS_LIBICONV
-                ifdef ICONVDIR
-			BASIC_CFLAGS += -I$(ICONVDIR)/include
-			ICONV_LINK = $(call libpath_template,$(ICONVDIR)/$(lib))
-                else
-			ICONV_LINK =
-                endif
-                ifdef NEEDS_LIBINTL_BEFORE_LIBICONV
-			ICONV_LINK += -lintl
-                endif
-		EXTLIBS += $(ICONV_LINK) -liconv
-        endif
-endif
-ifndef LIBC_CONTAINS_LIBINTL
-	EXTLIBS += -lintl
-endif
-
-prefix ?= /usr/local
-gitexecdir ?= $(prefix)/libexec/git-core
-
-CC ?= gcc
-CFLAGS ?= -g -O2 -Wall -I../../.. $(BASIC_CFLAGS)
-LDFLAGS ?= $(BASIC_LDFLAGS) $(EXTLIBS)
-INSTALL ?= install
-RM ?= rm -f
-
-%.o: %.c
-	$(CC) $(CFLAGS) $(CPPFLAGS) -o $@ -c $<
-
-git-credential-osxkeychain: git-credential-osxkeychain.o ../../../libgit.a
-	$(CC) $(CFLAGS) -o $@ $^ $(LDFLAGS) \
-		-framework Security -framework CoreFoundation
-
-install: git-credential-osxkeychain
-	$(INSTALL) -d -m 755 $(DESTDIR)$(gitexecdir)
-	$(INSTALL) -m 755 $< $(DESTDIR)$(gitexecdir)
-
-../../../libgit.a:
-	cd ../../..; make libgit.a
+install:
+	$(MAKE) -C ../../.. install-git-credential-osxkeychain
 
 clean:
-	$(RM) git-credential-osxkeychain git-credential-osxkeychain.o
+	$(MAKE) -C ../../.. clean-git-credential-osxkeychain
 
-.PHONY: all install clean
+.PHONY: all git-credential-osxkeychain install clean

base-commit: 864f55e1906897b630333675a52874c0fec2a45c
-- 
gitgitgadget

^ permalink raw reply related	[flat|nested] 20+ messages in thread

* Re: [PATCH v3] osxkeychain: define build targets in the top-level Makefile.
  2026-02-18  5:14   ` [PATCH v3] " Koji Nakamaru via GitGitGadget
@ 2026-02-18 16:09     ` Kristoffer Haugsbakk
  2026-02-18 19:11       ` Koji Nakamaru
  2026-02-18 17:55     ` Junio C Hamano
  2026-02-20  1:39     ` [PATCH v4] " Koji Nakamaru via GitGitGadget
  2 siblings, 1 reply; 20+ messages in thread
From: Kristoffer Haugsbakk @ 2026-02-18 16:09 UTC (permalink / raw)
  To: Koji Nakamaru via GitGitGadget, git
  Cc: Junio C Hamano, D. Ben Knoble, Koji Nakamaru

On Wed, Feb 18, 2026, at 06:14, Koji Nakamaru via GitGitGadget wrote:
> From: Koji Nakamaru <koji.nakamaru@gree.net>
>
> The fix for git-credential-osxkeychain in 4580bcd235 (osxkeychain: avoid
> incorrectly skipping store operation) introduced linkage with libgit.a,

Nitpick: Commit references should have the date:

    4580bcd235 (osxkeychain: avoid incorrectly skipping store operation, 2025-11-14)

Like the rest of the commits you reference here.

> and its Makefile was adjusted accordingly. However, the build fails as
> of 864f55e190 because several macOS-specific refinements were applied to
> the top-level Makefile and config.mak.uname, such as:
>
>   - 363837afe7 (macOS: make Homebrew use configurable, 2025-12-24)
>   - cee341e9dd (macOS: use iconv from Homebrew if needed and present,
>     2025-12-24)
>   - d281241518 (utf8.c: enable workaround for iconv under macOS 14/15,
>     2026-01-12)
>[snip]

^ permalink raw reply	[flat|nested] 20+ messages in thread

* Re: [PATCH v3] osxkeychain: define build targets in the top-level Makefile.
  2026-02-18  5:14   ` [PATCH v3] " Koji Nakamaru via GitGitGadget
  2026-02-18 16:09     ` Kristoffer Haugsbakk
@ 2026-02-18 17:55     ` Junio C Hamano
  2026-02-18 19:14       ` Koji Nakamaru
  2026-02-20  1:39     ` [PATCH v4] " Koji Nakamaru via GitGitGadget
  2 siblings, 1 reply; 20+ messages in thread
From: Junio C Hamano @ 2026-02-18 17:55 UTC (permalink / raw)
  To: Koji Nakamaru via GitGitGadget; +Cc: git, D. Ben Knoble, Koji Nakamaru

"Koji Nakamaru via GitGitGadget" <gitgitgadget@gmail.com> writes:

> +contrib/credential/osxkeychain/git-credential-osxkeychain.o: contrib/credential/osxkeychain/git-credential-osxkeychain.c GIT-CFLAGS
> +	@mkdir -p contrib/credential/osxkeychain/.depend
> +	$(QUIET_LINK)$(CC) -o $@ -c $(dep_args) $(compdb_args) $(ALL_CFLAGS) $(EXTRA_CPPFLAGS) $<

I notice that many other places in the Makefile we seem to use
$(call mkdir_p_parent_template).  Do we want to do so here, too?

Other than that, looking good.  Thanks for updating.

^ permalink raw reply	[flat|nested] 20+ messages in thread

* Re: [PATCH v3] osxkeychain: define build targets in the top-level Makefile.
  2026-02-18 16:09     ` Kristoffer Haugsbakk
@ 2026-02-18 19:11       ` Koji Nakamaru
  0 siblings, 0 replies; 20+ messages in thread
From: Koji Nakamaru @ 2026-02-18 19:11 UTC (permalink / raw)
  To: Kristoffer Haugsbakk
  Cc: Koji Nakamaru via GitGitGadget, git, Junio C Hamano,
	D. Ben Knoble

On Thu, Feb 19, 2026 at 1:10 AM Kristoffer Haugsbakk
<kristofferhaugsbakk@fastmail.com> wrote:
>
> On Wed, Feb 18, 2026, at 06:14, Koji Nakamaru via GitGitGadget wrote:
> > From: Koji Nakamaru <koji.nakamaru@gree.net>
> >
> > The fix for git-credential-osxkeychain in 4580bcd235 (osxkeychain: avoid
> > incorrectly skipping store operation) introduced linkage with libgit.a,
>
> Nitpick: Commit references should have the date:
>
>     4580bcd235 (osxkeychain: avoid incorrectly skipping store operation, 2025-11-14)
>
> Like the rest of the commits you reference here.
>
> > and its Makefile was adjusted accordingly. However, the build fails as
> > of 864f55e190 because several macOS-specific refinements were applied to
> > the top-level Makefile and config.mak.uname, such as:
> >
> >   - 363837afe7 (macOS: make Homebrew use configurable, 2025-12-24)
> >   - cee341e9dd (macOS: use iconv from Homebrew if needed and present,
> >     2025-12-24)
> >   - d281241518 (utf8.c: enable workaround for iconv under macOS 14/15,
> >     2026-01-12)
> >[snip]

I see. I'll fix the commit message in the next reroll.

--
Koji Nakamaru

^ permalink raw reply	[flat|nested] 20+ messages in thread

* Re: [PATCH v3] osxkeychain: define build targets in the top-level Makefile.
  2026-02-18 17:55     ` Junio C Hamano
@ 2026-02-18 19:14       ` Koji Nakamaru
  2026-02-19 15:25         ` Junio C Hamano
  0 siblings, 1 reply; 20+ messages in thread
From: Koji Nakamaru @ 2026-02-18 19:14 UTC (permalink / raw)
  To: Junio C Hamano; +Cc: Koji Nakamaru via GitGitGadget, git, D. Ben Knoble

On Thu, Feb 19, 2026 at 2:55 AM Junio C Hamano <gitster@pobox.com> wrote:
>
> "Koji Nakamaru via GitGitGadget" <gitgitgadget@gmail.com> writes:
>
> > +contrib/credential/osxkeychain/git-credential-osxkeychain.o: contrib/credential/osxkeychain/git-credential-osxkeychain.c GIT-CFLAGS
> > +     @mkdir -p contrib/credential/osxkeychain/.depend
> > +     $(QUIET_LINK)$(CC) -o $@ -c $(dep_args) $(compdb_args) $(ALL_CFLAGS) $(EXTRA_CPPFLAGS) $<
>
> I notice that many other places in the Makefile we seem to use
> $(call mkdir_p_parent_template).  Do we want to do so here, too?
>
> Other than that, looking good.  Thanks for updating.

$(call mkdir_p_parent_tempate) seems to be used for creating the
target's parent directory (e.g., creating
po/build/locale/bg/LC_MESSAGES/ for
po/build/locale/bg/LC_MESSAGES/git.mo).

Since .depend directories are handled via dep_dirs in this Makefile,
how about the following change for consistency?

  diff --git a/Makefile b/Makefile
  index 1c2019a4cb..47485004d8 100644
  --- a/Makefile
  +++ b/Makefile
  @@ -2876,6 +2876,10 @@ objects: $(OBJECTS)
   dep_files := $(foreach f,$(OBJECTS),$(dir $f).depend/$(notdir $f).d)
   dep_dirs := $(addsuffix .depend,$(sort $(dir $(OBJECTS))))

  +ifeq ($(uname_S),Darwin)
  + dep_dirs += $(addsuffix .depend,$(sort $(dir
contrib/credential/osxkeychain/git-credential-osxkeychain.o)))
  +endif
  +
   ifeq ($(COMPUTE_HEADER_DEPENDENCIES),yes)
   $(dep_dirs):
    @mkdir -p $@
  @@ -4066,7 +4070,6 @@
contrib/credential/osxkeychain/git-credential-osxkeychain:
contrib/credential/os
    $(filter %.o,$^) $(LIB_FILE) $(EXTLIBS) -framework Security
-framework CoreFoundation

   contrib/credential/osxkeychain/git-credential-osxkeychain.o:
contrib/credential/osxkeychain/git-credential-osxkeychain.c GIT-CFLAGS
  - @mkdir -p contrib/credential/osxkeychain/.depend
    $(QUIET_LINK)$(CC) -o $@ -c $(dep_args) $(compdb_args)
$(ALL_CFLAGS) $(EXTRA_CPPFLAGS) $<

   install-git-credential-osxkeychain:
contrib/credential/osxkeychain/git-credential-osxkeychain

--
Koji Nakamaru

^ permalink raw reply	[flat|nested] 20+ messages in thread

* Re: [PATCH v3] osxkeychain: define build targets in the top-level Makefile.
  2026-02-18 19:14       ` Koji Nakamaru
@ 2026-02-19 15:25         ` Junio C Hamano
  0 siblings, 0 replies; 20+ messages in thread
From: Junio C Hamano @ 2026-02-19 15:25 UTC (permalink / raw)
  To: Koji Nakamaru; +Cc: Koji Nakamaru via GitGitGadget, git, D. Ben Knoble

Koji Nakamaru <koji.nakamaru@gree.net> writes:

> Since .depend directories are handled via dep_dirs in this Makefile,
> how about the following change for consistency?

Sounds good.  Thanks for spotting.

>
>   diff --git a/Makefile b/Makefile
>   index 1c2019a4cb..47485004d8 100644
>   --- a/Makefile
>   +++ b/Makefile
>   @@ -2876,6 +2876,10 @@ objects: $(OBJECTS)
>    dep_files := $(foreach f,$(OBJECTS),$(dir $f).depend/$(notdir $f).d)
>    dep_dirs := $(addsuffix .depend,$(sort $(dir $(OBJECTS))))
>
>   +ifeq ($(uname_S),Darwin)
>   + dep_dirs += $(addsuffix .depend,$(sort $(dir
> contrib/credential/osxkeychain/git-credential-osxkeychain.o)))
>   +endif
>   +
>    ifeq ($(COMPUTE_HEADER_DEPENDENCIES),yes)
>    $(dep_dirs):
>     @mkdir -p $@
>   @@ -4066,7 +4070,6 @@
> contrib/credential/osxkeychain/git-credential-osxkeychain:
> contrib/credential/os
>     $(filter %.o,$^) $(LIB_FILE) $(EXTLIBS) -framework Security
> -framework CoreFoundation
>
>    contrib/credential/osxkeychain/git-credential-osxkeychain.o:
> contrib/credential/osxkeychain/git-credential-osxkeychain.c GIT-CFLAGS
>   - @mkdir -p contrib/credential/osxkeychain/.depend
>     $(QUIET_LINK)$(CC) -o $@ -c $(dep_args) $(compdb_args)
> $(ALL_CFLAGS) $(EXTRA_CPPFLAGS) $<
>
>    install-git-credential-osxkeychain:
> contrib/credential/osxkeychain/git-credential-osxkeychain
>
> --
> Koji Nakamaru

^ permalink raw reply	[flat|nested] 20+ messages in thread

* [PATCH v4] osxkeychain: define build targets in the top-level Makefile.
  2026-02-18  5:14   ` [PATCH v3] " Koji Nakamaru via GitGitGadget
  2026-02-18 16:09     ` Kristoffer Haugsbakk
  2026-02-18 17:55     ` Junio C Hamano
@ 2026-02-20  1:39     ` Koji Nakamaru via GitGitGadget
  2 siblings, 0 replies; 20+ messages in thread
From: Koji Nakamaru via GitGitGadget @ 2026-02-20  1:39 UTC (permalink / raw)
  To: git
  Cc: Junio C Hamano, D. Ben Knoble, Kristoffer Haugsbakk,
	Koji Nakamaru, Koji Nakamaru

From: Koji Nakamaru <koji.nakamaru@gree.net>

The fix for git-credential-osxkeychain in 4580bcd235 (osxkeychain: avoid
incorrectly skipping store operation, 2025-11-14) introduced linkage
with libgit.a, and its Makefile was adjusted accordingly. However, the
build fails as of 864f55e190 because several macOS-specific refinements
were applied to the top-level Makefile and config.mak.uname, such as:

  - 363837afe7 (macOS: make Homebrew use configurable, 2025-12-24)
  - cee341e9dd (macOS: use iconv from Homebrew if needed and present,
    2025-12-24)
  - d281241518 (utf8.c: enable workaround for iconv under macOS 14/15,
    2026-01-12)

Since libgit.a and its corresponding header files depend on many flags
defined in the top-level Makefile, these flags must be consistently
defined when building git-credential-osxkeychain. Continuing to manually
adjust the git-credential-osxkeychain Makefile is cumbersome and
fragile.

Define the build targets for git-credential-osxkeychain in the top-level
Makefile and modify its local Makefile to simply rely on those targets.

Helped-by: Junio C Hamano <gitster@pobox.com>
Reported-by: D. Ben Knoble <ben.knoble@gmail.com>
Helped-by: Kristoffer Haugsbakk <kristofferhaugsbakk@fastmail.com>
Signed-off-by: Koji Nakamaru <koji.nakamaru@gree.net>
---
    osxkeychain: define build targets in the top-level Makefile.
    
    Changes since v3:
    
     * Add missing commit reference date.
     * Use dep_dirs to create contrib/credential/osxkeychain/.depend.

Published-As: https://github.com/gitgitgadget/git/releases/tag/pr-2046%2FKojiNakamaru%2Ffix%2Fosxkeychain-makefile-v4
Fetch-It-Via: git fetch https://github.com/gitgitgadget/git pr-2046/KojiNakamaru/fix/osxkeychain-makefile-v4
Pull-Request: https://github.com/gitgitgadget/git/pull/2046

Range-diff vs v3:

 1:  25a66e1b7d ! 1:  3c36804348 osxkeychain: define build targets in the top-level Makefile.
     @@ Commit message
          osxkeychain: define build targets in the top-level Makefile.
      
          The fix for git-credential-osxkeychain in 4580bcd235 (osxkeychain: avoid
     -    incorrectly skipping store operation) introduced linkage with libgit.a,
     -    and its Makefile was adjusted accordingly. However, the build fails as
     -    of 864f55e190 because several macOS-specific refinements were applied to
     -    the top-level Makefile and config.mak.uname, such as:
     +    incorrectly skipping store operation, 2025-11-14) introduced linkage
     +    with libgit.a, and its Makefile was adjusted accordingly. However, the
     +    build fails as of 864f55e190 because several macOS-specific refinements
     +    were applied to the top-level Makefile and config.mak.uname, such as:
      
            - 363837afe7 (macOS: make Homebrew use configurable, 2025-12-24)
            - cee341e9dd (macOS: use iconv from Homebrew if needed and present,
     @@ Commit message
      
          Helped-by: Junio C Hamano <gitster@pobox.com>
          Reported-by: D. Ben Knoble <ben.knoble@gmail.com>
     +    Helped-by: Kristoffer Haugsbakk <kristofferhaugsbakk@fastmail.com>
          Signed-off-by: Koji Nakamaru <koji.nakamaru@gree.net>
      
       ## Makefile ##
     +@@ Makefile: objects: $(OBJECTS)
     + dep_files := $(foreach f,$(OBJECTS),$(dir $f).depend/$(notdir $f).d)
     + dep_dirs := $(addsuffix .depend,$(sort $(dir $(OBJECTS))))
     + 
     ++ifeq ($(uname_S),Darwin)
     ++	dep_dirs += $(addsuffix .depend,$(sort $(dir contrib/credential/osxkeychain/git-credential-osxkeychain.o)))
     ++endif
     ++
     + ifeq ($(COMPUTE_HEADER_DEPENDENCIES),yes)
     + $(dep_dirs):
     + 	@mkdir -p $@
      @@ Makefile: $(LIBGIT_HIDDEN_EXPORT): $(LIBGIT_PARTIAL_EXPORT)
       
       contrib/libgit-sys/libgitpub.a: $(LIBGIT_HIDDEN_EXPORT)
     @@ Makefile: $(LIBGIT_HIDDEN_EXPORT): $(LIBGIT_PARTIAL_EXPORT)
      +		$(filter %.o,$^) $(LIB_FILE) $(EXTLIBS) -framework Security -framework CoreFoundation
      +
      +contrib/credential/osxkeychain/git-credential-osxkeychain.o: contrib/credential/osxkeychain/git-credential-osxkeychain.c GIT-CFLAGS
     -+	@mkdir -p contrib/credential/osxkeychain/.depend
      +	$(QUIET_LINK)$(CC) -o $@ -c $(dep_args) $(compdb_args) $(ALL_CFLAGS) $(EXTRA_CPPFLAGS) $<
      +
      +install-git-credential-osxkeychain: contrib/credential/osxkeychain/git-credential-osxkeychain


 Makefile                                | 21 ++++++++
 contrib/credential/osxkeychain/Makefile | 65 +++----------------------
 2 files changed, 27 insertions(+), 59 deletions(-)

diff --git a/Makefile b/Makefile
index 4ac44331ea..47485004d8 100644
--- a/Makefile
+++ b/Makefile
@@ -2876,6 +2876,10 @@ objects: $(OBJECTS)
 dep_files := $(foreach f,$(OBJECTS),$(dir $f).depend/$(notdir $f).d)
 dep_dirs := $(addsuffix .depend,$(sort $(dir $(OBJECTS))))
 
+ifeq ($(uname_S),Darwin)
+	dep_dirs += $(addsuffix .depend,$(sort $(dir contrib/credential/osxkeychain/git-credential-osxkeychain.o)))
+endif
+
 ifeq ($(COMPUTE_HEADER_DEPENDENCIES),yes)
 $(dep_dirs):
 	@mkdir -p $@
@@ -4060,3 +4064,20 @@ $(LIBGIT_HIDDEN_EXPORT): $(LIBGIT_PARTIAL_EXPORT)
 
 contrib/libgit-sys/libgitpub.a: $(LIBGIT_HIDDEN_EXPORT)
 	$(AR) $(ARFLAGS) $@ $^
+
+contrib/credential/osxkeychain/git-credential-osxkeychain: contrib/credential/osxkeychain/git-credential-osxkeychain.o $(LIB_FILE) GIT-LDFLAGS
+	$(QUIET_LINK)$(CC) $(ALL_CFLAGS) -o $@ $(ALL_LDFLAGS) \
+		$(filter %.o,$^) $(LIB_FILE) $(EXTLIBS) -framework Security -framework CoreFoundation
+
+contrib/credential/osxkeychain/git-credential-osxkeychain.o: contrib/credential/osxkeychain/git-credential-osxkeychain.c GIT-CFLAGS
+	$(QUIET_LINK)$(CC) -o $@ -c $(dep_args) $(compdb_args) $(ALL_CFLAGS) $(EXTRA_CPPFLAGS) $<
+
+install-git-credential-osxkeychain: contrib/credential/osxkeychain/git-credential-osxkeychain
+	$(INSTALL) -d -m 755 '$(DESTDIR_SQ)$(gitexec_instdir_SQ)'
+	$(INSTALL) $(INSTALL_STRIP) $< '$(DESTDIR_SQ)$(gitexec_instdir_SQ)'
+
+.PHONY: clean-git-credential-osxkeychain
+clean-git-credential-osxkeychain:
+	$(RM) \
+		contrib/credential/osxkeychain/git-credential-osxkeychain \
+		contrib/credential/osxkeychain/git-credential-osxkeychain.o
diff --git a/contrib/credential/osxkeychain/Makefile b/contrib/credential/osxkeychain/Makefile
index c68445b82d..219b0d7f49 100644
--- a/contrib/credential/osxkeychain/Makefile
+++ b/contrib/credential/osxkeychain/Makefile
@@ -1,66 +1,13 @@
 # The default target of this Makefile is...
 all:: git-credential-osxkeychain
 
-include ../../../config.mak.uname
--include ../../../config.mak.autogen
--include ../../../config.mak
+git-credential-osxkeychain:
+	$(MAKE) -C ../../.. contrib/credential/osxkeychain/git-credential-osxkeychain
 
-ifdef ZLIB_NG
-	BASIC_CFLAGS += -DHAVE_ZLIB_NG
-        ifdef ZLIB_NG_PATH
-		BASIC_CFLAGS += -I$(ZLIB_NG_PATH)/include
-		EXTLIBS += $(call libpath_template,$(ZLIB_NG_PATH)/$(lib))
-        endif
-	EXTLIBS += -lz-ng
-else
-        ifdef ZLIB_PATH
-		BASIC_CFLAGS += -I$(ZLIB_PATH)/include
-		EXTLIBS += $(call libpath_template,$(ZLIB_PATH)/$(lib))
-        endif
-	EXTLIBS += -lz
-endif
-ifndef NO_ICONV
-        ifdef NEEDS_LIBICONV
-                ifdef ICONVDIR
-			BASIC_CFLAGS += -I$(ICONVDIR)/include
-			ICONV_LINK = $(call libpath_template,$(ICONVDIR)/$(lib))
-                else
-			ICONV_LINK =
-                endif
-                ifdef NEEDS_LIBINTL_BEFORE_LIBICONV
-			ICONV_LINK += -lintl
-                endif
-		EXTLIBS += $(ICONV_LINK) -liconv
-        endif
-endif
-ifndef LIBC_CONTAINS_LIBINTL
-	EXTLIBS += -lintl
-endif
-
-prefix ?= /usr/local
-gitexecdir ?= $(prefix)/libexec/git-core
-
-CC ?= gcc
-CFLAGS ?= -g -O2 -Wall -I../../.. $(BASIC_CFLAGS)
-LDFLAGS ?= $(BASIC_LDFLAGS) $(EXTLIBS)
-INSTALL ?= install
-RM ?= rm -f
-
-%.o: %.c
-	$(CC) $(CFLAGS) $(CPPFLAGS) -o $@ -c $<
-
-git-credential-osxkeychain: git-credential-osxkeychain.o ../../../libgit.a
-	$(CC) $(CFLAGS) -o $@ $^ $(LDFLAGS) \
-		-framework Security -framework CoreFoundation
-
-install: git-credential-osxkeychain
-	$(INSTALL) -d -m 755 $(DESTDIR)$(gitexecdir)
-	$(INSTALL) -m 755 $< $(DESTDIR)$(gitexecdir)
-
-../../../libgit.a:
-	cd ../../..; make libgit.a
+install:
+	$(MAKE) -C ../../.. install-git-credential-osxkeychain
 
 clean:
-	$(RM) git-credential-osxkeychain git-credential-osxkeychain.o
+	$(MAKE) -C ../../.. clean-git-credential-osxkeychain
 
-.PHONY: all install clean
+.PHONY: all git-credential-osxkeychain install clean

base-commit: 864f55e1906897b630333675a52874c0fec2a45c
-- 
gitgitgadget

^ permalink raw reply related	[flat|nested] 20+ messages in thread

end of thread, other threads:[~2026-02-20  1:39 UTC | newest]

Thread overview: 20+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-02-10 18:01 [PATCH] osxkeychain: define build targets in the top-level Makefile Koji Nakamaru via GitGitGadget
2026-02-10 19:50 ` Junio C Hamano
2026-02-10 23:16   ` Koji Nakamaru
2026-02-11  1:59 ` [PATCH v2] " Koji Nakamaru via GitGitGadget
2026-02-11 15:37   ` Junio C Hamano
2026-02-11 23:06     ` Koji Nakamaru
2026-02-16 23:45       ` D. Ben Knoble
2026-02-17  1:09         ` Koji Nakamaru
2026-02-17 13:10           ` D. Ben Knoble
2026-02-17 13:12             ` D. Ben Knoble
2026-02-17 18:05               ` Koji Nakamaru
2026-02-17 21:54                 ` D. Ben Knoble
2026-02-18  4:06                   ` Koji Nakamaru
2026-02-18  5:14   ` [PATCH v3] " Koji Nakamaru via GitGitGadget
2026-02-18 16:09     ` Kristoffer Haugsbakk
2026-02-18 19:11       ` Koji Nakamaru
2026-02-18 17:55     ` Junio C Hamano
2026-02-18 19:14       ` Koji Nakamaru
2026-02-19 15:25         ` Junio C Hamano
2026-02-20  1:39     ` [PATCH v4] " Koji Nakamaru via GitGitGadget

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox