forked from ps78674/zabbix-raidstat
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathMakefile
24 lines (22 loc) · 963 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
LD_FLAGS ="-s -w"
BUILD_DIR =./build
clean:
rm -rf $(BUILD_DIR)
rm -f raidstat.tar.gz
build:
mkdir $(BUILD_DIR)
go build -ldflags=$(LD_FLAGS) -buildmode=plugin -o $(BUILD_DIR)/adaptec.so plugins/adaptec/main.go
go build -ldflags=$(LD_FLAGS) -buildmode=plugin -o $(BUILD_DIR)/hp.so plugins/hp/main.go
go build -ldflags=$(LD_FLAGS) -buildmode=plugin -o $(BUILD_DIR)/marvell.so plugins/marvell/main.go
go build -ldflags=$(LD_FLAGS) -o $(BUILD_DIR)/raidstat main.go
install -m 644 config.json $(BUILD_DIR)/config.json
install: build
install -d /opt/raidstat
install -m 644 $(BUILD_DIR)/adaptec.so /opt/raidstat/adaptec.so
install -m 644 $(BUILD_DIR)/hp.so /opt/raidstat/hp.so
install -m 644 $(BUILD_DIR)/marvell.so /opt/raidstat/marvell.so
install -m 755 $(BUILD_DIR)/raidstat /opt/raidstat/raidstat
install -m 644 config.json /opt/raidstat/config.json
tar: build
tar cfz raidstat.tar.gz build --transform 's/build/raidstat/'
.DEFAULT_GOAL = build