Commit cf33ac7a3d8b2b8f6bb266518aadbf59de397608

Ramsay Jones 2009-06-04T17:10:17

Makefile: Add CFLAGS to the "test_main.c" compile target Also, add the <string.h> include to test_main.c, in order to suppress the resulting "implicit declaration of strcmp()" warning. Signed-off-by: Ramsay Jones <ramsay@ramsay1.demon.co.uk> Signed-off-by: Andreas Ericsson <ae@op5.se>

diff --git a/Makefile b/Makefile
index 6d681ba..9338886 100644
--- a/Makefile
+++ b/Makefile
@@ -135,7 +135,7 @@ $(TEST_OBJ): tests/%.o: tests/%.c
 $(patsubst %.exe,%_main.o,$(TEST_EXE)): tests/%_main.o: $(HDRS)
 $(patsubst %.exe,%_main.o,$(TEST_EXE)): tests/%_main.o: $(T_MAIN_C)
 $(patsubst %.exe,%_main.o,$(TEST_EXE)): tests/%_main.o: tests/%.toc
-	$(CC) -Isrc -I. '-DTEST_TOC="$<"' \
+	$(CC) $(CFLAGS) -Isrc -I. '-DTEST_TOC="$<"' \
 		-c $(T_MAIN_C) \
 		-o $@
 
diff --git a/tests/test_main.c b/tests/test_main.c
index 0be51ee..43bb434 100644
--- a/tests/test_main.c
+++ b/tests/test_main.c
@@ -24,6 +24,7 @@
  */
 
 #include "test_lib.h"
+#include <string.h>
 
 #undef BEGIN_TEST
 #define BEGIN_TEST(name) extern void testfunc__##name(void);