-
Notifications
You must be signed in to change notification settings - Fork 0
/
Makefile
72 lines (52 loc) · 1.46 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
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
# Makefile for 'sudoku' module
#
# CS50 Fall 2021 Sudoku Projct -Sudoku
# Authors: Dylan Beinstock, Salifyanji J Namwila, Veronica Quidore
#
# Date: November 3, 2021
#
# Based on Makefile for bags module by:
# David Kotz, April 2016, 2017
# updated by Xia Zhou, July 2016, 2018, January 2019
# updated by Temi Prioleau, January 2020
#Outside libraries
C = ./create
L = ./library
P = ./puzzle
S = ./solve
CFLAGS = -Wall -pedantic -std=c11 -ggdb -I$C -I$P -I$S -I$L
CC = gcc
MAKE = make
VALGRIND = valgrind --leak-check=full --show-leak-kinds=all
OBJS = $C/create.o $P/puzzle.o $S/solve.o $L/memory.o $L/file.o
UNIT_OBJS = $P/puzzletest.o $P/puzzle.o $L/memory.o $L/file.o
LIBS = -lm
all: sudoku fuzztesting puzzletest
sudoku: sudoku.o $(OBJS)
$(CC) $(CFLAGS) $^ $(LIBS) -o $@
fuzztesting: fuzztesting.o $(OBJS)
$(CC) $(CFLAGS) $^ $(LIBS) -o $@
puzzletest: $(UNIT_OBJS)
$(CC) $(CFLAGS) $^ $(LIBS) -o $@
# Dependencies: object files depend on header files
sudoku.o: $C/create.h $P/puzzle.h $S/solve.h $L/memory.h $L/file.h
fuzztesting.o: $C/create.h $P/puzzle.h $S/solve.h $L/memory.h
puzzletest.o: $P/puzzle.h $L/memory.h $L/file.h
.PHONY: valgrind clean
valgrind: all
valgrind ./sudoku create easy
test:
bash -v testing.sh
unittesting:
bash -v unittesting.sh
clean:
rm -rf *.dSYM # MacOS debugger info
rm -f *~ *.o
rm -f ./library/*.o
rm -f ./create/*.o
rm -f ./puzzle/*.o
rm -f ./solve/*.o
rm -f corecd c
rm -f sudoku
rm -f fuzztesting
rm -f puzzletest