This repository was archived by the owner on Dec 3, 2017. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy pathMakefile
More file actions
50 lines (45 loc) · 1.42 KB
/
Makefile
File metadata and controls
50 lines (45 loc) · 1.42 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
TARGET = release
PREFIX = /usr/local
SYSCONFDIR = "$(PREFIX)/etc"
all:
ifeq ($(TARGET), release)
cargo build --release
else
cargo build
endif
install:
mkdir -p $(SYSCONFDIR)/intecture
sed 's~{{sysconfdir}}~$(SYSCONFDIR)~' resources/agent.json.tpl > $(SYSCONFDIR)/intecture/agent.json
chmod 0644 $(SYSCONFDIR)/intecture/agent.json
install -m 0755 target/$(TARGET)/inagent $(PREFIX)/bin/
if [ -f /etc/rc.conf ]; then \
install -m 555 resources/init/freebsd /etc/rc.d/inagent; \
elif stat --format=%N /proc/1/exe|grep -qs systemd ; then \
if [ -d /usr/lib/systemd/system ]; then \
install -m 644 resources/init/systemd /usr/lib/systemd/system/inagent.service; \
elif [ -d /lib/systemd/system ]; then \
install -m 644 resources/init/systemd /lib/systemd/system/inagent.service; \
fi; \
elif [ -f /etc/redhat-release ]; then \
install -m 755 resources/init/redhat /etc/init.d/inagent; \
elif [ -f /etc/debian_version ]; then \
install -m 755 resources/init/debian /etc/init.d/inagent; \
fi;
uninstall:
rm -f $(PREFIX)/bin/inagent \
$(SYSCONFDIR)/intecture/agent.json \
/lib/systemd/system/inagent.service \
/usr/lib/systemd/system/inagent.service \
/etc/init.d/inagent \
/etc/rc.d/inagent;
if [ -d $SYSCONFDIR/intecture -a -z "$(ls -A $SYSCONFDIR/intecture)" ]; then \
rmdir $(SYSCONFDIR)/intecture; \
fi
test:
ifeq ($(TARGET), release)
cargo test --release
else
cargo test
endif
clean:
cargo clean