forked from microsoft/hdfs-mount
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Makefile
48 lines (35 loc) · 1.61 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
35
36
37
38
39
40
41
42
43
44
45
46
47
48
# Copyright (c) Microsoft. All rights reserved.
# Licensed under the MIT license. See LICENSE file in the project root for details.
export GOPATH=$(PWD)/_gopath
all: hdfs-mount
hdfs-mount: *.go $(GOPATH)/src/bazil.org/fuse $(GOPATH)/src/github.com/colinmarc/hdfs $(GOPATH)/src/golang.org/x/net/context $(GOPATH)/src/github.com/golang/protobuf/proto
go build
$(GOPATH)/src/bazil.org/fuse: $(GOPATH)/src/github.com/bazil/fuse
ln -s $(GOPATH)/src/github.com/bazil $(GOPATH)/src/bazil.org
$(GOPATH)/src/github.com/colinmarc/hdfs:
[ -f submodules/colinmarc-hdfs/.git ] || { echo "ERROR: Please clone hdfs-mount repository recursively: git clone http://github.com/Microsoft/hdfs-mount --recursive"; exit 1; }
mkdir -p $(shell dirname $@)
ln -s ../../../../submodules/colinmarc-hdfs $@
$(GOPATH)/src/github.com/bazil/fuse:
go get github.com/bazil/fuse || [ -f $(GOPATH)/src/github.com/bazil/fuse/fuse.go ] && echo Ignore the error above - this is expected
$(GOPATH)/src/%:
go get $*
MOCKGEN_DIR=$(GOPATH)/src/github.com/golang/mock/mockgen
$(MOCKGEN_DIR)/mockgen.go:
go get github.com/golang/mock/mockgen
$(MOCKGEN_DIR)/mockgen: $(MOCKGEN_DIR)/mockgen.go
cd $(MOCKGEN_DIR) && go build
ls -la $(MOCKGEN_DIR)/mockgen
clean:
rm -f hdfs-mount _mock_*.go
mock_%_test.go: %.go | $(MOCKGEN_DIR)/mockgen
$(MOCKGEN_DIR)/mockgen -source $< -package main > $@~
mv -f $@~ $@
test: hdfs-mount \
$(GOPATH)/src/github.com/stretchr/testify/assert \
$(GOPATH)/src/github.com/golang/mock/gomock \
$(MOCKGEN_DIR)/mockgen \
mock_HdfsAccessor_test.go \
mock_ReadSeekCloser_test.go \
mock_HdfsWriter_test.go
go test