assign value on assignment and patsubst USER_LIBS with main and deps
This commit is contained in:
parent
bf20d7d26b
commit
8305fa662f
1 changed files with 11 additions and 9 deletions
20
Arduino.mk
20
Arduino.mk
|
@ -767,13 +767,13 @@ endif
|
||||||
# Automatically find the libraries needed to compile the sketch
|
# Automatically find the libraries needed to compile the sketch
|
||||||
|
|
||||||
ifndef MAIN_LIBS
|
ifndef MAIN_LIBS
|
||||||
MAIN_LIBS = $(shell $(ARDMK_DIR)/bin/auto-lib $(USER_LIB_PATH) | \
|
MAIN_LIBS := $(shell $(ARDMK_DIR)/bin/auto-lib $(USER_LIB_PATH) | \
|
||||||
sed -ne 's/MAIN_LIBS \(.*\) /\1/p')
|
sed -ne 's/MAIN_LIBS \(.*\) /\1/p')
|
||||||
endif
|
endif
|
||||||
|
|
||||||
ifndef LIBS_DEPS
|
ifndef MAIN_LIBS_DEPS
|
||||||
LIBS_DEPS = $(shell $(ARDMK_DIR)/bin/auto-lib $(USER_LIB_PATH) | \
|
MAIN_LIBS_DEPS := $(shell $(ARDMK_DIR)/bin/auto-lib $(USER_LIB_PATH) | \
|
||||||
sed -ne 's/LIBS_DEPS \(.*\) /\1/p')
|
sed -ne 's/MAIN_LIBS_DEPS \(.*\) /\1/p')
|
||||||
endif
|
endif
|
||||||
|
|
||||||
########################################################################
|
########################################################################
|
||||||
|
@ -785,7 +785,6 @@ ifndef ARDUINO_LIBS
|
||||||
$(shell sed -ne "s/^ *\# *include *[<\"]\(.*\)\.h[>\"]/\1/p" $(LOCAL_SRCS)))
|
$(shell sed -ne "s/^ *\# *include *[<\"]\(.*\)\.h[>\"]/\1/p" $(LOCAL_SRCS)))
|
||||||
ARDUINO_LIBS += $(filter $(notdir $(wildcard $(ARDUINO_SKETCHBOOK)/libraries/*)), \
|
ARDUINO_LIBS += $(filter $(notdir $(wildcard $(ARDUINO_SKETCHBOOK)/libraries/*)), \
|
||||||
$(shell sed -ne "s/^ *\# *include *[<\"]\(.*\)\.h[>\"]/\1/p" $(LOCAL_SRCS)))
|
$(shell sed -ne "s/^ *\# *include *[<\"]\(.*\)\.h[>\"]/\1/p" $(LOCAL_SRCS)))
|
||||||
ARDUINO_LIBS += $(MAIN_LIBS) $(LIBS_DEPS)
|
|
||||||
endif
|
endif
|
||||||
|
|
||||||
########################################################################
|
########################################################################
|
||||||
|
@ -885,6 +884,9 @@ get_library_files = $(if $(and $(wildcard $(1)/src), $(wildcard $(1)/library.pr
|
||||||
|
|
||||||
# General arguments
|
# General arguments
|
||||||
USER_LIBS = $(wildcard $(patsubst %,$(USER_LIB_PATH)/%,$(ARDUINO_LIBS)))
|
USER_LIBS = $(wildcard $(patsubst %,$(USER_LIB_PATH)/%,$(ARDUINO_LIBS)))
|
||||||
|
USER_LIBS += $(wildcard $(patsubst %,$(USER_LIB_PATH)/%,$(MAIN_LIBS)))
|
||||||
|
USER_LIBS += $(wildcard $(patsubst %,$(USER_LIB_PATH)/%,$(MAIN_LIBS_DEPS)))
|
||||||
|
|
||||||
USER_LIB_NAMES = $(patsubst $(USER_LIB_PATH)/%,%,$(USER_LIBS))
|
USER_LIB_NAMES = $(patsubst $(USER_LIB_PATH)/%,%,$(USER_LIBS))
|
||||||
|
|
||||||
# Let user libraries override system ones.
|
# Let user libraries override system ones.
|
||||||
|
@ -1053,13 +1055,13 @@ ifneq (,$(strip $(MAIN_LIBS)))
|
||||||
$(foreach lib,$(MAIN_LIBS),$(call show_config_info, $(lib),[USER]))
|
$(foreach lib,$(MAIN_LIBS),$(call show_config_info, $(lib),[USER]))
|
||||||
endif
|
endif
|
||||||
|
|
||||||
ifneq (,$(strip $(LIBS_DEPS)))
|
ifneq (,$(strip $(MAIN_LIBS_DEPS)))
|
||||||
$(call arduino_output,-)
|
$(call arduino_output,-)
|
||||||
$(call show_config_info,LIBS_DEPS =)
|
$(call show_config_info,MAIN_LIBS_DEPS =)
|
||||||
endif
|
endif
|
||||||
|
|
||||||
ifneq (,$(strip $(LIBS_DEPS)))
|
ifneq (,$(strip $(MAIN_LIBS_DEPS)))
|
||||||
$(foreach lib,$(LIBS_DEPS),$(call show_config_info, $(lib),[USER]))
|
$(foreach lib,$(MAIN_LIBS_DEPS),$(call show_config_info, $(lib),[USER]))
|
||||||
endif
|
endif
|
||||||
|
|
||||||
ifneq (,$(strip $(SYS_LIBS)))
|
ifneq (,$(strip $(SYS_LIBS)))
|
||||||
|
|
Loading…
Reference in a new issue