-
Notifications
You must be signed in to change notification settings - Fork 45
/
tools.mak
45 lines (36 loc) · 1.17 KB
/
tools.mak
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
ifeq ($(shell curl --version >/dev/null 2>&1 || echo FAIL),)
download = curl -f -L -- "$(1)" > "[email protected]" && touch [email protected] && mv [email protected] $@
else ifeq ($(shell wget --version >/dev/null 2>&1 || echo FAIL),)
download = rm -f [email protected] && \
wget --passive -c -p -O [email protected] "$(1)" && \
touch [email protected] && \
mv [email protected] $@
else ifeq ($(which fetch >/dev/null 2>&1 || echo FAIL),)
download = rm -f [email protected] && \
fetch -p -o [email protected] "$(1)" && \
touch [email protected] && \
mv [email protected] $@
else
download = $(error Neither curl nor wget found!)
endif
# mmark
mmark_$(MMARK_VERSION)_$(MMARK_OS)_$(MMARK_MACHINE).tgz:
$(call download,https://github.com/mmarkdown/mmark/releases/download/v$(MMARK_VERSION)/mmark_$(MMARK_VERSION)_$(MMARK_OS)_$(MMARK_MACHINE).tgz)
mmark: mmark_$(MMARK_VERSION)_$(MMARK_OS)_$(MMARK_MACHINE).tgz
tar xvzf $^
touch $@
.buildmmark: mmark
.uninstall_mmark:
$(RM) mmark
# xml2rfc
.buildxml2rfc:
pip3 install --user "xml2rfc~=$(XML2RFC_VERSION)"
.uninstall_xml2rfc:
pip3 uninstall -y xml2rfc
# xsltproc
.buildxsltproc:
@echo "Install xsltproc: sudo apt install xsltproc"
# xmllint
.buildxmllint:
@echo "Install xmllint: sudo apt install libxml2-utils"
clean: .uninstall_mmark .uninstall_xml2rfc