-
Notifications
You must be signed in to change notification settings - Fork 0
/
Makefile
41 lines (33 loc) · 1.12 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
CFLAGS = -std=c99 -g -Wall -Wshadow --pedantic -Wvla -Werror
TESTFLAGS = -DCHECK_PATH
GCC = gcc $(CFLAGS) $(TESTFLAGS)
EXEC = main
OBJS = main.o sudoku.o
VALGRIND = valgrind --tool=memcheck --leak-check=yes --verbose
$(EXEC): $(OBJS) sudoku.h
$(GCC) $(OBJS) -o $(EXEC)
test: $(EXEC)
./$(EXEC) testcases/sudoku1 output1
./$(EXEC) testcases/sudoku2 output2
./$(EXEC) testcases/sudoku3 output3
./$(EXEC) testcases/sudoku4 output4
./$(EXEC) testcases/sudoku5 output5
diff: $(EXEC)
diff -w output1 expected/sudoku1
diff -w output2 expected/sudoku2
diff -w output3 expected/sudoku3
diff -w output4 expected/sudoku4
diff -w output5 expected/sudoku5
memory: $(EXEC)
$(VALGRIND) --log-file=log1 ./$(EXEC) testcases/sudoku1 output1
$(VALGRIND) --log-file=log2 ./$(EXEC) testcases/sudoku2 output2
$(VALGRIND) --log-file=log3 ./$(EXEC) testcases/sudoku3 output3
$(VALGRIND) --log-file=log4 ./$(EXEC) testcases/sudoku4 output4
$(VALGRIND) --log-file=log5 ./$(EXEC) testcases/sudoku5 output5
%.o : %.c
$(GCC) -c $<
clean:
rm -f main.o
rm -f $(EXEC)
rm -f id? name? log?
rm -f output*