-
Notifications
You must be signed in to change notification settings - Fork 7
Expand file tree
/
Copy pathMakefile
More file actions
69 lines (58 loc) · 1.13 KB
/
Makefile
File metadata and controls
69 lines (58 loc) · 1.13 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
68
69
TARGET = release
PREFIX = /usr/local
LIBDIR = "$(PREFIX)/lib"
all: remote
local:
ifeq ($(TARGET), release)
cargo build --release --no-default-features --features=local-run
else
cargo build --no-default-features --features=local-run
endif
remote:
ifeq ($(TARGET), release)
cargo build --release
else
cargo build
endif
c: install
install -m 0644 bindings/c/inapi.h $(PREFIX)/include/
php5: c
cd bindings/php5
phpize
./configure
make
make install
cd ../..
php7: c
cd bindings/php7
phpize
./configure
make
make install
cd ../..
install:
if [ -f target/$(TARGET)/libinapi.dylib ]; then \
install -m 0644 target/$(TARGET)/libinapi.dylib $(LIBDIR)/; \
else \
install -m 0644 target/$(TARGET)/libinapi.so $(LIBDIR)/; \
fi
uninstall:
if [ -f $(LIBDIR)/libinapi.dylib ]; then \
rm -f $(LIBDIR)/libinapi.dylib; \
else \
rm -f $(LIBDIR)/libinapi.so; \
fi
test-local:
ifeq ($(TARGET), release)
cargo test --release --no-default-features --features=local-run
else
cargo test --no-default-features --features=local-run
endif
test-remote:
ifeq ($(TARGET), release)
cargo test --release
else
cargo test
endif
clean:
cargo clean