Debian Codegraph @

vendor/unity/extras/fixture/test/Makefile

raw
1 CC = gcc
2 ifeq ($(shell uname -s), Darwin)
3 CC = clang
4 endif
5 #DEBUG = -O0 -g
6 CFLAGS += -std=c99 -pedantic -Wall -Wextra -Werror -DUNITY_FIXTURE_NO_EXTRAS
7 CFLAGS += $(DEBUG)
8 SRC = ../src/unity_fixture.c \
9 ../../../src/unity.c \
10 unity_fixture_Test.c \
11 unity_fixture_TestRunner.c \
12 main/AllTests.c
13
14 INC_DIR = -I../src -I../../../src/
15 BUILD_DIR = ../build
16 TARGET = ../build/fixture_tests.exe
17
18 all: default noStdlibMalloc 32bits
19
20 default: $(BUILD_DIR)
21 $(CC) $(CFLAGS) $(DEFINES) $(SRC) $(INC_DIR) -o $(TARGET) -D UNITY_SUPPORT_64
22 @ echo "default build"
23 ./$(TARGET)
24
25 32bits: $(BUILD_DIR)
26 $(CC) $(CFLAGS) $(DEFINES) $(SRC) $(INC_DIR) -o $(TARGET) -m32
27 @ echo "32bits build"
28 ./$(TARGET)
29
30 noStdlibMalloc: $(BUILD_DIR)
31 $(CC) $(CFLAGS) $(DEFINES) $(SRC) $(INC_DIR) -o $(TARGET) -D UNITY_EXCLUDE_STDLIB_MALLOC
32 @ echo "build with noStdlibMalloc"
33 ./$(TARGET)
34
35 C89: CFLAGS += -D UNITY_EXCLUDE_STDINT_H # C89 did not have type 'long long', <stdint.h>
36 C89: $(BUILD_DIR)
37 $(CC) $(CFLAGS) $(DEFINES) $(SRC) $(INC_DIR) -o $(TARGET) -std=c89 && ./$(TARGET)
38 $(CC) $(CFLAGS) $(DEFINES) $(SRC) $(INC_DIR) -o $(TARGET) -D UNITY_EXCLUDE_STDLIB_MALLOC -std=c89
39 ./$(TARGET)
40
41 $(BUILD_DIR):
42 mkdir -p $(BUILD_DIR)
43
44 clean:
45 rm -f $(TARGET) $(BUILD_DIR)/*.gc*
46
47 cov: $(BUILD_DIR)
48 cd $(BUILD_DIR) && \
49 $(CC) $(DEFINES) $(foreach i, $(SRC), ../test/$(i)) $(INC_DIR) -o $(TARGET) -fprofile-arcs -ftest-coverage
50 rm -f $(BUILD_DIR)/*.gcda
51 ./$(TARGET) > /dev/null ; ./$(TARGET) -v > /dev/null
52 cd $(BUILD_DIR) && \
53 gcov unity_fixture.c | head -3
54 grep '###' $(BUILD_DIR)/unity_fixture.c.gcov -C2 || true # Show uncovered lines
55
56 # These extended flags DO get included before any target build runs
57 CFLAGS += -Wbad-function-cast
58 CFLAGS += -Wcast-qual
59 CFLAGS += -Wconversion
60 CFLAGS += -Wformat=2
61 CFLAGS += -Wmissing-prototypes
62 CFLAGS += -Wold-style-definition
63 CFLAGS += -Wpointer-arith
64 CFLAGS += -Wshadow
65 CFLAGS += -Wstrict-overflow=5
66 CFLAGS += -Wstrict-prototypes
67 CFLAGS += -Wswitch-default
68 CFLAGS += -Wundef
69 CFLAGS += -Wno-error=undef # Warning only, this should not stop the build
70 CFLAGS += -Wunreachable-code
71 CFLAGS += -Wunused
72 CFLAGS += -fstrict-aliasing