Skip to content

Instantly share code, notes, and snippets.

@mrosset
Created March 15, 2011 21:21
Show Gist options
  • Save mrosset/871511 to your computer and use it in GitHub Desktop.
Save mrosset/871511 to your computer and use it in GitHub Desktop.
include $(GOROOT)/src/Make.inc
export LD_LIBRARY_PATH := libgit2/build/shared
TARG=git
CGOFILES=git.go
GOFILES=defs.go
CGO_CFLAGS:=`pkg-config --cflags libgit2`
CGO_LDFLAGS=`pkg-config --libs libgit2`
CFLAGS:=`pkg-config --cflags libgit2`
LDFLAGS=`pkg-config --libs libgit2`
CLEANFILES+=defs.go ./tmp ctest
.PHONY: libgit2
include $(GOROOT)/src/Make.pkg
libgit2:
make -C $@
ctest: clean ctest.c
gcc -g -O0 -Wall $(CFLAGS) $(LDFLAGS) [email protected] -o $@
./$@
defs.go: defs.c
godefs -g git defs.c > defs.go
format: *.go
gofmt -l -w *.go
all: test
defs.go: defs.c
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment