-
Notifications
You must be signed in to change notification settings - Fork 3
/
Makefile
50 lines (33 loc) · 1.44 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
43
44
45
46
47
48
49
50
#---------------------------------------------------------------------
#
# Author: Moy Easwaran, 2014-11-03
# Exact Cover with application to Sudoku, ver 0.1
# License: GPL v2 or above (https://www.gnu.org/licenses/gpl-2.0.html)
#
#---------------------------------------------------------------------
ROOT_DIR = .
CC = gcc
SRC_DIR = $(ROOT_DIR)/src
OBJ_DIR = $(ROOT_DIR)/obj
TEST_DIR = $(ROOT_DIR)/tests
INCLUDES_DIR = $(SRC_DIR)
EXAMPLES_DIR = $(ROOT_DIR)/examples
PY_DIR = $(ROOT_DIR)/exact_cover_np
CFLAGS = -g -Wall -Wstrict-prototypes -I $(INCLUDES_DIR)
CFLAGS += -O0 -DDEBUG_LEVEL=0
$(OBJ_DIR):
mkdir -pv $(OBJ_DIR)
$(OBJ_DIR)/%.o: $(SRC_DIR)/%.c $(OBJ_DIR)
$(CC) $(CFLAGS) $(DEBUG_CFLAGS) -o $@ -c $^
$(OBJ_DIR)/munit.o: $(TEST_DIR)/munit.c $(OBJ_DIR)
$(CC) $(CFLAGS) $(DEBUG_CFLAGS) -o $@ -c $^
run_c_suite: $(TEST_DIR)/test_c_suite
$^
$(TEST_DIR)/test_c_suite: $(OBJ_DIR)/quad_linked_list.o $(OBJ_DIR)/sparse_matrix.o $(OBJ_DIR)/dlx.o $(OBJ_DIR)/munit.o $(TEST_DIR)/test_sparse_matrix.o $(TEST_DIR)/test_dlx.o $(TEST_DIR)/test_legacy_dlx.o $(TEST_DIR)/test_quad_linked_list.o $(TEST_DIR)/test_sparse_matrix_2.o $(TEST_DIR)/test_c_suite.o
$(CC) $(CFLAGS) $(DEBUG_CFLAGS) -o $@ $^
all:
echo "Make is used only for building and running C tests."
echo "To build, install or test the Python package, use poetry."
clean:
rm -rf $(OBJ_DIR)/*.o $(PY_DIR)/build $(PY_DIR)/exact_cover_np.so \
$(TEST_DIR)/test_c_suite $(SRC_DIR)/*.pyc