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 endif
%.ramprof: %.$(TARGET) %.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) %.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 # Don't treat %.$(TARGET) as an intermediate file because it is
# in fact the primary target. # 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 CONTIKI_SOURCEFILES += mtarch.c rtimer-arch.c elfloader-stub.c watchdog.c
### Compiler definitions ### Compiler definitions
CC = gcc CC ?= gcc
LD = gcc LD ?= gcc
AS = as AS ?= as
NM = nm NM ?= nm
OBJCOPY = objcopy OBJCOPY ?= objcopy
STRIP = strip STRIP ?= strip
ifdef WERROR ifdef WERROR
CFLAGSWERROR=-Werror -pedantic -std=c99 -Werror CFLAGSWERROR=-Werror -pedantic -std=c99 -Werror
endif endif
CFLAGSNO = -Wall -g -I/usr/local/include $(CFLAGSWERROR) CFLAGSNO = -Wall -g -I/usr/local/include $(CFLAGSWERROR)
CFLAGS += $(CFLAGSNO) -O CFLAGS += $(CFLAGSNO) -O
ifeq ($(HOST_OS),Linux) ifeq ($(HOST_OS),Linux)
LDFLAGS = -Wl,-Map=contiki-$(TARGET).map,-export-dynamic LDFLAGS += -Wl,-Map=contiki-$(TARGET).map,-export-dynamic
else else
LDFLAGS = -Wl LDFLAGS += -Wl
endif endif
### Compilation rules ### Compilation rules