1
0
mirror of https://github.com/RIOT-OS/RIOT.git synced 2024-12-29 04:50:03 +01:00
RIOT/boards/native/Makefile.include
Ludwig Ortmann d40b6ac5b1 native+osx makefile cleanup
* add missing $(AD) to osx $(LINK) invocation
* move osx build determination to native makefile
* move old libc test to native makefile
* set objcopy to "true" - it is superfluous for native no matter what the system is
* add some documentation to natives makefile
2014-02-10 12:25:47 +01:00

62 lines
1.4 KiB
Makefile

export INCLUDES += -I$(RIOTBOARD)/$(BOARD)/include
export CPU = native
export ELF = $(BINDIR)$(PROJECT).elf
# toolchain:
export PREFIX =
export CC ?= $(PREFIX)gcc
export AR = $(PREFIX)ar
export AS = $(PREFIX)as
export LINK = $(PREFIX)gcc
export SIZE = $(PREFIX)size
export OBJCOPY = true
export DEBUGGER = gdb
export TERMPROG = $(ELF)
export FLASHER = true
export VALGRIND ?= valgrind
# flags:
export CFLAGS += -std=gnu99 -Wall -Wextra -pedantic -m32
export LINKFLAGS += -m32 -gc -ldl
export ASFLAGS =
export DEBUGGER_FLAGS = $(ELF)
export VALGRIND_FLAGS ?= --track-origins=yes
all-valgrind: export CFLAGS += -DHAVE_VALGRIND_VALGRIND_H -g
# backward compatability with glibc <= 2.17 for native
ifeq ($(CPU),native)
ifeq ($(shell uname -s),Linux)
ifeq ($(shell ldd --version | awk '/^ldd/{if ($$NF < 2.17) {print "yes"} else {print "no"} }'),yes)
LINKFLAGS += -lrt
endif
endif
endif
# clumsy way to enable building native on osx:
BUILDOSXNATIVE = 0
ifeq ($(CPU),native)
ifeq ($(shell uname -s),Darwin)
BUILDOSXNATIVE = 1
endif
endif
# set the tap interface for term/valgrind
ifneq (,$(findstring nativenet,$(USEMODULE)))
export PORT ?= tap0
else
export PORT =
endif
all: # do not override first target
all-valgrind: all
valgrind:
# use this if you want to attach gdb from valgrind:
# echo 0 > /proc/sys/kernel/yama/ptrace_scope
# VALGRIND_FLAGS += --db-attach=yes
$(VALGRIND) $(VALGRIND_FLAGS) $(ELF) $(PORT)
include $(RIOTBOARD)/$(BOARD)/Makefile.dep