show only non-bare remotes
[hband-tools.git] / user-tools / Makefile
blobe6c37bf5c9d9582566678660e894615f824f1387
2 REPO_ROOT ?= ..
4 TOOLS_TARGET_DIR = /usr/tool
6 include $(dir $(lastword $(MAKEFILE_LIST)))/Makefile.lists.mk
8 SYMLINKS = $(shell find $(addprefix ./,$(TOOLS)) -maxdepth 0 -type l -printf "%f\n")
9 SYMLINK_TOOLS = $(filter $(SYMLINKS),$(TOOLS))
10 NORMAL_TOOLS = $(filter-out $(SYMLINK_TOOLS),$(TOOLS))
11 TOOLS_TARGET_FILES = $(addprefix $(TOOLS_TARGET_DIR)/,$(NORMAL_TOOLS))
12 TOOLS_TARGET_SYMLINKS = $(addprefix $(TOOLS_TARGET_DIR)/,$(SYMLINK_TOOLS))
16 default:
17 @echo You may be interested in: install-all, install-tools, list-tools, manpages
18 @false
19 .PHONY: default
22 $(TOOLS_TARGET_DIR)/msg: /etc/bash_completion.d/msg
23 $(TOOLS_TARGET_DIR)/perl-repl: /usr/libexec/perlshell
24 $(TOOLS_TARGET_DIR)/rsync-semichroot: /usr/share/doc/tool/rsync-semichroot.txt
25 $(TOOLS_TARGET_DIR)/multithrottler: /usr/lib/multithrottler/Throttler.pm
26 $(TOOLS_TARGET_DIR)/git-mirrors: /usr/share/bash-completion/completions/git-mirrors
28 /etc/bash_completion.d/msg: $(REPO_ROOT)/bash/bash_completion.d/msg
29 install $< $@
30 @echo remove $@ >> uninstall.sh
32 /usr/share/bash-completion/completions/git-mirrors: $(REPO_ROOT)/bash/bash_completion.d/git-mirrors
33 install $< $@
34 @echo remove $@ >> uninstall.sh
36 /usr/libexec/perlshell: $(REPO_ROOT)/libexec/perlshell
37 install $< $@
38 @echo remove $@ >> uninstall.sh
40 /usr/share/doc/tool/rsync-semichroot.txt: $(REPO_ROOT)/doc/rsync-semichroot.txt | /usr/share/doc/tool
41 install $< $@
42 @echo remove $@ >> uninstall.sh
44 /usr/lib/tool/bash-utils: $(REPO_ROOT)/bash/bash-utils | /usr/lib/tool
45 install $< $@
46 @echo remove $@ >> uninstall.sh
48 /usr/lib/multithrottler/Throttler.pm: $(REPO_ROOT)/lib/multithrottler/Throttler.pm | /usr/lib/multithrottler
49 install $< $@
50 @echo remove $@ >> uninstall.sh
52 /usr/lib/multithrottler:
53 [ -d $@ ] || mkdir $@
54 @echo remove $@ >> uninstall.sh
57 $(TOOLS_TARGET_DIR):
58 [ -d $@ ] || mkdir $@
59 @echo remove $@ >> uninstall.sh
61 /usr/share/doc/tool:
62 [ -d $@ ] || mkdir $@
63 @echo remove $@ >> uninstall.sh
65 /usr/lib/tool:
66 [ -d $@ ] || mkdir $@
67 @echo remove $@ >> uninstall.sh
71 DEPCHECK_TARGETS = $(addprefix DEPCHECK/,$(NORMAL_TOOLS))
72 depcheck-all: $(DEPCHECK_TARGETS)
73 .PHONY: $(DEPCHECK_TARGETS)
75 DEPCHECK/lines:
76 perl -MARGV::readonly -e 1
77 DEPCHECK/parsel:
78 python3 -c 'import parsel; import cssselect'
79 DEPCHECK/xml2json:
80 python -c 'import xmltodict'
81 DEPCHECK/palemoon-current-url:
82 which jq
83 DEPCHECK/dbus-call:
84 perl -MNet::DBus -e 1
85 perl -MXML::Hash::LX -e 1
86 perl -MJSON -e 1
88 .PHONY: try-satisfy-dependencies
89 try-satisfy-dependencies:
90 -cpan ARGV::readonly
91 -apt install python3-parsel
92 -apt install python3-cssselect
93 -apt install python3-xmltodict
94 -apt install jq
95 -apt install libnet-dbus-perl || cpan Net::DBus
96 -apt install libxml-libxml-perl libxml-hash-lx-perl || cpan XML::Hash::LX
97 -apt install libjson-perl || cpan JSON
98 -apt install liblog-log4perl-perl || cpan Log::Log4perl
99 -apt install libyaml-perl || cpan YAML
102 install-all: \
103 /usr/lib/tool/bash-utils \
104 install-tools \
105 install-manpages
106 .PHONY: install-all
109 install-tools: depcheck-all $(TOOLS_TARGET_FILES) $(TOOLS_TARGET_SYMLINKS)
110 .PHONY: install-tools
112 $(TOOLS_TARGET_FILES) $(TOOLS_TARGET_SYMLINKS): | $(TOOLS_TARGET_DIR)
114 $(TOOLS_TARGET_FILES): $(TOOLS_TARGET_DIR)/%: % DEPCHECK/%
115 install --compare $(notdir $@) $(TOOLS_TARGET_DIR)/
116 @echo remove $@ >> uninstall.sh
118 install-symlinks: $(TOOLS_TARGET_SYMLINKS)
119 .PHONY: install-symlinks
121 $(TOOLS_TARGET_SYMLINKS): $(TOOLS_TARGET_DIR)/%: %
122 ln -snfv $(shell readlink $<) $@
123 @echo remove $@ >> uninstall.sh
126 list-tools:
127 @echo $(TOOLS) | tr " " "\n" | sort
128 .PHONY: list-tools
131 include $(dir $(lastword $(MAKEFILE_LIST)))/Makefile.documentation.mk