-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathMakefile
More file actions
34 lines (24 loc) · 745 Bytes
/
Copy pathMakefile
File metadata and controls
34 lines (24 loc) · 745 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
TEST = test.c cs50.c
EXAMPLE = example.c cs50.c
OBJ_TEST = $(TEST:.c=.o)
OBJ_EXAMPLE = $(EXAMPLE:.c=.o)
CFLAGS = -D_GNU_SOURCE -std=c99
LFLAGS = -Wall -Wno-format-y2k -W -Wstrict-prototypes \
-Wpointer-arith -Wreturn-type -Wcast-qual -Wwrite-strings -Wswitch \
-Wshadow -Wcast-align -Wbad-function-cast -Wchar-subscripts -Winline \
-Wnested-externs -Wredundant-decls
COVFLAGS = -Wall -fprofile-arcs -ftest-coverage
test: $(OBJ_TEST)
$(CC) $(OBJ_TEST) -o $@
example: $(OBJ_EXAMPLE)
$(CC) $(OBJ_EXAMPLE) -o $@
.SUFFIXES: .c .o
.c.o:
$(CC) $< $(CFLAGS) $(LFLAGS) -c -o $@
run-test: test
./test
run-example: example
./example
clean:
rm -f test example $(OBJ_TEST) $(OBJ_EXAMPLE) *.gc{ov,da,no}
.PHONY: clean run-coverage run-test