-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathconfigure
More file actions
executable file
·54 lines (46 loc) · 847 Bytes
/
configure
File metadata and controls
executable file
·54 lines (46 loc) · 847 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
44
45
46
47
48
49
50
51
52
53
54
#!/usr/bin/env bash
cfg="config.mk"
declare -a bins
declare -a man1s
declare -a man4s
usage() {
printf "usage:\n"
printf "\t$0 (acme|sam|tools)\n"
}
add_command() {
bins+=("\$(SRC_DIR)/cmd/$1/$1")
if [[ $2 = 1 ]]; then
man1s+=("\$(MAN_DIR)/man1/$1.1")
else
man4s+=("\$(MAN_DIR)/man4/$1.4")
fi
}
if [[ $# -lt 1 ]]; then
usage
exit 1
fi
case $1 in
acme)
add_command acme 1
;;
sam)
add_command sam 1
bins+=("\$(SRC_DIR)/cmd/samterm/samterm")
;;
tools)
add_command 9pserve 4
add_command devdraw 1
add_command fontsrv 4
add_command 9p 1
add_command 9pfuse 4
;;
*)
usage
exit 1
;;
esac
:>$cfg
IFS=' '
printf "BINS=%s\n" "${bins[*]}" >> $cfg
printf "MAN1S=%s\n" "${man1s[*]}" >> $cfg
printf "MAN4S=%s\n" "${man4s[*]}" >> $cfg