-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathMakefile
More file actions
51 lines (39 loc) · 1.61 KB
/
Copy pathMakefile
File metadata and controls
51 lines (39 loc) · 1.61 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
CC = gcc
CFLAGS = -Wall -Wextra -std=c11 -O2 -g
OBJ_SHARED = posting.o avl/avl.o rbtree/rbtree.o btree/btree.o \
index/index.o index/search.o
.PHONY: all app u_tests test clean
all: app u_tests
app: $(OBJ_SHARED) main.o
$(CC) $(CFLAGS) -o app $(OBJ_SHARED) main.o
test_avl: posting.o avl/avl.o avl/tests.o
$(CC) $(CFLAGS) -o test_avl posting.o avl/avl.o avl/tests.o
test_rb: posting.o rbtree/rbtree.o rbtree/tests.o
$(CC) $(CFLAGS) -o test_rb posting.o rbtree/rbtree.o rbtree/tests.o
test_btree: posting.o btree/btree.o btree/tests.o
$(CC) $(CFLAGS) -o test_btree posting.o btree/btree.o btree/tests.o
u_tests: test_avl test_rb test_btree
./test_avl
./test_rb
./test_btree
test: app
@echo "=== E2E: preprocessing ==="
mkdir -p data/test
python3 preprocess.py \
--input data/test/Questions.csv \
--output data/test/docs.jsonl
@echo "=== E2E: indexing ==="
./app index --type=avl --data=data/test/docs.jsonl --index=data/test/idx_avl.txt
./app index --type=rb --data=data/test/docs.jsonl --index=data/test/idx_rb.txt
./app index --type=btree --data=data/test/docs.jsonl --index=data/test/idx_btree.txt
@echo "=== E2E: searching ==="
./app search --type=avl --index=data/test/idx_avl.txt --json "python list"
./app search --type=rb --index=data/test/idx_rb.txt --json "python list"
./app search --type=btree --index=data/test/idx_btree.txt --json "python list"
@echo "=== E2E OK ==="
%.o: %.c
$(CC) $(CFLAGS) -c -o $@ $<
clean:
rm -f app test_avl test_rb test_btree
rm -f *.o avl/*.o rbtree/*.o btree/*.o index/*.o
rm -f data/index_*.txt data/test/docs.jsonl data/test/idx_*.txt