Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
23 changes: 12 additions & 11 deletions GNUmakefile
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ MULTICALL ?= n
COMPLETIONS ?= y
MANPAGES ?= y
LOCALES ?= y
# allow bootstrapping by our install. mkdir, chmod and cp should be avoided
INSTALL ?= install

# Needed for the foreach loops to split each loop into a separate command
Expand Down Expand Up @@ -159,7 +160,7 @@ test_toybox:

toybox-src:
if [ ! -e "$(TOYBOX_SRC)" ] ; then \
mkdir -p "$(TOYBOX_ROOT)" ; \
$(INSTALL) -d "$(TOYBOX_ROOT)" ; \
curl -Ls "https://github.com/landley/toybox/archive/refs/tags/$(TOYBOX_VER).tar.gz" -o "$(TOYBOX_ROOT)/$(TOYBOX_VER).tar.gz" ; \
tar -C "$(TOYBOX_ROOT)" -xf "$(TOYBOX_ROOT)/$(TOYBOX_VER).tar.gz" ; \
sed -i -e "s|TESTDIR=\".*\"|TESTDIR=\"$(BUILDDIR)\"|g" $(TOYBOX_SRC)/scripts/test.sh; \
Expand All @@ -168,7 +169,7 @@ toybox-src:

busybox-src:
if [ ! -e "$(BUSYBOX_SRC)" ] ; then \
mkdir -p "$(BUSYBOX_ROOT)" ; \
$(INSTALL) -d "$(BUSYBOX_ROOT)" ; \
curl -Ls "https://github.com/mirror/busybox/archive/refs/tags/$(subst .,_,$(BUSYBOX_VER)).tar.gz" -o "$(BUSYBOX_ROOT)/busybox-$(BUSYBOX_VER).tar.gz" ; \
tar -C "$(BUSYBOX_ROOT)" -xf "$(BUSYBOX_ROOT)/busybox-$(BUSYBOX_VER).tar.gz" ; \
fi ;
Expand Down Expand Up @@ -204,7 +205,7 @@ build-uudoc:
@unset CARGO_BUILD_TARGET && ${CARGO} build ${CARGOFLAGS} --bin uudoc --features "uudoc ${EXES}" ${PROFILE_CMD} --no-default-features

install-manpages: build-uudoc
mkdir -p $(DESTDIR)$(DATAROOTDIR)/man/man1
$(INSTALL) -d $(DESTDIR)$(DATAROOTDIR)/man/man1
$(foreach prog, $(INSTALLEES), \
$(BUILDDIR_UUDOC)/uudoc manpage $(prog) > $(DESTDIR)$(DATAROOTDIR)/man/man1/$(PROG_PREFIX)$(prog).1 $(newline) \
)
Expand All @@ -215,9 +216,9 @@ endif
ifeq ($(COMPLETIONS),y)

install-completions: build-uudoc
mkdir -p $(DESTDIR)$(DATAROOTDIR)/zsh/site-functions
mkdir -p $(DESTDIR)$(DATAROOTDIR)/bash-completion/completions
mkdir -p $(DESTDIR)$(DATAROOTDIR)/fish/vendor_completions.d
$(INSTALL) -d $(DESTDIR)$(DATAROOTDIR)/zsh/site-functions
$(INSTALL) -d $(DESTDIR)$(DATAROOTDIR)/bash-completion/completions
$(INSTALL) -d $(DESTDIR)$(DATAROOTDIR)/fish/vendor_completions.d
$(foreach prog, $(INSTALLEES), \
$(BUILDDIR_UUDOC)/uudoc completion $(prog) zsh > $(DESTDIR)$(DATAROOTDIR)/zsh/site-functions/_$(PROG_PREFIX)$(prog) $(newline) \
$(BUILDDIR_UUDOC)/uudoc completion $(prog) bash > $(DESTDIR)$(DATAROOTDIR)/bash-completion/completions/$(PROG_PREFIX)$(prog).bash $(newline) \
Expand All @@ -231,15 +232,15 @@ ifeq ($(LOCALES),y)
locales:
@# Copy uucore common locales
@if [ -d "$(BASEDIR)/src/uucore/locales" ]; then \
mkdir -p "$(BUILDDIR)/locales/uucore"; \
$(INSTALL) -d "$(BUILDDIR)/locales/uucore"; \
for locale_file in "$(BASEDIR)"/src/uucore/locales/*.ftl; do \
$(INSTALL) -m 644 "$$locale_file" "$(BUILDDIR)/locales/uucore/"; \
done; \
fi; \
# Copy utility-specific locales
@for prog in $(INSTALLEES); do \
if [ -d "$(BASEDIR)/src/uu/$$prog/locales" ]; then \
mkdir -p "$(BUILDDIR)/locales/$$prog"; \
$(INSTALL) -d "$(BUILDDIR)/locales/$$prog"; \
for locale_file in "$(BASEDIR)"/src/uu/$$prog/locales/*.ftl; do \
if [ "$$(basename "$$locale_file")" != "en-US.ftl" ]; then \
$(INSTALL) -m 644 "$$locale_file" "$(BUILDDIR)/locales/$$prog/"; \
Expand All @@ -256,7 +257,7 @@ INSTALLEES_WITH_EXTRA_LOCALE = \
install-locales:
@for prog in $(INSTALLEES_WITH_EXTRA_LOCALE); do \
if [ -d "$(BASEDIR)/src/uu/$$prog/locales" ]; then \
mkdir -p "$(DESTDIR)$(DATAROOTDIR)/locales/$$prog"; \
$(INSTALL) -d "$(DESTDIR)$(DATAROOTDIR)/locales/$$prog"; \
for locale_file in "$(BASEDIR)"/src/uu/$$prog/locales/*.ftl; do \
if [ "$$(basename "$$locale_file")" != "en-US.ftl" ]; then \
$(INSTALL) -m 644 "$$locale_file" "$(DESTDIR)$(DATAROOTDIR)/locales/$$prog/"; \
Expand All @@ -270,9 +271,9 @@ install-locales:
endif

install: build install-manpages install-completions install-locales
mkdir -p $(INSTALLDIR_BIN)
$(INSTALL) -d $(INSTALLDIR_BIN)
ifneq (,$(and $(findstring stdbuf,$(UTILS)),$(findstring feat_external_libstdbuf,$(CARGOFLAGS))))
mkdir -p $(DESTDIR)$(LIBSTDBUF_DIR)
$(INSTALL) -d $(DESTDIR)$(LIBSTDBUF_DIR)
ifneq (,$(findstring cygwin,$(OS)))
$(INSTALL) -m 755 $(BUILDDIR)/deps/stdbuf.dll $(DESTDIR)$(LIBSTDBUF_DIR)/libstdbuf.dll
else
Expand Down
Loading