-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathMakefile
More file actions
38 lines (32 loc) · 1.07 KB
/
Makefile
File metadata and controls
38 lines (32 loc) · 1.07 KB
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
# Basic Makefile for building the necessary infrastructure.
# The default target only builds the backend database.
.PHONY: default
default: database
# Setup directory paths. You can override these on the command line by passing
# Make variables (`make SOURCE_ROOT=... ...`) which you may want to do if you
# are performing an out-of-tree build.
BUILD_ROOT ?=${PWD}
SOURCE_ROOT ?=${PWD}
# Verbosity setting. Run `make V=1 ...` to display more information.
ifeq (${V},1)
Q:=
else
Q:=@
endif
# Build the backend database.
.PHONY: database
database: ${BUILD_ROOT}/refs.db
${BUILD_ROOT}/refs.db: ${SOURCE_ROOT}/refs.sql |sqlite3
@echo " [SQL] $@"
@# XXX: The strange piping of .exit into sqlite3 is because it doesn't seem to
@# listen to exit commands from within its init script.
${Q}echo ".exit" | sqlite3 -init ${SOURCE_ROOT}/refs.sql ${BUILD_ROOT}/refs.db
# Check whether SQLite is installed.
.PHONY: sqlite3
sqlite3:
@echo " [CHECK] $@"
${Q}which sqlite3 >/dev/null || { echo "$@ not found." ; exit 1; }
.PHONY: clean
clean:
@echo " [CLEAN]"
${Q}rm -f ${BUILD_ROOT}/refs.db