From 6690c5f13e0d733d87e42e437db89331f23efe1f Mon Sep 17 00:00:00 2001 From: Ilya Dmitrichenko Date: Wed, 11 Jul 2012 00:02:59 +0100 Subject: [PATCH 1/3] Fix hardcoded reference to nm(1) --- Makefile.include | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Makefile.include b/Makefile.include index 1acfa4ebb..d257eeabb 100644 --- a/Makefile.include +++ b/Makefile.include @@ -228,10 +228,10 @@ ifndef CUSTOM_RULE_LINK endif %.ramprof: %.$(TARGET) - nm -S -td --size-sort $< | grep -i " [abdrw] " | cut -d' ' -f2,4 + $(NM) -S -td --size-sort $< | grep -i " [abdrw] " | cut -d' ' -f2,4 %.flashprof: %.$(TARGET) - nm -S -td --size-sort $< | grep -i " [t] " | cut -d' ' -f2,4 + $(NM) -S -td --size-sort $< | grep -i " [t] " | cut -d' ' -f2,4 # Don't treat %.$(TARGET) as an intermediate file because it is # in fact the primary target. From 092c69639c099562741cc5b30ed5ec6d298c3769 Mon Sep 17 00:00:00 2001 From: Ilya Dmitrichenko Date: Wed, 11 Jul 2012 00:06:39 +0100 Subject: [PATCH 2/3] Enable `native` target for cross-compiling - by now it would have worked if you set CC via command line (e.g. `make CC=clang`, though it wouldn't work when CC is set in the platform makefile which includes `Makefile.native`. --- cpu/native/Makefile.native | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/cpu/native/Makefile.native b/cpu/native/Makefile.native index 56fb6688b..166c139cc 100644 --- a/cpu/native/Makefile.native +++ b/cpu/native/Makefile.native @@ -3,12 +3,12 @@ CONTIKI_CPU_DIRS = . net CONTIKI_SOURCEFILES += mtarch.c rtimer-arch.c elfloader-stub.c watchdog.c ### Compiler definitions -CC = gcc -LD = gcc -AS = as -NM = nm -OBJCOPY = objcopy -STRIP = strip +CC ?= gcc +LD ?= gcc +AS ?= as +NM ?= nm +OBJCOPY ?= objcopy +STRIP ?= strip ifdef WERROR CFLAGSWERROR=-Werror -pedantic -std=c99 -Werror endif From d0f18e5d04c3feb163c8c870076be005514dbf06 Mon Sep 17 00:00:00 2001 From: Ilya Dmitrichenko Date: Wed, 11 Jul 2012 01:09:34 +0100 Subject: [PATCH 3/3] Fixed LDFLAGS for cross-compiling of "native" --- cpu/native/Makefile.native | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/cpu/native/Makefile.native b/cpu/native/Makefile.native index 166c139cc..9f0ce13fb 100644 --- a/cpu/native/Makefile.native +++ b/cpu/native/Makefile.native @@ -15,9 +15,9 @@ endif CFLAGSNO = -Wall -g -I/usr/local/include $(CFLAGSWERROR) CFLAGS += $(CFLAGSNO) -O ifeq ($(HOST_OS),Linux) - LDFLAGS = -Wl,-Map=contiki-$(TARGET).map,-export-dynamic + LDFLAGS += -Wl,-Map=contiki-$(TARGET).map,-export-dynamic else - LDFLAGS = -Wl + LDFLAGS += -Wl endif ### Compilation rules