mirror of
https://github.com/ThrowTheSwitch/Unity.git
synced 2026-01-23 00:15:58 +01:00
Clean up Makefile, move -Wredundant-decls to test build
CC always exists inside make so ?= doesn't assign to it
This commit is contained in:
@@ -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)
|
||||
|
||||
@@ -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: []
|
||||
Reference in New Issue
Block a user