mirror of
https://github.com/oliverschmidt/contiki.git
synced 2024-11-19 03:05:14 +00:00
9b6b5ce5b0
This patch enhances build_newlib.sh to create Makefile.libc so that the main Galileo makefile can attempt to include Makefile.libc and instruct the developer to run build_newlib.sh first if the definition within Makefile.libc is not detected.
26 lines
1.0 KiB
Makefile
26 lines
1.0 KiB
Makefile
BSP_PATH=$(CONTIKI)/platform/galileo/bsp
|
|
LIBC_PATH=$(BSP_PATH)/libc
|
|
LIBC=$(LIBC_PATH)/i586-elf
|
|
LIBGCC_PATH = /usr/lib/gcc/$(shell gcc -dumpmachine)/$(shell gcc -dumpversion)
|
|
|
|
CONTIKI_TARGET_DIRS = . core/sys/
|
|
CONTIKI_TARGET_MAIN = ${addprefix $(OBJECTDIR)/,contiki-main.o}
|
|
CONTIKI_SOURCEFILES += contiki-main.c newlib-syscalls.c clock.c rtimer-arch.c
|
|
|
|
CONTIKI_CPU=$(CONTIKI)/cpu/x86
|
|
include $(CONTIKI)/cpu/x86/Makefile.x86_quarkX1000
|
|
|
|
CFLAGS += -fno-stack-protector -nostdinc -isystem $(LIBC)/include -isystem $(LIBGCC_PATH)/include -isystem $(LIBGCC_PATH)/include-fixed
|
|
LDFLAGS += -nostdlib
|
|
|
|
-include $(LIBC_PATH)/Makefile.libc
|
|
|
|
ifndef BUILT_LIBC
|
|
$(error Build the C library by executing $(LIBC_PATH)/build_newlib.sh)
|
|
endif
|
|
|
|
# Ideally, this should be part of LDFLAGS (-lc -lm etc). However, we found out that archive
|
|
# static files (.a) must be linked after our own object files, otherwise the linker gets lost
|
|
# and we get undefined references only.
|
|
TARGET_LIBFILES = $(OBJECTDIR)/newlib-syscalls.o $(LIBC)/lib/libm.a $(LIBC)/lib/libc.a $(LIBGCC_PATH)/32/libgcc.a
|