From: Christian Muller christian.muller@linaro.org
Launchpad Bug #1306587: Makefile doesn't use CROSS_COMPILE flag. Add the CROSS_COMPILE flag support to allow cross compile and build of idlestat for other targets.
Signed-off-by: Christian Muller christian.muller@linaro.org --- Makefile | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-)
diff --git a/Makefile b/Makefile index 5838e0f..f74b48c 100644 --- a/Makefile +++ b/Makefile @@ -22,14 +22,17 @@ # Zoran Markovic zoran.markovic@linaro.org # CFLAGS?=-g -Wall -CC?=gcc +CC=gcc
OBJS = idlestat.o topology.o trace.o utils.o
default: idlestat
+%.o: %.c + $(CROSS_COMPILE)$(CC) -c -o $@ $< $(CFLAGS) + idlestat: $(OBJS) - $(CC) ${CFLAGS} $(OBJS) -o $@ + $(CROSS_COMPILE)$(CC) $(CFLAGS) $(OBJS) -o $@
clean: rm -f $(OBJS) idlestat