-
Notifications
You must be signed in to change notification settings - Fork 39
/
Makefile.in
94 lines (79 loc) · 3.01 KB
/
Makefile.in
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
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
# Copyright 2019 Google Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may not
# use this file except in compliance with the License. You may obtain a copy
# of the License at:
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
# License for the specific language governing permissions and limitations
# under the License.
.PHONY: all
all: Makefile debug
CARGO_FLAGS = --features "$(FEATURES)"
# TODO(jmmv): Should automatically reinvoke configure... but this is difficult
# because we need to remember the flags originally passed by the user, and
# we need to tell make to reload the Makefile somehow.
Makefile: configure Makefile.in
@echo "Makefile out of date; rerun ./configure with desired args"
@false
@IS_BMAKE@RUST_SRCS != find src -name "*.rs"
@IS_GNUMAKE@RUST_SRCS = $(shell find src -name "*.rs")
target/debug/sandboxfs: Cargo.toml $(RUST_SRCS)
$(CARGO) build $(CARGO_FLAGS)
.PHONY: debug
debug: target/debug/sandboxfs
.PHONY: release
release: target/release/sandboxfs
target/release/sandboxfs: Cargo.toml $(RUST_SRCS)
$(CARGO) build $(CARGO_FLAGS) --release
.PHONY: check
check: check-unit check-integration
check-unit: Cargo.toml $(RUST_SRCS)
RUST_BACKTRACE=full $(CARGO) test $(CARGO_FLAGS) --verbose
SANDBOXFS_BINARY = $$(pwd)/target/debug/sandboxfs
@IS_BMAKE@GO_SRCS != find integration -name "*.go"
@IS_GNUMAKE@GO_SRCS = $(shell find integration -name "*.go")
check-integration: target/debug/sandboxfs $(GO_SRCS)
@if [ -n "$(GOROOT)" ]; then \
set -x; \
GOPATH=$(GOPATH) GOROOT=$(GOROOT) $(GOROOT)/bin/go test \
-v -timeout=600s \
github.com/bazelbuild/sandboxfs/integration \
-features="$(FEATURES)" \
-sandboxfs_binary="$(SANDBOXFS_BINARY)" \
$(CHECK_INTEGRATION_FLAGS); \
else \
echo "WARNING: Go not enabled; integration tests not run"; \
fi
.PHONY: lint
lint:
$(CARGO) clippy $(CARGO_FLAGS) --all-features --all-targets \
-- -D warnings
@if [ -n "$(GOROOT)" ]; then \
set -x; \
PATH=$(GOPATH)/bin:$${PATH} GOPATH=$(GOPATH) GOROOT=$(GOROOT) \
$(GOROOT)/bin/go run \
github.com/bazelbuild/sandboxfs/admin/lint $(LINT_FILES); \
else \
echo "WARNING: Go not enabled; linter not run"; \
fi
.PHONY: install
install: target/release/sandboxfs
install -m 0755 -d $(DESTDIR)$(PREFIX)/bin
install -m 0755 -c target/release/sandboxfs \
$(DESTDIR)$(PREFIX)/bin/sandboxfs
install -m 0755 -d $(DESTDIR)$(PREFIX)/share/man/man1
install -m 0644 -c man/sandboxfs.1 $(DESTDIR)$(PREFIX)/share/man/man1
install -m 0755 -d $(DESTDIR)$(PREFIX)/share/doc/sandboxfs
install -m 0644 -c AUTHORS CONTRIBUTING.md CONTRIBUTORS LICENSE \
NEWS.md README.md $(DESTDIR)$(PREFIX)/share/doc/sandboxfs
.PHONY: clean
clean:
rm -rf $(CLEANFILES)
.PHONY: distclean
distclean: clean
rm -rf $(DISTCLEANFILES)