summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDanny Al-Gaaf <danny.al-gaaf@bisect.de>2014-05-15 16:33:11 +0200
committerDanny Al-Gaaf <danny.al-gaaf@bisect.de>2014-05-15 17:06:48 +0200
commit87b63c2a6813d7024aa9fc48dfd5d4677462b383 (patch)
treeda598ee5ec21a681b849834ae1a78940d1dfd022
parent9dc3a9c683385abfe4ad92b7c6ff30719acc3c13 (diff)
downloadceph-libs3-87b63c2a6813d7024aa9fc48dfd5d4677462b383.tar.gz
GNUmakefile: enable support for CC env variable to use e.g. clang
Signed-off-by: Danny Al-Gaaf <danny.al-gaaf@bisect.de>
-rw-r--r--GNUmakefile19
1 files changed, 12 insertions, 7 deletions
diff --git a/GNUmakefile b/GNUmakefile
index 7a74ec3..f387e30 100644
--- a/GNUmakefile
+++ b/GNUmakefile
@@ -91,6 +91,11 @@ ifndef DESTDIR
DESTDIR := /usr
endif
+# --------------------------------------------------------------------------
+# Compiler CC handling
+ifndef CC
+ CC := gcc
+endif
# --------------------------------------------------------------------------
# Acquire configuration information for libraries that libs3 depends upon
@@ -205,18 +210,18 @@ uninstall:
$(BUILD)/obj/%.o: src/%.c
$(QUIET_ECHO) $@: Compiling object
@ mkdir -p $(dir $(BUILD)/dep/$<)
- @ gcc $(CFLAGS) -M -MG -MQ $@ -DCOMPILINGDEPENDENCIES \
+ @ $(CC) $(CFLAGS) -M -MG -MQ $@ -DCOMPILINGDEPENDENCIES \
-o $(BUILD)/dep/$(<:%.c=%.d) -c $<
@ mkdir -p $(dir $@)
- $(VERBOSE_SHOW) gcc $(CFLAGS) -o $@ -c $<
+ $(VERBOSE_SHOW) $(CC) $(CFLAGS) -o $@ -c $<
$(BUILD)/obj/%.do: src/%.c
$(QUIET_ECHO) $@: Compiling dynamic object
@ mkdir -p $(dir $(BUILD)/dep/$<)
- @ gcc $(CFLAGS) -M -MG -MQ $@ -DCOMPILINGDEPENDENCIES \
+ @ $(CC) $(CFLAGS) -M -MG -MQ $@ -DCOMPILINGDEPENDENCIES \
-o $(BUILD)/dep/$(<:%.c=%.dd) -c $<
@ mkdir -p $(dir $@)
- $(VERBOSE_SHOW) gcc $(CFLAGS) -fpic -fPIC -o $@ -c $<
+ $(VERBOSE_SHOW) $(CC) $(CFLAGS) -fpic -fPIC -o $@ -c $<
# --------------------------------------------------------------------------
@@ -236,7 +241,7 @@ LIBS3_SOURCES := acl.c bucket.c error_parser.c general.c \
$(LIBS3_SHARED): $(LIBS3_SOURCES:%.c=$(BUILD)/obj/%.do)
$(QUIET_ECHO) $@: Building shared library
@ mkdir -p $(dir $@)
- $(VERBOSE_SHOW) gcc -shared -Wl,-soname,libs3.so.$(LIBS3_VER_MAJOR) \
+ $(VERBOSE_SHOW) $(CC) -shared -Wl,-soname,libs3.so.$(LIBS3_VER_MAJOR) \
-o $@ $^ $(LDFLAGS)
$(LIBS3_STATIC): $(LIBS3_SOURCES:%.c=$(BUILD)/obj/%.o)
@@ -254,7 +259,7 @@ s3: $(BUILD)/bin/s3
$(BUILD)/bin/s3: $(BUILD)/obj/s3.o $(LIBS3_SHARED)
$(QUIET_ECHO) $@: Building executable
@ mkdir -p $(dir $@)
- $(VERBOSE_SHOW) gcc -o $@ $^ $(LDFLAGS)
+ $(VERBOSE_SHOW) $(CC) -o $@ $^ $(LDFLAGS)
# --------------------------------------------------------------------------
@@ -278,7 +283,7 @@ test: $(BUILD)/bin/testsimplexml
$(BUILD)/bin/testsimplexml: $(BUILD)/obj/testsimplexml.o $(LIBS3_STATIC)
$(QUIET_ECHO) $@: Building executable
@ mkdir -p $(dir $@)
- $(VERBOSE_SHOW) gcc -o $@ $^ $(LIBXML2_LIBS)
+ $(VERBOSE_SHOW) $(CC) -o $@ $^ $(LIBXML2_LIBS)
# --------------------------------------------------------------------------