diff --git a/sys/newlib/Makefile.include b/makefiles/libc/newlib.mk similarity index 97% rename from sys/newlib/Makefile.include rename to makefiles/libc/newlib.mk index 2e1c6b8cf933e5287c634ebeff3a370b4e8f3559..4d8a784a1ee3e3636d2bf770a9536fbe294c5f6f 100644 --- a/sys/newlib/Makefile.include +++ b/makefiles/libc/newlib.mk @@ -1,5 +1,3 @@ -UNDEF := $(BINDIR)/newlib_syscalls_default/syscalls.o $(UNDEF) - ifneq (,$(filter newlib_nano,$(USEMODULE))) # Test if nano.specs is available ifeq ($(shell $(LINK) -specs=nano.specs -E - 2>/dev/null >/dev/null </dev/null ; echo $$?),0) @@ -48,7 +46,7 @@ NEWLIB_INCLUDE_DIR ?= $(firstword $(wildcard $(NEWLIB_INCLUDE_PATTERNS))) # If nothing was found we will try to fall back to searching for a cross-gcc in # the current PATH and use a relative path for the includes ifeq (,$(NEWLIB_INCLUDE_DIR)) - NEWLIB_INCLUDE_DIR := $(abspath $(wildcard $(dir $(shell command -v $(PREFIX)gcc;))../$(TARGET_ARCH)/include)) + NEWLIB_INCLUDE_DIR := $(abspath $(wildcard $(dir $(shell command -v $(PREFIX)gcc 2>/dev/null))/../$(TARGET_ARCH)/include)) endif ifeq ($(TOOLCHAIN),llvm) diff --git a/sys/Makefile.include b/sys/Makefile.include index 680f655b17bb8ca7bce125ad18af43f7e53ca575..092bb68792ab900489486a844138f6b052127e81 100644 --- a/sys/Makefile.include +++ b/sys/Makefile.include @@ -65,8 +65,12 @@ ifneq (,$(filter log_%,$(USEMODULE))) include $(RIOTBASE)/sys/log/Makefile.include endif +ifneq (,$(filter newlib,$(USEMODULE))) + include $(RIOTMAKE)/libc/newlib.mk +endif + ifneq (,$(filter newlib_syscalls_default,$(USEMODULE))) - include $(RIOTBASE)/sys/newlib/Makefile.include + include $(RIOTBASE)/sys/newlib_syscalls_default/Makefile.include endif ifneq (,$(filter arduino,$(USEMODULE))) diff --git a/sys/newlib/Makefile b/sys/newlib_syscalls_default/Makefile similarity index 50% rename from sys/newlib/Makefile rename to sys/newlib_syscalls_default/Makefile index 586bc62601f730c33345fc66f7f1acda95dd0eb4..48422e909a47d7cd428d10fa73825060ccc8d8c2 100644 --- a/sys/newlib/Makefile +++ b/sys/newlib_syscalls_default/Makefile @@ -1,3 +1 @@ -MODULE = newlib_syscalls_default - include $(RIOTBASE)/Makefile.base diff --git a/sys/newlib_syscalls_default/Makefile.include b/sys/newlib_syscalls_default/Makefile.include new file mode 100644 index 0000000000000000000000000000000000000000..419a6feddc875b9d5f1573348e1285a6b7858ee6 --- /dev/null +++ b/sys/newlib_syscalls_default/Makefile.include @@ -0,0 +1 @@ +UNDEF += $(BINDIR)/newlib_syscalls_default/syscalls.o diff --git a/sys/newlib/syscalls.c b/sys/newlib_syscalls_default/syscalls.c similarity index 100% rename from sys/newlib/syscalls.c rename to sys/newlib_syscalls_default/syscalls.c