Most useful when cross-compiling.
Signed-off-by: Ben Gardiner <[email protected]>
---
Makefile | 10 ++++++----
1 files changed, 6 insertions(+), 4 deletions(-)
diff --git a/Makefile b/Makefile
index f03f131..ae846e2 100644
--- a/Makefile
+++ b/Makefile
@@ -1,12 +1,14 @@
-CC = gcc
+CC ?= gcc
AM_CFLAGS = -D_FILE_OFFSET_BITS=64 -D_FORTIFY_SOURCE=2
-CFLAGS = -g -O2
+CFLAGS ?= -g -O2
objects = mmc.o mmc_cmds.o
-CHECKFLAGS= -Wall -Werror -Wuninitialized -Wundef
+CHECKFLAGS = -Wall -Werror -Wuninitialized -Wundef
DEPFLAGS = -Wp,-MMD,$(@D)/.$(@F).d,-MT,$@
+override CFLAGS := $(CHECKFLAGS) $(AM_CFLAGS) $(CFLAGS)
+
INSTALL = install
prefix ?= /usr/local
bindir = $(prefix)/bin
@@ -26,7 +28,7 @@ all: $(progs) manpages
ifdef C
$(check) $<
endif
- $(CC) $(CHECKFLAGS) $(AM_CFLAGS) $(DEPFLAGS) $(CFLAGS) -c $<
+ $(CC) $(CPPFLAGS) $(CFLAGS) $(DEPFLAGS) -c $<
mmc: $(objects)
$(CC) $(CFLAGS) -o $@ $(objects) $(LDFLAGS) $(LIBS)
--
1.7.3.5
--
To unsubscribe from this list: send the line "unsubscribe linux-mmc" in
the body of a message to [email protected]
More majordomo info at http://vger.kernel.org/majordomo-info.html