forked from zargony/fuse-rs
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Makefile
41 lines (27 loc) · 830 Bytes
/
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
RUSTC ?= rustc
ifdef DEBUG
RUSTFLAGS ?= -g
else
RUSTFLAGS ?= -O --cfg ndebug
endif
LIBFUSE := $(patsubst %,build/%,$(shell $(RUSTC) --crate-file-name src/lib.rs))
all: $(LIBFUSE)
check: build/libfuse_test
build/libfuse_test
clean:
rm -rf build
.PHONY: all check clean
$(LIBFUSE): src/lib.rs
mkdir -p build
$(RUSTC) $(RUSTFLAGS) --dep-info build/libfuse.d --out-dir $(dir $@) $<
-include build/libfuse.d
build/libfuse_test: src/lib.rs
mkdir -p build
$(RUSTC) $(RUSTFLAGS) --dep-info build/libfuse_test.d --test -o $@ $<
-include build/libfuse_test.d
EXAMPLE_SRCS := $(wildcard examples/*.rs)
EXAMPLE_BINS := $(patsubst examples/%.rs,build/%,$(EXAMPLE_SRCS))
examples: $(EXAMPLE_BINS)
.PHONY: examples
$(EXAMPLE_BINS): build/%: examples/%.rs $(LIBFUSE)
$(RUSTC) $(RUSTFLAGS) -L build -C prefer-dynamic -o $@ $<