mirror of
https://github.com/oliverschmidt/contiki.git
synced 2024-11-17 21:09:03 +00:00
b8c0f2de6c
This patch removes a defunct EEPROM implementation from the native platform and provides a new EEPROM implementation for the native cpu. The previous implementation appears to be vestigal. This is useful for testing code which uses the EEPROM without running the code on the actual hardware. By default the code will create a new temporary file as the EEPROM backing, reinitializing each time. If you would like to preserve the EEPROM contents or specify a specific EEPROM file to use, you can set the `CONTIKI_EEPROM` environment variable to the name of the EEPROM file you wish to use instead. If it already exists, its contents will be used. If it does not already exist, it will be created and initialized by filling it with `0xFF`---just like a real EEPROM. A new example is also included, which was used to verify the correctness of the implementation. It can easily be used to verify the EEPROM implementations of other targets.
48 lines
1.0 KiB
Makefile
48 lines
1.0 KiB
Makefile
CONTIKI_CPU_DIRS = . net dev
|
|
|
|
CONTIKI_SOURCEFILES += mtarch.c rtimer-arch.c elfloader-stub.c watchdog.c eeprom.c
|
|
|
|
### Compiler definitions
|
|
CC ?= gcc
|
|
ifdef LD_OVERRIDE
|
|
LD = $(LD_OVERRIDE)
|
|
else
|
|
LD = gcc
|
|
endif
|
|
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),Darwin)
|
|
AROPTS = -r
|
|
LDFLAGS += -Wl,-flat_namespace
|
|
CFLAGS += -DHAVE_SNPRINTF=1 -U__ASSERT_USE_STDERR
|
|
else
|
|
ifeq ($(HOST_OS),Linux)
|
|
LDFLAGS = -Wl,-Map=contiki-$(TARGET).map,-export-dynamic
|
|
endif
|
|
endif
|
|
|
|
### Compilation rules
|
|
|
|
%.so: $(OBJECTDIR)/%.o
|
|
$(LD) -shared -o $@ $^
|
|
|
|
ifdef CORE
|
|
.PHONY: symbols.c symbols.h
|
|
symbols.c symbols.h:
|
|
$(NM) -C $(CORE) | grep -v @ | grep -v dll_crt0 | awk -f $(CONTIKI)/tools/mknmlist > symbols.c
|
|
else
|
|
symbols.c symbols.h:
|
|
cp ${CONTIKI}/tools/empty-symbols.c symbols.c
|
|
cp ${CONTIKI}/tools/empty-symbols.h symbols.h
|
|
endif
|
|
|
|
contiki-$(TARGET).a: ${addprefix $(OBJECTDIR)/,symbols.o}
|