forked from tedsta/rust-opencl
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Makefile
65 lines (43 loc) · 895 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
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
ifndef RUSTC
RUSTC = rustc
endif
ifndef TARGET_DIR
TARGET_DIR = target/
endif
RUSTC_OPTS = -g -L $(TARGET_DIR) --out-dir $(TARGET_DIR)
OPENCL_SRC = \
lib.rs \
CL.rs \
error.rs \
hl.rs \
util.rs \
mem.rs \
array.rs
OPENCL_ROOT = $(shell pwd)
.PHONY: all
all: lib
.PHONY: debug
debug: lib demo
gdb --cd=./ target/demo
.PHONY: lib
lib: target_dir $(TARGET_DIR)libopencl.rlib
$(TARGET_DIR)libopencl.rlib: src/*
rustc $(RUSTC_OPTS) src/lib.rs
.PHONY: target_dir
target_dir: $(TARGET_DIR)
$(TARGET_DIR):
mkdir -p $(TARGET_DIR)
.PHONY: demo
demo: target_dir $(TARGET_DIR)demo
$(TARGET_DIR)demo: $(TARGET_DIR)libopencl.rlib test/demo.rs
env OPENCL_ROOT=$(OPENCL_ROOT) rustc $(RUSTC_OPTS) test/demo.rs
.PHONY: check
check: lib
rustc $(RUSTC_OPTS) --test test/test.rs
$(TARGET_DIR)test
.PHONY: clean
clean:
rm -rf $(TARGET_DIR)
.PHONY: docs
docs:
rustdoc src/lib.rs