Fixed generate makefile target

This commit is contained in:
Kirill 2021-11-08 17:09:24 +03:00
parent 0cbbc1dc99
commit 0e14c5c3cd
No known key found for this signature in database
GPG Key ID: 91CCC23DB8680D12
1 changed files with 4 additions and 14 deletions

View File

@ -2,6 +2,10 @@ TEST_ARGS ?= --count=1
default: test
generate: static-build/install/lib/libgit2.a
go generate --tags "static" ./...
# System library
# ==============
# This uses whatever version of libgit2 can be found in the system.
@ -53,17 +57,3 @@ test-static: static-build/install/lib/libgit2.a
install-static: static-build/install/lib/libgit2.a
go install --tags "static" ./...
define _gen_file
rm -fr _obj
go tool cgo $(1)
find ./_obj -type f ! -name '*.go' -exec rm {} \;
mv ./_obj/_cgo_gotypes.go ./_obj/cgo_gotypes.go
cd ./_obj && go generate ./...
find ./_obj -type f -name '*_string.go' -exec mv -v {} . \;
rm -fr ./_obj
endef
generate:
$(call _gen_file,diff.go)
$(call _gen_file,git.go)