2020-11-27 09:52:19 +08:00
|
|
|
CFLAGS := -I/usr/local/include -fPIC
|
|
|
|
LDFLAGS := -shared
|
|
|
|
|
|
|
|
UNAME_S := $(shell uname -s)
|
|
|
|
|
|
|
|
ifeq ($(UNAME_S),Darwin)
|
|
|
|
LDFLAGS += -undefined dynamic_lookup
|
|
|
|
endif
|
|
|
|
|
2018-01-09 23:13:18 +08:00
|
|
|
all:
|
2020-11-27 09:52:19 +08:00
|
|
|
@echo "Bulding for $(UNAME_S)"
|
|
|
|
env CGO_CFLAGS="$(CFLAGS)" go build -buildmode=c-archive go-auth.go
|
|
|
|
env CGO_LDFLAGS="$(LDFLAGS)" go build -buildmode=c-shared -o go-auth.so
|
2017-12-01 05:10:17 +08:00
|
|
|
go build pw-gen/pw.go
|
|
|
|
|
2023-05-24 10:07:54 +08:00
|
|
|
without-vcs:
|
|
|
|
@echo "Bulding for $(UNAME_S)"
|
|
|
|
env CGO_CFLAGS="$(CFLAGS)" go build -buildvcs=false -buildmode=c-archive go-auth.go
|
|
|
|
env CGO_LDFLAGS="$(LDFLAGS)" go build -buildvcs=false -buildmode=c-shared -o go-auth.so
|
|
|
|
go build -buildvcs=false pw-gen/pw.go
|
|
|
|
|
2017-12-11 23:18:21 +08:00
|
|
|
test:
|
2021-04-04 06:21:29 +08:00
|
|
|
cd plugin && make
|
2020-11-27 09:52:19 +08:00
|
|
|
go test ./backends ./cache ./hashing -v -count=1
|
2021-04-04 06:21:29 +08:00
|
|
|
rm plugin/*.so
|
2018-01-04 02:39:11 +08:00
|
|
|
|
2020-11-27 09:52:19 +08:00
|
|
|
test-backends:
|
2021-04-04 06:21:29 +08:00
|
|
|
cd plugin && make
|
2020-11-27 09:52:19 +08:00
|
|
|
go test ./backends -v -failfast -count=1
|
2021-04-04 06:21:29 +08:00
|
|
|
rm plugin/*.so
|
2020-11-27 09:52:19 +08:00
|
|
|
|
|
|
|
test-cache:
|
|
|
|
go test ./cache -v -failfast -count=1
|
|
|
|
|
|
|
|
test-hashing:
|
|
|
|
go test ./hashing -v -failfast -count=1
|
2019-06-14 05:55:21 +08:00
|
|
|
|
|
|
|
service:
|
|
|
|
@echo "Generating gRPC code from .proto files"
|
2020-11-27 09:52:19 +08:00
|
|
|
@go generate grpc/grpc.go
|
|
|
|
|
|
|
|
clean:
|
|
|
|
rm -f go-auth.h
|
|
|
|
rm -f go-auth.so
|
|
|
|
rm -f pw
|