| 1 | # The default target of this Makefile is... |
| 2 | all:: git-credential-libsecret |
| 3 | |
| 4 | -include ../../../config.mak.autogen |
| 5 | -include ../../../config.mak |
| 6 | |
| 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 | INSTALL ?= install |
| 14 | RM ?= rm -f |
| 15 | |
| 16 | INCS:=$(shell $(PKG_CONFIG) --cflags libsecret-1 glib-2.0) |
| 17 | LIBS:=$(shell $(PKG_CONFIG) --libs libsecret-1 glib-2.0) |
| 18 | |
| 19 | %.o: %.c |
| 20 | $(CC) $(CFLAGS) $(CPPFLAGS) $(INCS) -o $@ -c $< |
| 21 | |
| 22 | git-credential-libsecret: git-credential-libsecret.o |
| 23 | $(CC) $(CFLAGS) -o $@ $^ $(LDFLAGS) $(LIBS) |
| 24 | |
| 25 | install: git-credential-libsecret |
| 26 | $(INSTALL) -d -m 755 $(DESTDIR)$(gitexecdir) |
| 27 | $(INSTALL) -m 755 $< $(DESTDIR)$(gitexecdir) |
| 28 | |
| 29 | clean: |
| 30 | $(RM) git-credential-libsecret git-credential-libsecret.o |
| 31 | |
| 32 | .PHONY: all install clean |