From 75bc8595c72fba7bd77ac99249d49d3ade1ef7fd Mon Sep 17 00:00:00 2001 From: Pieter Noordhuis Date: Thu, 21 Apr 2011 18:13:20 +0200 Subject: Only use C99 for compiling hiredis itself The libevent example cannot be compiled when -std=c99 is passed. It is not necessary that the adapters nor the examples follow this standard, as long as the code for hiredis itself is compliant. --- Makefile | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'Makefile') diff --git a/Makefile b/Makefile index 8ba84e4..c7b90b1 100644 --- a/Makefile +++ b/Makefile @@ -8,7 +8,7 @@ BINS = hiredis-example hiredis-test uname_S := $(shell sh -c 'uname -s 2>/dev/null || echo not') OPTIMIZATION?=-O3 ifeq ($(uname_S),SunOS) - CFLAGS?=-std=c99 -pedantic $(OPTIMIZATION) -fPIC -Wall -W -D__EXTENSIONS__ -D_XPG6 $(ARCH) $(PROF) + CFLAGS?=$(OPTIMIZATION) -fPIC -Wall -W -D__EXTENSIONS__ -D_XPG6 $(ARCH) $(PROF) CCLINK?=-ldl -lnsl -lsocket -lm -lpthread LDFLAGS?=-L. -Wl,-R,. DYLIBNAME?=libhiredis.so @@ -17,7 +17,7 @@ ifeq ($(uname_S),SunOS) STLIB_MAKE_CMD?=ar rcs ${STLIBNAME} ${OBJ} else ifeq ($(uname_S),Darwin) - CFLAGS?=-std=c99 -pedantic $(OPTIMIZATION) -fPIC -Wall -W -Wstrict-prototypes -Wwrite-strings $(ARCH) $(PROF) + CFLAGS?=$(OPTIMIZATION) -fPIC -Wall -W -Wstrict-prototypes -Wwrite-strings $(ARCH) $(PROF) CCLINK?=-lm -pthread LDFLAGS?=-L. -Wl,-rpath,. OBJARCH?=-arch i386 -arch x86_64 @@ -26,7 +26,7 @@ ifeq ($(uname_S),Darwin) STLIBNAME?=libhiredis.a STLIB_MAKE_CMD?=libtool -static -o ${STLIBNAME} - ${OBJ} else - CFLAGS?=-std=c99 -pedantic $(OPTIMIZATION) -fPIC -Wall -W -Wstrict-prototypes -Wwrite-strings $(ARCH) $(PROF) + CFLAGS?=$(OPTIMIZATION) -fPIC -Wall -W -Wstrict-prototypes -Wwrite-strings $(ARCH) $(PROF) CCLINK?=-lm -pthread LDFLAGS?=-L. -Wl,-rpath,. DYLIBNAME?=libhiredis.so @@ -86,7 +86,7 @@ test: hiredis-test ./hiredis-test .c.o: - $(CC) -c $(CFLAGS) $(OBJARCH) $(DEBUG) $(COMPILE_TIME) $< + $(CC) -std=c99 -pedantic -c $(CFLAGS) $(OBJARCH) $(DEBUG) $(COMPILE_TIME) $< clean: rm -rf ${DYLIBNAME} ${STLIBNAME} $(BINS) hiredis-example* *.o *.gcda *.gcno *.gcov -- cgit v1.2.3