-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy pathMakefile
More file actions
67 lines (46 loc) · 1.38 KB
/
Makefile
File metadata and controls
67 lines (46 loc) · 1.38 KB
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
REDDIO_DEV_OPTIONS=--manifest-path=reddio/Cargo.toml
OUTPUT_DIR=./output
OUTPUT_HEADER_DIR=./output/include
OUTPUT_LIB_DIR=./output/lib
export CGO_ENABLED=1
build: build-reddio build-reddio-go
release: release-reddio build-reddio-go
clean: clean-reddio
rm -rf output
check: check-reddio build-reddio-go
test: test-reddio test-reddio-go
fmt: fmt-reddio fmt-reddio-go
lint: lint-reddio lint-reddio-go
build-reddio: generate-header
mkdir -p $(OUTPUT_LIB_DIR)
cargo build $(REDDIO_DEV_OPTIONS)
cp reddio/target/debug/libreddio.* $(OUTPUT_LIB_DIR)
release-reddio: generate-header
mkdir -p $(OUTPUT_LIB_DIR)
cargo build $(REDDIO_DEV_OPTIONS) --release
cp reddio/target/release/libreddio.* $(OUTPUT_LIB_DIR)
clean-reddio:
cargo clean $(REDDIO_DEV_OPTIONS)
check-reddio:
cargo check $(REDDIO_DEV_OPTIONS)
test-reddio:
cargo test $(REDDIO_DEV_OPTIONS)
fmt-reddio:
cargo fmt $(REDDIO_DEV_OPTIONS)
lint-reddio:
cargo clippy $(REDDIO_DEV_OPTIONS)
cbindgen:
mkdir -p $(OUTPUT_DIR)
cargo install cbindgen --root $(OUTPUT_DIR)
chmod +x $(OUTPUT_DIR)/bin/cbindgen
generate-header: cbindgen
mkdir -p $(OUTPUT_HEADER_DIR)
$(OUTPUT_DIR)/bin/cbindgen --lang c reddio/src/lib.rs -o $(OUTPUT_HEADER_DIR)/reddio.h
build-reddio-go: build-reddio
cd reddio-go && go build
test-reddio-go: build-reddio
cd reddio-go && go test
fmt-reddio-go:
cd reddio-go && go fmt
lint-reddio-go:
cd reddio-go && go vet