forked from ercole-io/ercole-agent-rhel5
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Makefile
46 lines (32 loc) · 1.08 KB
/
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
39
40
41
42
43
44
45
46
# Simple Makefile for ercole agent
DESTDIR=build
all: ercole-agent
default: ercole-agent
clean:
rm -rf ercole-agent build ercole-agent.exe *.exe
find . -name "fake_*_test.go" -exec rm "{}" \;
go generate ./...
go clean -testcache
ercole-agent:
GO111MODULE=on CGO_ENABLED=0 go build -o ercole-agent -a
windows:
GOOS=windows GOARCH=amd64 GO111MODULE=on CGO_ENABLED=0 go build -o ercole-agent.exe -a
nsis: windows
makensis package/win/installer.nsi
install: all install-fetchers install-bin install-bin install-config install-scripts
install-fetchers:
install -d $(DESTDIR)/fetch
cp -rp fetch/linux $(DESTDIR)/fetch
install-bin:
install -m 755 ercole-agent $(DESTDIR)/ercole-agent
install -m 755 package/ercole-setup $(DESTDIR)/ercole-setup
install-scripts:
install -d $(DESTDIR)/sql
install -m 644 sql/*.sql $(DESTDIR)/sql
install-config:
install -m 644 config.json $(DESTDIR)/config.json
test:
go test ./...
docker-build:
docker run --rm -it -v "$$PWD":/go/src/github.com/ercole-io/ercole-agent-rhel5 \
-w /go/src/github.com/ercole-io/ercole-agent-rhel5 golang:1.3 make test all