add lib package and make task to build shared lib

This commit is contained in:
Andrea Franz 2021-08-31 13:10:44 +02:00
parent 957c095369
commit 2e0f5457d2
No known key found for this signature in database
GPG Key ID: 4F0D2F2D9DE7F29D
2 changed files with 13 additions and 0 deletions

View File

@ -1,7 +1,16 @@
.PHONY: test
GOBIN=./build
deps:
go get -t ./...
test:
go test -v ./...
keycard-lib: ##@cross-compile Build keycard-go as static library for current platform
mkdir -p $(GOBIN)/libkeycard
@echo "Building static library..."
go build -buildmode c-shared -o $(GOBIN)/libkeycard/libkeycard.so ./cmd/lib
@echo "Static library built:"
@ls -la $(GOBIN)/libkeycard/*

4
cmd/lib/main.go Normal file
View File

@ -0,0 +1,4 @@
package main
func main() {
}