135375f98Sopenharmony_ciCC = gcc 235375f98Sopenharmony_ciifeq ($(shell uname -s), Darwin) 335375f98Sopenharmony_ciCC = clang 435375f98Sopenharmony_ciendif 535375f98Sopenharmony_ci#DEBUG = -O0 -g 635375f98Sopenharmony_ciCFLAGS += -std=c99 -pedantic -Wall -Wextra -Werror -DUNITY_FIXTURE_NO_EXTRAS 735375f98Sopenharmony_ciCFLAGS += $(DEBUG) 835375f98Sopenharmony_ciSRC = ../src/unity_fixture.c \ 935375f98Sopenharmony_ci ../../../src/unity.c \ 1035375f98Sopenharmony_ci unity_fixture_Test.c \ 1135375f98Sopenharmony_ci unity_fixture_TestRunner.c \ 1235375f98Sopenharmony_ci main/AllTests.c 1335375f98Sopenharmony_ci 1435375f98Sopenharmony_ciINC_DIR = -I../src -I../../../src/ 1535375f98Sopenharmony_ciBUILD_DIR = ../build 1635375f98Sopenharmony_ciTARGET = ../build/fixture_tests.exe 1735375f98Sopenharmony_ci 1835375f98Sopenharmony_ciall: default noStdlibMalloc 32bits 1935375f98Sopenharmony_ci 2035375f98Sopenharmony_cidefault: $(BUILD_DIR) 2135375f98Sopenharmony_ci $(CC) $(CFLAGS) $(DEFINES) $(SRC) $(INC_DIR) -o $(TARGET) -D UNITY_SUPPORT_64 2235375f98Sopenharmony_ci @ echo "default build" 2335375f98Sopenharmony_ci ./$(TARGET) 2435375f98Sopenharmony_ci 2535375f98Sopenharmony_ci32bits: $(BUILD_DIR) 2635375f98Sopenharmony_ci $(CC) $(CFLAGS) $(DEFINES) $(SRC) $(INC_DIR) -o $(TARGET) -m32 2735375f98Sopenharmony_ci @ echo "32bits build" 2835375f98Sopenharmony_ci ./$(TARGET) 2935375f98Sopenharmony_ci 3035375f98Sopenharmony_cinoStdlibMalloc: $(BUILD_DIR) 3135375f98Sopenharmony_ci $(CC) $(CFLAGS) $(DEFINES) $(SRC) $(INC_DIR) -o $(TARGET) -D UNITY_EXCLUDE_STDLIB_MALLOC 3235375f98Sopenharmony_ci @ echo "build with noStdlibMalloc" 3335375f98Sopenharmony_ci ./$(TARGET) 3435375f98Sopenharmony_ci 3535375f98Sopenharmony_ciC89: CFLAGS += -D UNITY_EXCLUDE_STDINT_H # C89 did not have type 'long long', <stdint.h> 3635375f98Sopenharmony_ciC89: $(BUILD_DIR) 3735375f98Sopenharmony_ci $(CC) $(CFLAGS) $(DEFINES) $(SRC) $(INC_DIR) -o $(TARGET) -std=c89 && ./$(TARGET) 3835375f98Sopenharmony_ci $(CC) $(CFLAGS) $(DEFINES) $(SRC) $(INC_DIR) -o $(TARGET) -D UNITY_EXCLUDE_STDLIB_MALLOC -std=c89 3935375f98Sopenharmony_ci ./$(TARGET) 4035375f98Sopenharmony_ci 4135375f98Sopenharmony_ci$(BUILD_DIR): 4235375f98Sopenharmony_ci mkdir -p $(BUILD_DIR) 4335375f98Sopenharmony_ci 4435375f98Sopenharmony_ciclean: 4535375f98Sopenharmony_ci rm -f $(TARGET) $(BUILD_DIR)/*.gc* 4635375f98Sopenharmony_ci 4735375f98Sopenharmony_cicov: $(BUILD_DIR) 4835375f98Sopenharmony_ci cd $(BUILD_DIR) && \ 4935375f98Sopenharmony_ci $(CC) $(DEFINES) $(foreach i, $(SRC), ../test/$(i)) $(INC_DIR) -o $(TARGET) -fprofile-arcs -ftest-coverage 5035375f98Sopenharmony_ci rm -f $(BUILD_DIR)/*.gcda 5135375f98Sopenharmony_ci ./$(TARGET) > /dev/null ; ./$(TARGET) -v > /dev/null 5235375f98Sopenharmony_ci cd $(BUILD_DIR) && \ 5335375f98Sopenharmony_ci gcov unity_fixture.c | head -3 5435375f98Sopenharmony_ci grep '###' $(BUILD_DIR)/unity_fixture.c.gcov -C2 || true # Show uncovered lines 5535375f98Sopenharmony_ci 5635375f98Sopenharmony_ci# These extended flags DO get included before any target build runs 5735375f98Sopenharmony_ciCFLAGS += -Wbad-function-cast 5835375f98Sopenharmony_ciCFLAGS += -Wcast-qual 5935375f98Sopenharmony_ciCFLAGS += -Wconversion 6035375f98Sopenharmony_ciCFLAGS += -Wformat=2 6135375f98Sopenharmony_ciCFLAGS += -Wmissing-prototypes 6235375f98Sopenharmony_ciCFLAGS += -Wold-style-definition 6335375f98Sopenharmony_ciCFLAGS += -Wpointer-arith 6435375f98Sopenharmony_ciCFLAGS += -Wshadow 6535375f98Sopenharmony_ciCFLAGS += -Wstrict-overflow=5 6635375f98Sopenharmony_ciCFLAGS += -Wstrict-prototypes 6735375f98Sopenharmony_ciCFLAGS += -Wswitch-default 6835375f98Sopenharmony_ciCFLAGS += -Wundef 6935375f98Sopenharmony_ciCFLAGS += -Wno-error=undef # Warning only, this should not stop the build 7035375f98Sopenharmony_ciCFLAGS += -Wunreachable-code 7135375f98Sopenharmony_ciCFLAGS += -Wunused 7235375f98Sopenharmony_ciCFLAGS += -fstrict-aliasing 73