diff --git a/arduino-mk/Arduino.mk b/arduino-mk/Arduino.mk index 6102893..d846977 100644 --- a/arduino-mk/Arduino.mk +++ b/arduino-mk/Arduino.mk @@ -514,8 +514,8 @@ CAT = cat ECHO = echo # General arguments -SYS_LIBS = $(patsubst %,$(ARDUINO_LIB_PATH)/%,$(ARDUINO_LIBS)) -USER_LIBS = $(patsubst %,$(USER_LIB_PATH)/%,$(ARDUINO_LIBS)) +SYS_LIBS = $(foreach libdir,$(patsubst %,$(ARDUINO_LIB_PATH)/%,$(ARDUINO_LIBS)),$(call dir_if_exists,$(libdir))) +USER_LIBS = $(foreach libdir,$(patsubst %,$(USER_LIB_PATH)/%,$(ARDUINO_LIBS)),$(call dir_if_exists,$(libdir))) SYS_INCLUDES = $(patsubst %,-I%,$(SYS_LIBS)) USER_INCLUDES = $(patsubst %,-I%,$(USER_LIBS)) LIB_C_SRCS = $(wildcard $(patsubst %,%/*.c,$(SYS_LIBS)))