1
0
mirror of https://github.com/RIOT-OS/RIOT.git synced 2024-12-29 04:50:03 +01:00

newlib.mk: get NEWLIB_INCLUDE_DIR absolute and without trailing slash

It replaces

    make BOARD=iotlab-m3 info-debug-variable-NEWLIB_INCLUDE_DIR
    /usr/bin/../lib/gcc/arm-none-eabi/7.2.1/../../../../arm-none-eabi/include/

with

    make BOARD=iotlab-m3 info-debug-variable-NEWLIB_INCLUDE_DIR
    /usr/arm-none-eabi/include

Without trailing slash and without relative '..' everywhere.

It also uses `realpath` instead of `abspath` to support Mingw32.
This commit is contained in:
Gaëtan Harter 2018-06-29 18:24:28 +02:00
parent 37a92c4c5e
commit 154d64ee47
No known key found for this signature in database
GPG Key ID: 76DF6BCF1B1F883B

View File

@ -35,7 +35,7 @@ ifeq (,$(NEWLIB_INCLUDE_DIR))
-e '1,/\#include <...> search starts here:/d' \
-e '/End of search list./,$$d' \
-e 's/^ *//')
NEWLIB_INCLUDE_DIR := $(firstword $(dir $(wildcard $(addsuffix /newlib.h, $(COMPILER_INCLUDE_PATHS)))))
NEWLIB_INCLUDE_DIR := $(firstword $(realpath $(dir $(wildcard $(addsuffix /newlib.h, $(COMPILER_INCLUDE_PATHS))))))
endif
ifeq (,$(NEWLIB_INCLUDE_DIR))
@ -63,7 +63,7 @@ ifeq (,$(NEWLIB_INCLUDE_DIR))
# the patterns above. We use the -isystem gcc/clang argument to add the include
# directories as system include directories, which means they will not be
# searched until after all the project specific include directories (-I/path)
NEWLIB_INCLUDE_DIR := $(firstword $(dir $(wildcard $(addsuffix /newlib.h, $(NEWLIB_INCLUDE_PATTERNS)))))
NEWLIB_INCLUDE_DIR := $(firstword $(realpath $(dir $(wildcard $(addsuffix /newlib.h, $(NEWLIB_INCLUDE_PATTERNS))))))
endif
# If nothing was found we will try to fall back to searching for a cross-gcc in