-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathMakefile
More file actions
45 lines (30 loc) · 2.78 KB
/
Copy pathMakefile
File metadata and controls
45 lines (30 loc) · 2.78 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
CC = gcc
CFLAGS = -Wall -Wextra -g
INCLUDES = -Iinclude
TEST_DIR = tests
SRC_DIR = src
BIN = nosql.exe
.PHONY: all clean
all: test_wal test_hashmap test_nosql test_corruption test_document test_auth test_persistence test_lru test_benchmark nosql
test_wal:
$(CC) $(CFLAGS) tests/test_wal.c src/storage/wal.c src/index/hashmap.c src/utils/crc32.c -o tests/test_wal.exe
test_hashmap:
$(CC) $(CFLAGS) $(TEST_DIR)/test_hashmap.c $(SRC_DIR)/index/hashmap.c $(INCLUDES) -o $(TEST_DIR)/test_hashmap.exe
test_nosql:
$(CC) $(CFLAGS) $(TEST_DIR)/test_nosql.c $(SRC_DIR)/nosql.c $(SRC_DIR)/storage/wal.c $(SRC_DIR)/storage/lru_cache.c $(SRC_DIR)/index/hashmap.c src/utils/crc32.c src/document/document.c src/json/cJSON.c $(INCLUDES) -o $(TEST_DIR)/test_nosql.exe
test_corruption:
$(CC) $(CFLAGS) $(TEST_DIR)/test_wal_corruption.c $(SRC_DIR)/nosql.c $(SRC_DIR)/storage/wal.c $(SRC_DIR)/storage/lru_cache.c $(SRC_DIR)/index/hashmap.c src/utils/crc32.c src/document/document.c src/json/cJSON.c $(INCLUDES) -o $(TEST_DIR)/test_corruption.exe
test_document:
$(CC) $(CFLAGS) $(TEST_DIR)/test_document.c $(SRC_DIR)/nosql.c $(SRC_DIR)/storage/wal.c $(SRC_DIR)/storage/lru_cache.c $(SRC_DIR)/index/hashmap.c src/utils/crc32.c src/document/document.c src/json/cJSON.c $(INCLUDES) -o $(TEST_DIR)/test_document.exe
test_auth:
$(CC) $(CFLAGS) tests/test_auth.c $(SRC_DIR)/nosql.c $(SRC_DIR)/storage/wal.c $(SRC_DIR)/storage/lru_cache.c $(SRC_DIR)/index/hashmap.c src/utils/crc32.c src/utils/sha256.c src/document/document.c src/json/cJSON.c src/auth/user.c $(INCLUDES) -o $(TEST_DIR)/test_auth.exe
test_persistence:
$(CC) $(CFLAGS) $(TEST_DIR)/test_persistence.c $(SRC_DIR)/nosql.c $(SRC_DIR)/storage/wal.c $(SRC_DIR)/storage/lru_cache.c $(SRC_DIR)/index/hashmap.c src/utils/crc32.c src/utils/sha256.c src/document/document.c src/json/cJSON.c src/auth/user.c $(INCLUDES) -o $(TEST_DIR)/test_persistence.exe
test_lru:
$(CC) $(CFLAGS) $(TEST_DIR)/test_lru.c $(SRC_DIR)/storage/lru_cache.c $(INCLUDES) -o $(TEST_DIR)/test_lru.exe
test_benchmark:
$(CC) $(CFLAGS) $(TEST_DIR)/test_benchmark.c $(SRC_DIR)/nosql.c $(SRC_DIR)/storage/wal.c $(SRC_DIR)/storage/lru_cache.c $(SRC_DIR)/index/hashmap.c src/utils/crc32.c src/document/document.c src/json/cJSON.c $(INCLUDES) -o $(TEST_DIR)/test_benchmark.exe
clean:
rm -f $(TEST_DIR)/test_wal.exe $(TEST_DIR)/test_hashmap.exe $(TEST_DIR)/test_nosql.exe $(TEST_DIR)/test_corruption.exe $(TEST_DIR)/test_document.exe $(TEST_DIR)/test_document_manual.exe $(TEST_DIR)/test_persistence.exe $(TEST_DIR)/test_auth.exe $(TEST_DIR)/test_lru.exe $(TEST_DIR)/test_benchmark.exe $(BIN)
nosql:
$(CC) $(CFLAGS) src/main.c src/cli/cli.c src/nosql.c src/storage/wal.c src/storage/lru_cache.c src/index/hashmap.c src/json/cJSON.c src/utils/crc32.c src/utils/sha256.c src/document/document.c src/auth/user.c $(INCLUDES) -o $(BIN)