forked from aks/kubetail
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Makefile
50 lines (36 loc) · 1.24 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
# Makefile for kubectl
prog_name = kubetail
conf_file_name = kube-multitail.conf
man_source = kubetail.man
man_sec = 1
man_file_name = kubetail.$(man_sec)
DEST_DIR ?= $(HOME)
bindir = $(DEST_DIR)/bin
etcdir = $(DEST_DIR)/etc
mandir = $(DEST_DIR)/man/man$(man_sec)
program = $(bindir)/$(prog_name)
conffile = $(etcdir)/$(conf_file_name)
manfile = $(mandir)/$(man_file_name)
help:
@echo "The Makefile supports these targets:"
@echo " make install-home # to install into $(HOME)/{bin,etc,man}"
@echo " make install-usr # to install into /usr/local/{bin,etc,man}"
@echo ''
@echo "Use -n to see the effects without doing it"
.PHONY: install-files install-home install-usr clean
install-files:: $(program) $(conffile) $(manfile)
install-home::
$(MAKE) DEST_DIR=$(HOME) install-files
install-usr::
$(MAKE) DEST_DIR=/usr/local install-files
clean::
rm -f $(man_file_name)
$(bindir) $(etcdir) $(mandir):
mkdir -p $@
$(program): $(bindir) kubetail Makefile
install -b kubetail $@
$(conffile): $(etcdir) $(conf_file_name) Makefile
install -b -m 0644 $(conf_file_name) $@
$(manfile): $(mandir) $(man_source) VERSION Makefile
sed -Ee "s/@@VERSION@@/`cat VERSION`/g" <$(man_source) >$(man_file_name)
install -m 0644 $(man_file_name) $@