Browse Source

- move draw_line define to helpers.mk

master
vanhofen 6 years ago
parent
commit
e15baaae97
  1. 32
      Makefile
  2. 34
      make/helpers.mk
  3. 35
      make/system-tools-extra.mk

32
Makefile

@ -136,38 +136,6 @@ PHONY += printenv help done all everything
PHONY += .print-phony
.PHONY: $(PHONY)
#
# $(1) = title
# $(2) = color
# 0 - Black
# 1 - Red
# 2 - Green
# 3 - Yellow
# 4 - Blue
# 5 - Magenta
# 6 - Cyan
# 7 - White
# $(3) = left|center|right
#
define draw_line
@ \
printf '%.0s-' {1..$(shell tput cols)}; \
if test "$(1)"; then \
cols=$(shell tput cols); \
length=$(shell echo $(1) | awk '{print length}'); \
case "$(3)" in \
*right) let indent="length + 1" ;; \
*center) let indent="cols - (cols - length) / 2" ;; \
*left|*) let indent="cols" ;; \
esac; \
tput cub $$indent; \
test "$(2)" && printf $$(tput setaf $(2)); \
printf '$(1)'; \
test "$(2)" && printf $$(tput sgr0); \
fi; \
echo
endef
# this makes sure we do not build top-level dependencies in parallel
# (which would not be too helpful anyway, running many configure and
# downloads in parallel...), but the sub-targets are still built in

34
make/helpers.mk

@ -38,6 +38,40 @@ endef
# -----------------------------------------------------------------------------
#
# $(1) = title
# $(2) = color
# 0 - Black
# 1 - Red
# 2 - Green
# 3 - Yellow
# 4 - Blue
# 5 - Magenta
# 6 - Cyan
# 7 - White
# $(3) = left|center|right
#
define draw_line
@ \
printf '%.0s-' {1..$(shell tput cols)}; \
if test "$(1)"; then \
cols=$(shell tput cols); \
length=$(shell echo $(1) | awk '{print length}'); \
case "$(3)" in \
*right) let indent="length + 1" ;; \
*center) let indent="cols - (cols - length) / 2" ;; \
*left|*) let indent="cols" ;; \
esac; \
tput cub $$indent; \
test "$(2)" && printf $$(tput setaf $(2)); \
printf '$(1)'; \
test "$(2)" && printf $$(tput sgr0); \
fi; \
echo
endef
# -----------------------------------------------------------------------------
archives-list:
@rm -f $(BUILD_TMP)/$@
@make -qp | grep --only-matching '^\$(ARCHIVE).*:' | sed "s|:||g" > $(BUILD_TMP)/$@

35
make/system-tools-extra.mk

@ -62,27 +62,42 @@ $(D)/binutils: $(ARCHIVE)/binutils-$(BINUTILS_VER).tar.bz2 | $(TARGET_DIR)
# -----------------------------------------------------------------------------
UTIL-LINUX_VER = 2.29
UTIL-LINUX_MAJOR = 2
UTIL-LINUX_MINOR = 33
UTIL-LINUX_MICRO = 2
UTIL-LINUX_VER = $(UTIL-LINUX_MAJOR).$(UTIL-LINUX_MINOR).$(UTIL-LINUX_MICRO)
$(ARCHIVE)/util-linux-$(UTIL-LINUX_VER).tar.xz:
$(WGET) https://www.kernel.org/pub/linux/utils/util-linux/v$(UTIL-LINUX_VER)/util-linux-$(UTIL-LINUX_VER).tar.xz
$(WGET) https://www.kernel.org/pub/linux/utils/util-linux/v$(UTIL-LINUX_MAJOR).$(UTIL-LINUX_MINOR)/util-linux-$(UTIL-LINUX_VER).tar.xz
$(D)/util-linux: $(D)/libncurses $(ARCHIVE)/util-linux-$(UTIL-LINUX_VER).tar.xz | $(TARGET_DIR)
$(D)/util-linux: $(D)/libncurses $(D)/zlib $(ARCHIVE)/util-linux-$(UTIL-LINUX_VER).tar.xz | $(TARGET_DIR)
$(REMOVE)/util-linux-$(UTIL-LINUX_VER)
$(UNTAR)/util-linux-$(UTIL-LINUX_VER).tar.xz
$(CHDIR)/util-linux-$(UTIL-LINUX_VER); \
autoreconf -fi; \
$(CONFIGURE) \
--prefix= \
--build=$(BUILD) \
--host=$(TARGET) \
--prefix=/usr \
--mandir=/.remove/man \
--localedir=/.remove/locale \
--enable-static \
--disable-shared \
--mandir=/.remove \
--disable-gtk-doc \
\
--disable-all-programs \
\
--disable-makeinstall-chown \
--disable-makeinstall-setuid \
--disable-makeinstall-chown \
\
--without-ncursesw \
--without-python \
--without-slang \
--without-systemdsystemunitdir \
--without-tinfo \
; \
$(MAKE) sfdisk; \
install -m 0755 sfdisk $(TARGET_DIR)/sbin/sfdisk
$(REMOVE)/util-linux-$(UTIL-LINUX_VER)
$(MAKE); \
$(MAKE) install DESTDIR=$(BUILD_TMP)/util-linux-install
#$(REMOVE)/util-linux-$(UTIL-LINUX_VER)
$(TOUCH)
# -----------------------------------------------------------------------------

Loading…
Cancel
Save