-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathMakefile
More file actions
executable file
·43 lines (32 loc) · 754 Bytes
/
Makefile
File metadata and controls
executable file
·43 lines (32 loc) · 754 Bytes
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
MKDIR = mkdir
CHMOD = chmod +x
CP = cp
.DEFAULT_GOAL = .base
FILE = /etc/git-cli-utils/installed.conf
TARGETS = $(shell cd ./cmds && ls -d */ | tr -d /)
FILES = $(shell cd ./cmds && ls -p | grep -v /)
INSTALLED = $(shell cat ${FILE})
ifndef VERBOSE
.SILENT:
endif
all: $(TARGETS)
update: $(INSTALLED)
$(TARGETS): .base
@echo -e "\n\ninstalling $@...\n"
@echo "$@ " >> $(FILE)
cd ./cmds/$@ && $(MAKE)
.base: .check_auth .create_dir .base_echo $(FILES)
@echo ".base" > $(FILE)
.base_echo:
@echo "installing base..."
$(FILES):
cd ./cmds && bash ./install-cmd.sh $@
.create_dir:
ifeq ($(wildcard /etc/git-cli-utils/),)
${MKDIR} /etc/git-cli-utils/
endif
.check_auth:
ifneq ($(shell id -u), 0)
@echo "root privilege needed..."
false
endif