aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorPetteri Aimonen <jpa@git.mail.kapsi.fi>2012-11-16 09:51:23 +0200
committerPetteri Aimonen <jpa@git.mail.kapsi.fi>2012-11-16 09:51:23 +0200
commit434dcbb2eeed391ad418c7d311bd8d6df0cdc5d7 (patch)
tree37eda90639476615fe74a5139d6b3bcb1c2103bd
parent59788e2aabe41d46164184d4c31fd877397b62ee (diff)
Select compilation options based on $(CC) in tests/Makefile.
Makes 'make CC=clang' work. Based on patch submitted by Steffen Siering. Update issue 40: Status: FixedInGit
-rw-r--r--tests/Makefile14
1 files changed, 11 insertions, 3 deletions
diff --git a/tests/Makefile b/tests/Makefile
index a21e3c43..06062127 100644
--- a/tests/Makefile
+++ b/tests/Makefile
@@ -1,12 +1,20 @@
-CFLAGS=-ansi -Wall -Werror -I .. -g -O0 --coverage
-LDFLAGS=--coverage
+CFLAGS=-ansi -Wall -Werror -I .. -g -O0
DEPS=../pb_decode.h ../pb_encode.h ../pb.h person.pb.h callbacks2.pb.h callbacks.pb.h unittests.h unittestproto.pb.h alltypes.pb.h missing_fields.pb.h
TESTS=test_decode1 test_encode1 decode_unittests encode_unittests test_no_messages
TESTS=test_decode1 test_encode1 decode_unittests encode_unittests test_no_messages test_multiple_files
# More strict checks for the core part of nanopb
-CFLAGS_CORE=-pedantic -Wextra -Wcast-qual -Wlogical-op -Wconversion
+CC_VERSION=$(shell $(CC) -v 2>&1)
+CFLAGS_CORE=
+ifneq (,$(findstring gcc,$(CC_VERSION)))
+ CFLAGS_CORE=-pedantic -Wextra -Wcast-qual -Wlogical-op -Wconversion
+ CFLAGS+=--coverage
+ LDFLAGS+=--coverage
+endif
+ifneq (,$(findstring clang,$(CC_VERSION)))
+ CFLAGS_CORE=-pedantic -Wextra -Wcast-qual -Wconversion
+endif
all: breakpoints $(TESTS) run_unittests