-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathexe.misc.inc.mk
29 lines (26 loc) · 1.09 KB
/
exe.misc.inc.mk
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
CP_NOSYM = $(CP) -L
DIFF_SS = $(DIFF) -y -W $(COLUMNS)
EDITOR ?= $(call which,VI,vi)
FIND_Q = 2>/dev/null $(FIND)
FIND_Q_NOSYM = $(FIND_Q) -L
GREP_FILENAME = $(GREP) -rl
LS_ALL = $(LS) -A
$(foreach VAR,CP_NOSYM EDITOR FIND_Q FIND_Q_NOSYM GREP_FILENAME LS_ALL,$(call make-lazy,$(VAR)))
$(foreach VAR,DIFF_SS,$(call make-lazy-once,$(VAR)))
CURL = $(call which,CURL,curl) -qfsSL
JQ = $(call which,JQ,jq)
JSON = $(call which,JSON,json) -D " " # to allow / or . in a key
SEMVER = $(call which,SEMVER,semver)
$(foreach VAR,CURL JQ JSON SEMVER,$(call make-lazy,$(VAR)))
GIT = $(call which,GIT,git)
GIT_LS = $(GIT) ls-files
GIT_LS_NEW = $(GIT_LS) --others --directory --no-empty-directory
GIT_LS_SUB = $(CAT) .gitmodules | $(GREP) "path =" | $(SED) "s/.\{0,\}path = //"
$(foreach VAR,GIT GIT_LS GIT_LS_NEW GIT_LS_SUB,$(call make-lazy,$(VAR)))
PATCH_STDOUT = $(PATCH) -o -
UNZIP = $(call which,UNZIP,unzip) -oq
VISUAL ?= $(EDITOR)
ZIP_NOSYM = $(call which,ZIP_NOSYM,zip) -r
ZIP = $(ZIP_NOSYM) -y
ZIPINFO = $(call which,ZIPINFO,zipinfo)
$(foreach VAR,PATCH_STDOUT UNZIP VISUAL ZIP_NOSYM ZIP ZIPINFO,$(call make-lazy,$(VAR)))