Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
OpenHarmony
Third Party Unity
提交
c5e9a934
T
Third Party Unity
项目概览
OpenHarmony
/
Third Party Unity
接近 2 年 前同步成功
通知
38
Star
144
Fork
2
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
T
Third Party Unity
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
提交
Issue看板
提交
c5e9a934
编写于
1月 13, 2017
作者:
M
Mark VanderVoord
提交者:
GitHub
1月 13, 2017
浏览文件
操作
浏览文件
下载
差异文件
Merge pull request #243 from jsalling/feature/makefile-clang
Organize Makefile so clang works on all platforms, warnings are set
上级
9954d4f8
a0cb1385
变更
1
隐藏空白更改
内联
并排
Showing
1 changed file
with
15 addition
and
15 deletion
+15
-15
test/Makefile
test/Makefile
+15
-15
未找到文件。
test/Makefile
浏览文件 @
c5e9a934
CC
=
gcc
ifeq
($(shell uname -s), Darwin)
CC
=
clang
CFLAGS
+=
-std
=
c99
-pedantic
-Wall
-Weverything
-Werror
CFLAGS
+=
-Wno-unknown-warning-option
-Wno-switch-enum
CFLAGS
+=
-Wno-padded
-Wno-double-promotion
-Wno-missing-noreturn
CFLAGS
+=
-Wno-missing-prototypes
endif
ifeq
($(shell uname -s), Linux)
CFLAGS
+=
-std
=
c99
-pedantic
-Wall
-Wextra
-Werror
ifeq
($(findstring clang, $(CC)), clang)
E
=
-Weverything
CFLAGS
+=
$E
-Wno-unknown-warning-option
-Wno-missing-prototypes
CFLAGS
+=
-Wno-unused-macros
-Wno-padded
-Wno-missing-noreturn
endif
CFLAGS
+=
-std
=
c99
-pedantic
-Wall
-Wextra
-Wconversion
-Werror
CFLAGS
+=
-Wno-switch-enum
-Wno-double-promotion
CFLAGS
+=
-Wbad-function-cast
-Wcast-qual
-Wold-style-definition
-Wshadow
-Wstrict-overflow
\
-Wstrict-prototypes
-Wswitch-default
-Wundef
#DEBUG = -O0 -g
CFLAGS
+=
$(DEBUG)
DEFINES
=
-D
UNITY_OUTPUT_CHAR
=
putcharSpy
DEFINES
+=
-D
UNITY_SUPPORT_64
-D
UNITY_INCLUDE_DOUBLE
-D
UNITY_NO_WEAK
DEFINES
+=
-D
UNITY_SUPPORT_64
-D
UNITY_INCLUDE_DOUBLE
SRC
=
../src/unity.c tests/testunity.c build/testunityRunner.c
INC_DIR
=
-I
../src
COV_FLAGS
=
-fprofile-arcs
-ftest-coverage
-I
../../src
...
...
@@ -23,6 +25,7 @@ TARGET = build/testunity-cov.exe
# For verbose output of all the tests, run 'make test'.
default
:
coverage
.PHONY
:
default coverage test clean
coverage
:
DEFINES += -D UNITY_NO_WEAK
coverage
:
$(BUILD_DIR)/testunityRunner.c
cd
$(BUILD_DIR)
&&
\
$(CC)
$(CFLAGS)
$(DEFINES)
$(
foreach
i,
$(SRC)
, ../
$i
)
$(COV_FLAGS)
-o
../
$(TARGET)
...
...
@@ -32,9 +35,6 @@ coverage: $(BUILD_DIR)/testunityRunner.c
gcov unity.c |
head
-3
grep
'###'
$(BUILD_DIR)
/unity.c.gcov
-C2
||
true
test
:
CFLAGS += -Wbad-function-cast -Wcast-qual -Wconversion -Wformat=2 -Wold-style-definition
\
-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)
...
...
@@ -50,11 +50,11 @@ $(BUILD_DIR)/testunityRunner.c: tests/testunity.c | $(BUILD_DIR)
AWK_SCRIPT
=
\
'/^void test/{ declarations[d++]=$$0; gsub(/\(?void\)? ?/,""); tests[t++]=$$0; line[u++]=NR } \
END{ print "\#include \"unity.h\" /* Autogenerated by awk in Makefile */" ; \
for (i=0; i<d; i++) { print declarations[i] ";" } \
print
f "int main(void)\n{\n UNITY_BEGIN();\n" ;
\
for (i=0; i<t; i++) { print " RUN_TEST(" tests[i] ", " line[i] ");" } \
print
f " return UNITY_END();\n}\n
" }'
END{ print "\#include \"unity.h\" /* Autogenerated by awk in Makefile */" ;
\
for (i=0; i<d; i++) { print declarations[i] ";" }
\
print
"int main(void)\n{\n UnityBegin(\"" FILENAME "\");" ;
\
for (i=0; i<t; i++) { print " RUN_TEST(" tests[i] ", " line[i] ");" }
\
print
" return UNITY_END();\n}
" }'
$(BUILD_DIR)
:
mkdir
-p
$(BUILD_DIR)
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录