Merge pull request #40 from errordeveloper/cross-native

Enable `native` target for cross-compiling
This commit is contained in:
Adam Dunkels 2012-11-21 10:14:15 -08:00
commit 135ae838de
2 changed files with 10 additions and 10 deletions

View file

@ -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.

View file

@ -3,21 +3,21 @@ 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
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