-
Notifications
You must be signed in to change notification settings - Fork 1
/
Makefile
100 lines (71 loc) · 1.87 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
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
#
#
#
#
TOPDIR=$(shell pwd)
CONF?=default
include $(TOPDIR)/conf/$(CONF)
DESC?="$(CONF) - splunkforwarder-$(SPLUNK_UF_VERSION)-$(SPLUNK_UF_HASH)-Linux-x86_64 Installer"
DOWNLOAD_SCRIPT=$(TOPDIR)/bin/download_uf.sh
BUILDDIR=build/$(CONF)
DISTDIR=dist
DOWNLOADDIR=download/$(SPLUNK_UF_VERSION)-$(SPLUNK_UF_HASH)
UF_FILENAME=splunkforwarder-$(SPLUNK_UF_VERSION)-$(SPLUNK_UF_HASH)-Linux-x86_64.tgz
UF_ARCHIVE=$(DOWNLOADDIR)/$(UF_FILENAME)
UF_LINK=$(DOWNLOADDIR)/splunkforwarder.tgz
INSTALLER?=$(CONF)_uf_installer-$(SPLUNK_UF_VERSION)-$(SPLUNK_UF_HASH)-Linux-x86_64.sh
INSTALLER_SCRIPT=$(INSTALLER)
SCRIPT?=installme.sh
all: makeself distdir build download config copy installer
installer: $(INSTALLER_SCRIPT)
$(INSTALLER_SCRIPT): FORCE
( cd $(BUILDDIR); \
$(TOPDIR)/tools/makeself/makeself.sh \
--notemp \
--nox11 \
--gzip \
--follow \
--export-conf \
. \
$(TOPDIR)/dist/$@ \
$(DESC) \
./installme.sh; \
)
.PHONY: copy distdir
copy: $(BUILDDIR)/splunkforwarder.tgz
$(BUILDDIR)/splunkforwarder.tgz: $(UF_ARCHIVE)
cp $(UF_ARCHIVE) $(BUILDDIR)/splunkforwarder.tgz
distdir: $(DISTDIR)
$(DISTDIR):
mkdir -p $@
build: $(BUILDDIR)
mkdir -p $@
$(BUILDDIR):
mkdir -p $@
download: $(DOWNLOADDIR) $(UF_LINK)
$(DOWNLOADDIR):
mkdir -p $@
$(UF_LINK): $(DOWNLOAD_SCRIPT)
$(DOWNLOAD_SCRIPT) -V $(SPLUNK_UF_VERSION) -H $(SPLUNK_UF_HASH) -d $(DOWNLOADDIR)
$(DOWNLOAD_SCRIPT):
$(BUILDDIR)/installme.sh: FORCE
sed -e 's!@@DS_URL@@!$(DS_URL)!' $(TOPDIR)/scripts/$(SCRIPT) > $@
chmod +x $@
config: $(BUILDDIR)/installme.sh
.PHONY: FORCE
FORCE:
.PHONY: clean realclean
help:
@echo "Customer: $(CONF)"
@echo "Description: $(DESC)"
@echo "DS URL: $(DS_URL)"
@echo "Installer: $(INSTALLER)"
@echo
makeself: tools/makeself/makeself.sh
tools/makeself/makeself.sh:
git submodule init
git submodule update
realclean: clean
rm -rf download build dist
clean:
rm -rf $(BUILDDIR)