ncurses: use foreach make loops instead of shell for loops
The main benefit of using make foreach loops is that they will abort if one of the iteration of the loop fails. The current for loops will continue, and only report a failure if the last iteration was a failure, but will silently ignore other errors. Signed-off-by: Thomas Petazzoni <thomas.petazzoni@free-electrons.com> Reviewed-by: Matt Weber <matthew.weber@rockwellcollins.com> Signed-off-by: Peter Korsgaard <peter@korsgaard.com>
This commit is contained in:
parent
33ba518835
commit
3ad7e33113
@ -74,28 +74,26 @@ NCURSES_CONF_OPTS += --enable-widec
|
|||||||
NCURSES_LIB_SUFFIX = w
|
NCURSES_LIB_SUFFIX = w
|
||||||
|
|
||||||
define NCURSES_LINK_LIBS_STATIC
|
define NCURSES_LINK_LIBS_STATIC
|
||||||
for lib in $(NCURSES_LIBS-y:%=lib%); do \
|
$(foreach lib,$(NCURSES_LIBS-y:%=lib%), \
|
||||||
ln -sf $${lib}$(NCURSES_LIB_SUFFIX).a \
|
ln -sf $(lib)$(NCURSES_LIB_SUFFIX).a $(1)/usr/lib/$(lib).a
|
||||||
$(1)/usr/lib/$${lib}.a; \
|
)
|
||||||
done
|
|
||||||
ln -sf libncurses$(NCURSES_LIB_SUFFIX).a \
|
ln -sf libncurses$(NCURSES_LIB_SUFFIX).a \
|
||||||
$(1)/usr/lib/libcurses.a
|
$(1)/usr/lib/libcurses.a
|
||||||
endef
|
endef
|
||||||
|
|
||||||
define NCURSES_LINK_LIBS_SHARED
|
define NCURSES_LINK_LIBS_SHARED
|
||||||
for lib in $(NCURSES_LIBS-y:%=lib%); do \
|
$(foreach lib,$(NCURSES_LIBS-y:%=lib%), \
|
||||||
ln -sf $${lib}$(NCURSES_LIB_SUFFIX).so \
|
ln -sf $(lib)$(NCURSES_LIB_SUFFIX).so $(1)/usr/lib/$(lib).so
|
||||||
$(1)/usr/lib/$${lib}.so; \
|
)
|
||||||
done
|
|
||||||
ln -sf libncurses$(NCURSES_LIB_SUFFIX).so \
|
ln -sf libncurses$(NCURSES_LIB_SUFFIX).so \
|
||||||
$(1)/usr/lib/libcurses.so
|
$(1)/usr/lib/libcurses.so
|
||||||
endef
|
endef
|
||||||
|
|
||||||
define NCURSES_LINK_PC
|
define NCURSES_LINK_PC
|
||||||
for pc in $(NCURSES_LIBS-y); do \
|
$(foreach pc,$(NCURSES_LIBS-y), \
|
||||||
ln -sf $${pc}$(NCURSES_LIB_SUFFIX).pc \
|
ln -sf $(pc)$(NCURSES_LIB_SUFFIX).pc \
|
||||||
$(1)/usr/lib/pkgconfig/$${pc}.pc; \
|
$(1)/usr/lib/pkgconfig/$(pc).pc
|
||||||
done
|
)
|
||||||
endef
|
endef
|
||||||
|
|
||||||
NCURSES_LINK_TARGET_LIBS = \
|
NCURSES_LINK_TARGET_LIBS = \
|
||||||
@ -135,19 +133,19 @@ endef
|
|||||||
|
|
||||||
ifneq ($(BR2_STATIC_LIBS),y)
|
ifneq ($(BR2_STATIC_LIBS),y)
|
||||||
define NCURSES_INSTALL_TARGET_LIBS
|
define NCURSES_INSTALL_TARGET_LIBS
|
||||||
for lib in $(NCURSES_LIBS-y:%=lib%); do \
|
$(foreach lib,$(NCURSES_LIBS-y:%=lib%), \
|
||||||
cp -dpf $(NCURSES_DIR)/lib/$${lib}$(NCURSES_LIB_SUFFIX).so* \
|
cp -dpf $(NCURSES_DIR)/lib/$(lib)$(NCURSES_LIB_SUFFIX).so* \
|
||||||
$(TARGET_DIR)/usr/lib/; \
|
$(TARGET_DIR)/usr/lib/
|
||||||
done
|
)
|
||||||
endef
|
endef
|
||||||
endif
|
endif
|
||||||
|
|
||||||
ifeq ($(BR2_PACKAGE_NCURSES_TARGET_PROGS),y)
|
ifeq ($(BR2_PACKAGE_NCURSES_TARGET_PROGS),y)
|
||||||
define NCURSES_INSTALL_TARGET_PROGS
|
define NCURSES_INSTALL_TARGET_PROGS
|
||||||
for x in $(NCURSES_PROGS); do \
|
$(foreach prog,$(NCURSES_PROGS), \
|
||||||
$(INSTALL) -m 0755 $(NCURSES_DIR)/progs/$$x \
|
$(INSTALL) -m 0755 $(NCURSES_DIR)/progs/$(prog) \
|
||||||
$(TARGET_DIR)/usr/bin/$$x; \
|
$(TARGET_DIR)/usr/bin/$(prog)
|
||||||
done
|
)
|
||||||
ln -sf tset $(TARGET_DIR)/usr/bin/reset
|
ln -sf tset $(TARGET_DIR)/usr/bin/reset
|
||||||
endef
|
endef
|
||||||
endif
|
endif
|
||||||
|
Loading…
Reference in New Issue
Block a user