-
Notifications
You must be signed in to change notification settings - Fork 1
/
Makefile
51 lines (43 loc) · 1.26 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
51
# Default installation directory.
# make install dir=$HOME/bin
dir ?= /bin/
root ?= root
group ?= root
# XXX the hook is conceptually
# on a per-user basis
user ?= mb
hdir ?= /home/${user}/
.PHONY: all
all: bin/See
.PHONY: help
help:
@echo 'install dir=... group=... root=...'
@echo ' install bin/* to $dir (default /bin/);'
@echo ' default owner:group is root:root'
@echo 'uninstall dir=...'
@echo ' uninstall bin/* from $dir (default: /bin/)'
@echo 'update-doc: update README.md from inline bin/* doc'
bin/See: See.c
@echo Compiling See...
@9c See.c && 9l See.o -o bin/See && rm See.o
.PHONY: install
install: bin/See install-hook
@echo "Installing bin/* to ${dir}/..."
@for x in bin/*; do \
install -o ${root} -g ${group} -m 755 $$x ${dir}/`basename $$x`; \
done
@# Convenient shortcut
@rm -f ${dir}/O
@ln -s ${dir}/Open ${dir}/O
install-hook: acme.hook
@echo "Installing hook to ${hdir}..."
@install -m 755 ./acme.hook ${hdir}/acme.hook
.PHONY: uninstall
uninstall:
@echo "Removing all bin/* from ${dir}/..."
@for x in bin/*; do echo rm -f ${dir}/`basename $$x`; done
@rm -f ${dir}/O
.PHONY: update-doc
update-doc:
@echo 'Updating README.md to include inline documentation...'
@sh ./update-doc '^# Tools' ./README.md ./bin/