diff --git a/Makefile.include b/Makefile.include index 351406751d..66c1b5d45f 100644 --- a/Makefile.include +++ b/Makefile.include @@ -66,7 +66,8 @@ endif MAKEOVERRIDES += $(foreach v,$(__DIRECTORY_VARIABLES),$(v)=$($(v))) # Path to the current directory relative to RIOTPROJECT -BUILDRELPATH ?= $(CURDIR:$(RIOTPROJECT)/%=%)/ +# trailing '/' is important when RIOTPROJECT == CURDIR +BUILDRELPATH ?= $(patsubst $(RIOTPROJECT)/%,%,$(CURDIR)/) # get host operating system OS := $(shell uname)