Skip to content

Commit 4273758

Browse files
committed
Merge branch 'tu/credential-makefile-updates'
Build procedure for a few credential helpers (in contrib/) have been updated. * tu/credential-makefile-updates: contrib/credential: harmonize Makefiles
2 parents e7909b3 + 9b8ff6d commit 4273758

File tree

2 files changed

+27
-23
lines changed

2 files changed

+27
-23
lines changed
Lines changed: 14 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -1,28 +1,27 @@
11
# The default target of this Makefile is...
2-
all::
3-
4-
MAIN:=git-credential-libsecret
5-
all:: $(MAIN)
6-
7-
CC = gcc
8-
RM = rm -f
9-
CFLAGS = -g -O2 -Wall
10-
PKG_CONFIG = pkg-config
2+
all:: git-credential-libsecret
113

124
-include ../../../config.mak.autogen
135
-include ../../../config.mak
146

7+
prefix ?= /usr/local
8+
gitexecdir ?= $(prefix)/libexec/git-core
9+
10+
CC ?= gcc
11+
CFLAGS ?= -g -O2 -Wall
12+
PKG_CONFIG ?= pkg-config
13+
RM ?= rm -f
14+
1515
INCS:=$(shell $(PKG_CONFIG) --cflags libsecret-1 glib-2.0)
1616
LIBS:=$(shell $(PKG_CONFIG) --libs libsecret-1 glib-2.0)
1717

18-
SRCS:=$(MAIN).c
19-
OBJS:=$(SRCS:.c=.o)
20-
2118
%.o: %.c
2219
$(CC) $(CFLAGS) $(CPPFLAGS) $(INCS) -o $@ -c $<
2320

24-
$(MAIN): $(OBJS)
25-
$(CC) -o $@ $(LDFLAGS) $^ $(LIBS)
21+
git-credential-libsecret: git-credential-libsecret.o
22+
$(CC) $(CFLAGS) -o $@ $^ $(LDFLAGS) $(LIBS)
2623

2724
clean:
28-
@$(RM) $(MAIN) $(OBJS)
25+
$(RM) git-credential-libsecret git-credential-libsecret.o
26+
27+
.PHONY: all clean
Lines changed: 13 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,19 +1,24 @@
11
# The default target of this Makefile is...
22
all:: git-credential-osxkeychain
33

4-
CC = gcc
5-
RM = rm -f
6-
CFLAGS = -g -O2 -Wall
7-
84
-include ../../../config.mak.autogen
95
-include ../../../config.mak
106

7+
prefix ?= /usr/local
8+
gitexecdir ?= $(prefix)/libexec/git-core
9+
10+
CC ?= gcc
11+
CFLAGS ?= -g -O2 -Wall
12+
RM ?= rm -f
13+
14+
%.o: %.c
15+
$(CC) $(CFLAGS) $(CPPFLAGS) -o $@ -c $<
16+
1117
git-credential-osxkeychain: git-credential-osxkeychain.o
12-
$(CC) $(CFLAGS) -o $@ $< $(LDFLAGS) \
18+
$(CC) $(CFLAGS) -o $@ $^ $(LDFLAGS) \
1319
-framework Security -framework CoreFoundation
1420

15-
git-credential-osxkeychain.o: git-credential-osxkeychain.c
16-
$(CC) -c $(CFLAGS) $<
17-
1821
clean:
1922
$(RM) git-credential-osxkeychain git-credential-osxkeychain.o
23+
24+
.PHONY: all clean

0 commit comments

Comments
 (0)