Fix installation with DESTDIR
This commit is contained in:
parent
8ea2123055
commit
758af60334
|
@ -677,12 +677,6 @@ ifneq ($(findstring clean,$(MAKECMDGOALS)),)
|
||||||
endif
|
endif
|
||||||
|
|
||||||
ifneq ($(findstring install,$(MAKECMDGOALS)),)
|
ifneq ($(findstring install,$(MAKECMDGOALS)),)
|
||||||
ifdef DESTDIR
|
|
||||||
CFG_INFO := $(info cfg: setting CFG_PREFIX via DESTDIR, $(DESTDIR)/$(CFG_PREFIX))
|
|
||||||
CFG_PREFIX:=$(DESTDIR)/$(CFG_PREFIX)
|
|
||||||
export CFG_PREFIX
|
|
||||||
endif
|
|
||||||
|
|
||||||
CFG_INFO := $(info cfg: including install rules)
|
CFG_INFO := $(info cfg: including install rules)
|
||||||
include $(CFG_SRC_DIR)mk/install.mk
|
include $(CFG_SRC_DIR)mk/install.mk
|
||||||
endif
|
endif
|
||||||
|
|
|
@ -18,24 +18,24 @@
|
||||||
# $(2) is the destination directory
|
# $(2) is the destination directory
|
||||||
# $(3) is the filename/libname-glob
|
# $(3) is the filename/libname-glob
|
||||||
ifdef VERBOSE
|
ifdef VERBOSE
|
||||||
INSTALL = install -m755 $(1)/$(3) $(2)/$(3)
|
INSTALL = install -m755 $(1)/$(3) $(DESTDIR)$(2)/$(3)
|
||||||
else
|
else
|
||||||
INSTALL = $(Q)$(call E, install: $(2)/$(3)) && install -m755 $(1)/$(3) $(2)/$(3)
|
INSTALL = $(Q)$(call E, install: $(DESTDIR)$(2)/$(3)) && install -m755 $(1)/$(3) $(DESTDIR)$(2)/$(3)
|
||||||
endif
|
endif
|
||||||
|
|
||||||
# For MK_INSTALL_DIR
|
# For MK_INSTALL_DIR
|
||||||
# $(1) is the directory to create
|
# $(1) is the directory to create
|
||||||
MK_INSTALL_DIR = (umask 022 && mkdir -p $(1))
|
MK_INSTALL_DIR = (umask 022 && mkdir -p $(DESTDIR)$(1))
|
||||||
|
|
||||||
# For INSTALL_LIB,
|
# For INSTALL_LIB,
|
||||||
# Target-specific $(LIB_SOURCE_DIR) is the source directory
|
# Target-specific $(LIB_SOURCE_DIR) is the source directory
|
||||||
# Target-specific $(LIB_DESTIN_DIR) is the destination directory
|
# Target-specific $(LIB_DESTIN_DIR) is the destination directory
|
||||||
# $(1) is the filename/libname-glob
|
# $(1) is the filename/libname-glob
|
||||||
ifdef VERBOSE
|
ifdef VERBOSE
|
||||||
DO_INSTALL_LIB = install -m644 `ls -drt1 $(LIB_SOURCE_DIR)/$(1) | tail -1` $(LIB_DESTIN_DIR)/
|
DO_INSTALL_LIB = install -m644 `ls -drt1 $(LIB_SOURCE_DIR)/$(1) | tail -1` $(DESTDIR)$(LIB_DESTIN_DIR)/
|
||||||
else
|
else
|
||||||
DO_INSTALL_LIB = $(Q)$(call E, install_lib: $(LIB_DESTIN_DIR)/$(1)) && \
|
DO_INSTALL_LIB = $(Q)$(call E, install_lib: $(DESTDIR)$(LIB_DESTIN_DIR)/$(1)) && \
|
||||||
install -m644 `ls -drt1 $(LIB_SOURCE_DIR)/$(1) | tail -1` $(LIB_DESTIN_DIR)/
|
install -m644 `ls -drt1 $(LIB_SOURCE_DIR)/$(1) | tail -1` $(DESTDIR)$(LIB_DESTIN_DIR)/
|
||||||
endif
|
endif
|
||||||
|
|
||||||
# Target-specific $(LIB_SOURCE_DIR) is the source directory
|
# Target-specific $(LIB_SOURCE_DIR) is the source directory
|
||||||
|
@ -152,9 +152,9 @@ install-host: $(CSREQ$(ISTAGE)_T_$(CFG_BUILD_)_H_$(CFG_BUILD_))
|
||||||
$(Q)$(call INSTALL_LIB,$(LIBRUSTDOC_GLOB_$(CFG_BUILD)))
|
$(Q)$(call INSTALL_LIB,$(LIBRUSTDOC_GLOB_$(CFG_BUILD)))
|
||||||
$(Q)$(call INSTALL,$(HL),$(PHL),$(CFG_RUNTIME_$(CFG_BUILD)))
|
$(Q)$(call INSTALL,$(HL),$(PHL),$(CFG_RUNTIME_$(CFG_BUILD)))
|
||||||
$(Q)$(call INSTALL,$(HL),$(PHL),$(CFG_RUSTLLVM_$(CFG_BUILD)))
|
$(Q)$(call INSTALL,$(HL),$(PHL),$(CFG_RUSTLLVM_$(CFG_BUILD)))
|
||||||
$(Q)$(call INSTALL,$(S)/man, $(CFG_MANDIR)/man1,rustc.1)
|
$(Q)$(call INSTALL,$(S)/man,$(CFG_MANDIR)/man1,rustc.1)
|
||||||
$(Q)$(call INSTALL,$(S)/man, $(CFG_MANDIR)/man1,rustdoc.1)
|
$(Q)$(call INSTALL,$(S)/man,$(CFG_MANDIR)/man1,rustdoc.1)
|
||||||
$(Q)$(call INSTALL,$(S)/man, $(CFG_MANDIR)/man1,rustpkg.1)
|
$(Q)$(call INSTALL,$(S)/man,$(CFG_MANDIR)/man1,rustpkg.1)
|
||||||
|
|
||||||
install-targets: $(INSTALL_TARGET_RULES)
|
install-targets: $(INSTALL_TARGET_RULES)
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue