-
Notifications
You must be signed in to change notification settings - Fork 1
/
Makefile
38 lines (32 loc) · 924 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
INSTALL_TO=/opt/sentinel
BUILD_DIR=build
all: check
check:
which nano || which vim || which vi # check any editor
which awk # for parsing purpose
which grep
which tail && which head # read file tools
which sudo # sudo to run task under custom user
which readlink # to read realpath
which setsid # be sure that we have setsid util
build:
mkdir $(BUILD_DIR)
mkdir $(BUILD_DIR)/tasks
mkdir $(BUILD_DIR)/proc
mkdir $(BUILD_DIR)/bin
cp -r src build
cp task.example $(BUILD_DIR)
cp sentinel $(BUILD_DIR)
cp LICENSE $(BUILD_DIR)
cp README.md $(BUILD_DIR)
echo "#!/bin/bash" > $(BUILD_DIR)/bin/sentinel
echo "cd "$(INSTALL_TO)" && ./sentinel $$"'@' >> $(BUILD_DIR)/bin/sentinel
chmod +x $(BUILD_DIR)/bin/sentinel
clean:
rm -fr build
install:
@echo "Installing Sentinel into "$(INSTALL_TO)
mkdir -p $(INSTALL_TO)
cp -r build/* $(INSTALL_TO)
ln -fs $(INSTALL_TO)/bin/sentinel /usr/bin/sentinel
ldconfig