forked from silentbicycle/greatest
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Makefile
50 lines (35 loc) · 1.07 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
# Warning flags for C and C++:
COMMON_FLAGS += -Wall -Wextra -pedantic -Werror
COMMON_FLAGS += -Wmissing-declarations -g
#COMMON_FLAGS += -Weverything
CFLAGS += ${COMMON_FLAGS}
CPPFLAGS += ${COMMON_FLAGS}
# These warnings are not valid for C++:
CFLAGS += -Wmissing-prototypes
CFLAGS += -Wstrict-prototypes
PROGRAMS_C= example example_no_suite example_no_runner \
example_shuffle example_trunc
PROGRAMS_CPP= example_cpp
# Uncomment to demo c99 parametric testing.
#CFLAGS += -std=c99
# Uncomment to disable setjmp()/longjmp().
#CFLAGS += -DGREATEST_USE_LONGJMP=0
# Uncomment to disable clock() / time.h.
#CFLAGS += -DGREATEST_USE_TIME=0
all: all_c
all_c: ${PROGRAMS_C}
all_cpp: ${PROGRAMS_CPP}
example: example.o example_suite.o
example_no_suite: example_no_suite.o
example_no_runner: example_no_runner.o
example_shuffle: example_shuffle.o
example_cpp: example_cpp.cpp
${CXX} -o $@ example_cpp.cpp ${CPPFLAGS} ${LDFLAGS}
%.o: %.c
${CC} -c -o $@ ${CFLAGS} $<
%: %.o
${CC} -o $@ ${LDFLAGS} $^
*.o: Makefile
*.o: greatest.h
clean:
rm -f ${PROGRAMS_C} ${PROGRAMS_CPP} *.o *.core