-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathMakefile
More file actions
35 lines (28 loc) · 884 Bytes
/
Makefile
File metadata and controls
35 lines (28 loc) · 884 Bytes
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
CC=gcc
CFLAGS=-g -std=c11 -Wall -Wshadow -Wvla -Werror -pedantic
BASE_NAME=json
SRC_C=$(BASE_NAME).c
TEST_C=test_$(SRC_C)
ASG_NICKNAME=HW13
SRC_H=$(BASE_NAME).h clog.h miniunit.h
SUBMIT_FILES=$(SRC_C) $(TEST_C) clog.h miniunit.h Makefile
EXECUTABLE=test_$(BASE_NAME)
EXECUTABLE_GCOV=$(EXECUTABLE)_gcov
CFLAGS_GCOV=$(CFLAGS) -fprofile-arcs -ftest-coverage
SHELL=/bin/bash
submit: $(SUBMIT_FILES)
264submit $(ASG_NICKNAME) $(SUBMIT_FILES)
test: $(EXECUTABLE)
./$(EXECUTABLE)
valgrind ./$(EXECUTABLE)
pretest: submit
264test $(ASG_NICKNAME)
clean:
rm -f $(EXECUTABLE) *.c.gcov *.gcda *.gcno
$(EXECUTABLE): $(SRC_C) $(TEST_C) $(SRC_H)
#$(CC) -o test_$(BASE_NAME) $(SRC_C) $(TEST_C) $(CFLAGS)
coverage: $(SRC_C) $(TEST_C)
$(CC) $(CFLAGS_GCOV) $(SRC_C) $(TEST_C) -o $(EXECUTABLE_GCOV)
./$(EXECUTABLE_GCOV)
gcov -f $(SRC_C)
.PHONY: submit test pretest clean coverage