-
Notifications
You must be signed in to change notification settings - Fork 0
/
Makefile
63 lines (44 loc) · 1.14 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
52
53
54
55
56
57
58
59
60
61
62
63
PREFIX ?= /usr/local
BIN_PREFIX ?= ${PREFIX}/bin
MAN_PREFIX ?= ${PREFIX}/share/man
# Commands to build:
COMMANDS =
COMMANDS += go.spiff.io/chisel
# Manpages to install:
MANPAGES =
GO_TAGS ?=
SQLITE_DEFAULT_OPTIONS += sqlite_json
SQLITE_DEFAULT_OPTIONS += sqlite_fts5
SQLITE_DEFAULT_OPTIONS += sqlite_icu
SQLITE_DEFAULT_OPTIONS += sqlite_omit_load_extension
SQLITE_OPTIONS ?= ${SQLITE_DEFAULT_OPTIONS}
GO_TAGS += ${SQLITE_OPTIONS}
EXES =
all:: exe man
exe::
man::
install-exe::
install-man::
install:: install-exe install-man
# Build and install Go commands.
.for cmd in ${COMMANDS}
prog_${cmd} = bin/${cmd:T}
EXES += ${prog_${cmd}}
${prog_${cmd}}::
go build -tags ${GO_TAGS:ts,:Q} -v -o ${.TARGET:Q} ${cmd:Q}
exe:: ${prog_${cmd}}
${BIN_PREFIX}/${cmd:T}: ${prog_${cmd}}
${INSTALL} -TD ${prog_${cmd}:Q} ${.TARGET:Q}
install-exe:: ${BIN_PREFIX}/${cmd:T}
.endfor
# Build and install man pages.
.for man in ${MANPAGES}
${man}: ${man}.scd
scdoc <${man}.scd >${man}
man:: ${man}
${MAN_PREFIX}/man${man:E}/${man}: ${man}
${INSTALL} -TD ${man:Q} ${.TARGET:Q}
install-man:: ${MAN_PREFIX}/man${man:E}/${man}
.endfor
clean::
rm -f ${EXES} ${MANPAGES}