forked from logicalclocks/hopsfs-go-mount
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Makefile
34 lines (26 loc) · 1.28 KB
/
Makefile
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
# Copyright (c) Microsoft. All rights reserved.
# Copyright (c) Hopsworks AB. All rights reserved.
# Licensed under the MIT license. See LICENSE file in the project root for details.
GITCOMMIT=`git rev-parse --short HEAD`
BUILDTIME=`date +%FT%T%z`
HOSTNAME=`hostname`
VERSION=$(shell grep "VERSION" internal/hopsfsmount/Version.go | awk '{ print $$3 }' | tr -d \")
TEST?=Test
TEST_PACKAGE?=./...
all: hopsfs-mount
hopsfs-mount:
go build -tags osusergo,netgo -ldflags="-w -X hopsworks.ai/hopsfsmount/internal/hopsfsmount.GITCOMMIT=${GITCOMMIT} -X hopsworks.ai/hopsfsmount/internal/hopsfsmount.BUILDTIME=${BUILDTIME} -X hopsworks.ai/hopsfsmount/internal/hopsfsmount.HOSTNAME=${HOSTNAME}" -o bin/hops-fuse-mount-${VERSION} ./cmd/main.go
chmod +x bin/hops-fuse-mount-${VERSION}
clean:
rm -f bin/* \
mock_%_test.go: %.go
mockgen -source $< -package hopsfsmount -self_package=hopsworks.ai/hopsfsmount/internal/hopsfsmount > $@~
mv -f $@~ $@
mock: hopsfs-mount \
internal/hopsfsmount/mock_HdfsAccessor_test.go \
internal/hopsfsmount/mock_ReadSeekCloser_test.go \
internal/hopsfsmount/mock_HdfsWriter_test.go \
internal/hopsfsmount/mock_FaultTolerantHdfsAccessor_test.go
test: mock
go clean -testcache
go test -v -p 1 -run $(TEST) -coverprofile coverage.txt `go list $(TEST_PACKAGE) | grep -v cmd`