-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathMakefile
More file actions
51 lines (37 loc) · 1.19 KB
/
Copy pathMakefile
File metadata and controls
51 lines (37 loc) · 1.19 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
39
40
41
42
43
44
45
46
47
48
49
50
51
BUILD_DIR ?= build
BUILD_TYPE ?= Release
HCTREE_ARCHIVE ?= hctree.tar.gz
HCTREE_BUILD ?= hctree-build
HCTREE_URL ?= https://www.sqlite.org/hctree/tarball/hctree.tar.gz?r=hctree
all: configure build
configure:
@cmake -S . -B $(BUILD_DIR) -DCMAKE_BUILD_TYPE=$(BUILD_TYPE)
build: configure
@cmake --build $(BUILD_DIR)
rebuild: clean_build all
generate_config:
python3 tools/generate-config.py h c conf server
generate_tests:
python3 tools/generate-tests.py
code_coverage:
python3 tools/code-coverage.py
start: configure build
WRD_CORS="*" WRD_LOG_LEVEL=3 WRD_CONF_PATH=warudo.conf build/src/warudo
update_hctree:
@mkdir -p $(HCTREE_BUILD)/build
curl -L $(HCTREE_URL) | tar -xz -C $(HCTREE_BUILD)
cd $(HCTREE_BUILD)/build && ../hctree/configure
cd $(HCTREE_BUILD)/build && make sqlite3.c
cp $(HCTREE_BUILD)/build/sqlite3.h src/sqlite3/sqlite3.h
cp $(HCTREE_BUILD)/build/sqlite3.c src/sqlite3/sqlite3.c
rm -rf $(HCTREE_BUILD)
docker:
docker build --no-cache -t warudo:latest .
test: BUILD_TYPE = Test
test: configure build
build/test/warudo-test $(ARGS)
clean_build:
@cmake --build $(BUILD_DIR) --target clean
clean:
rm -rf $(BUILD_DIR) $(HCTREE_BUILD)
.PHONY: all configure build clean rebuild