-
Notifications
You must be signed in to change notification settings - Fork 0
/
Makefile
42 lines (29 loc) · 1.1 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
TRANSACTION_PROJECT_NAME="Transactions_CPP"
TRANSACTION_TEST_BUILD_NAME="Transactions_CPP_TEST"
TRANSACTION_PROJECT_BUILD_DIR=${TRANSACTION_PROJECT_NAME}
TRANSACTION_TEST_BUILD_DIR=${TRANSACTION_TEST_BUILD_NAME}
TRANSACTIONS_TESTS_LOCATION_DIR="./src/tests"
PLATFORM=$(shell uname -o)
all: tests clean_tests build
build:
@cmake -S . -B ${TRANSACTION_PROJECT_BUILD_DIR}
@cmake --build ${TRANSACTION_PROJECT_BUILD_DIR}
run:
@${TRANSACTION_PROJECT_BUILD_DIR}/${TRANSACTION_PROJECT_NAME}
tests:
@cmake -S ${TRANSACTIONS_TESTS_LOCATION_DIR} -B ${TRANSACTION_TEST_BUILD_DIR}
@cmake --build ${TRANSACTION_TEST_BUILD_DIR}
@${TRANSACTION_TEST_BUILD_DIR}/${TRANSACTION_TEST_BUILD_NAME}
leaks: tests
ifeq ($(PLATFORM),Darwin)
@valgrind --tool=memcheck ${TRANSACTION_TEST_BUILD_DIR}/${TRANSACTION_TEST_BUILD_NAME}
else
@leaks --atExit -- ${TRANSACTION_TEST_BUILD_DIR}/${TRANSACTION_TEST_BUILD_NAME}
endif
hash_table.a: build
self_balancing_binary_search_tree.a: build
clean: clean_tests clean_transactions
clean_tests:
@rm -rf ${TRANSACTION_TEST_BUILD_DIR}
clean_transactions:
@rm -rf ${TRANSACTION_PROJECT_BUILD_DIR}