forked from jaw0/argus5
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Makefile
68 lines (52 loc) · 1.61 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
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
# Copyright (c) 2017
# Author: Jeff Weisberg <jaw @ tcp4me.com>
# Created: 2017-Oct-14 15:56 (EDT)
# Function: makefile
# where should argus install?
INSTALL_BIN = /usr/local/bin
INSTALL_SBIN = /usr/local/sbin
# see also src/argus/conf.go
INSTALL_HTDIR = /usr/local/share/argus/htdir
################################################################
ROOT!=pwd
DATE!=date +'%Y%m%d'
BIN=src/cmd/argusd src/cmd/argusctl
GO=env GOPATH=$(ROOT) go
VERSION=dev-$(DATE)
NAME=argus
CTLSOCK=/var/tmp/$(NAME).ctl
all: src/.deps
(echo package argus; echo const Version = \"$(VERSION)\") > src/argus/argus/version.go
(echo package argus; echo const ControlSocket = \"$(CTLSOCK)\") > src/argus/argus/ctlsock.go
@for x in $(BIN); do \
echo building $$x; \
(cd $$x; $(GO) install); \
done
@echo
@echo build of argus version $(VERSION) complete
@echo now run \'make install\'
src/.deps: deps
cd src ; go mod download
@touch src/.deps
install: all
-mkdir -p $(INSTALL_BIN) $(INSTALL_SBIN) $(INSTALL_HTDIR)
cp bin/argusd $(INSTALL_SBIN)/$(NAME)d
cp bin/argusctl $(INSTALL_BIN)/$(NAME)ctl
cp -R htdir/* $(INSTALL_HTDIR)
@echo
@echo install of argus version $(VERSION) complete
clean:
-rm -rf src/github.com src/golang.org src/cloud.google.com
-rm -rf pkg/*
-rm -f bin/*
-rm -f src/.deps
################################################################
TESTDIR=/tmp/argus5test
testbuild:
rm -rf $(TESTDIR)
git clone $(ROOT) $(TESTDIR)
cd $(TESTDIR) ; make
dist:
git archive --format=tar.gz --prefix=argus-$(VERSION)/ HEAD > argus-$(VERSION).tgz
www-code:
scp argus-$(VERSION).tgz laertes:~www/htdocs/code/argus-archive/