From 9aa4c7f1aaee8906e132e492c0013ebaab3ebd03 Mon Sep 17 00:00:00 2001 From: jsalling Date: Wed, 24 Aug 2016 20:04:14 -0500 Subject: [PATCH] Clean up Makefile, move -Wredundant-decls to test build CC always exists inside make so ?= doesn't assign to it --- test/Makefile | 13 ++++----- test/targets/gcc_auto_sizeof.yml | 48 -------------------------------- 2 files changed, 6 insertions(+), 55 deletions(-) delete mode 100644 test/targets/gcc_auto_sizeof.yml diff --git a/test/Makefile b/test/Makefile index ef13fb9..a780ade 100644 --- a/test/Makefile +++ b/test/Makefile @@ -1,9 +1,9 @@ -CC ?= gcc +CC = gcc ifeq ($(shell uname -s), Darwin) -CC ?= clang +CC = clang endif #DEBUG = -O0 -g -CFLAGS += -std=c99 -pedantic -Wall -Wextra -Werror -Wredundant-decls +CFLAGS += -std=c99 -pedantic -Wall -Wextra -Werror CFLAGS += $(DEBUG) DEFINES = -D UNITY_OUTPUT_CHAR=putcharSpy DEFINES += -D UNITY_SUPPORT_64 -D UNITY_INCLUDE_DOUBLE -D UNITY_NO_WEAK @@ -14,10 +14,9 @@ BUILD_DIR = build TARGET = build/testunity-cov.exe # To generate coverage, call 'make -s', the default target runs. -# To see missing coverage, follow up with 'make uncovered'. # For verbose output of all the tests, run 'make test'. default: coverage -.PHONY: default coverage uncovered test clean +.PHONY: default coverage test clean coverage: $(BUILD_DIR)/testunityRunner.c cd $(BUILD_DIR) && \ $(CC) $(CFLAGS) $(DEFINES) $(foreach i,$(SRC), ../$i) $(COV_FLAGS) -o ../$(TARGET) @@ -28,8 +27,8 @@ coverage: $(BUILD_DIR)/testunityRunner.c grep '###' $(BUILD_DIR)/unity.c.gcov -C2 || true test: CFLAGS += -Wbad-function-cast -Wcast-qual -Wconversion -Wformat=2 -Wold-style-definition \ --Wpointer-arith -Wshadow -Wstrict-overflow=5 -Wstrict-prototypes -Wswitch-default -Wundef \ --Wunreachable-code -Wunused -fstrict-aliasing +-Wpointer-arith -Wredundant-decls -Wshadow -Wstrict-overflow=5 -Wstrict-prototypes \ +-Wswitch-default -Wundef -Wunreachable-code -Wunused -fstrict-aliasing test: $(BUILD_DIR)/testunityRunner.c $(CC) $(CFLAGS) $(DEFINES) $(INC_DIR) $(SRC) -o $(TARGET) ./$(TARGET) diff --git a/test/targets/gcc_auto_sizeof.yml b/test/targets/gcc_auto_sizeof.yml deleted file mode 100644 index d9d0222..0000000 --- a/test/targets/gcc_auto_sizeof.yml +++ /dev/null @@ -1,48 +0,0 @@ -compiler: - path: gcc - source_path: '../src/' - unit_tests_path: &unit_tests_path 'tests/' - build_path: &build_path 'build/' - options: - - '-c' - - '-m64' - - '-Wall' - - '-Wno-address' - - '-std=c99' - - '-pedantic' - includes: - prefix: '-I' - items: - - 'src/' - - '../src/' - - 'testdata/' - - *unit_tests_path - defines: - prefix: '-D' - items: - - UNITY_EXCLUDE_STDINT_H - - UNITY_EXCLUDE_LIMITS_H - - UNITY_INCLUDE_DOUBLE - - UNITY_SUPPORT_TEST_CASES - - UNITY_SUPPORT_64 - object_files: - prefix: '-o' - extension: '.o' - destination: *build_path -linker: - path: gcc - options: - - -lm - - '-m64' - includes: - prefix: '-I' - object_files: - path: *build_path - extension: '.o' - bin_files: - prefix: '-o' - extension: '.exe' - destination: *build_path -colour: true -:unity: - :plugins: [] -- GitLab