-
Notifications
You must be signed in to change notification settings - Fork 7
Expand file tree
/
Copy pathMakefile
More file actions
56 lines (47 loc) · 1.02 KB
/
Makefile
File metadata and controls
56 lines (47 loc) · 1.02 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
UNAME_S := $(shell uname -s)
CARGO := $(shell which cargo)
TARGET = release
USRPATH = /usr/local
LIBEXT = so
ifeq ($(UNAME_S), Linux)
FEDORA := $(grep -qs Fedora /etc/redhat-release)
ifeq ($$?, 0)
USRPATH = /usr/local
export PATH := $(USRPATH)/bin:$(PATH)
else
USRPATH = /usr
endif
else ifeq ($(UNAME_S), Darwin)
LIBEXT = dylib
endif
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
install:
install -m 0644 target/$(TARGET)/libinapi.$(LIBEXT) $(USRPATH)/lib/
uninstall:
rm -f $(USRPATH)/lib/libinapi.$(LIBEXT)
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