From 032664e42dda968fe030fe9e294aaef8b83de8e3 Mon Sep 17 00:00:00 2001 From: Ivan Tatarinov Date: Fri, 11 Jun 2021 17:27:46 +0300 Subject: [PATCH] software/esxdos/Makefile: fixed installation rule --- software/esxdos/Makefile | 23 +++++++++++++++-------- 1 file changed, 15 insertions(+), 8 deletions(-) diff --git a/software/esxdos/Makefile b/software/esxdos/Makefile index 98d5028..e978a44 100644 --- a/software/esxdos/Makefile +++ b/software/esxdos/Makefile @@ -171,24 +171,31 @@ endef $(foreach f,$(SYSCONF_FILES),$(eval $(call install_sysconf_rule,$(f)))) -.PHONY: install -install:\ - build/.extracted\ +# Use separate rule to install files - `build` directory may be empty on +# `make install` invocation and we have to extract archive before we can +# use this rule +.PHONY: install-files +install-files:\ $(foreach f,$(ROOT_FILES),$(DESTDIR)$(prefix)/$(f))\ $(foreach f,$(BIN_FILES),$(DESTDIR)$(bindir)/$(f))\ $(foreach f,$(DOC_FILES),$(DESTDIR)$(docdir)/$(f))\ $(foreach f,$(SYS_FILES),$(DESTDIR)$(sysdir)/$(f))\ $(foreach f,$(SYSCONF_FILES),$(DESTDIR)$(sysconfdir)/$(f)) + +# Do `make install-files` inside the recipe +.PHONY: install +install: build/.extracted mkdir -p $(DESTDIR)$(tmpdir) + $(MAKE) -w install-files .PHONY: uninstall uninstall: $(RM)\ - $(foreach f,$(ROOT_FILES),$(DESTDIR)$(prefix)/$(f))\ - $(foreach f,$(BIN_FILES),$(DESTDIR)$(bindir)/$(f))\ - $(foreach f,$(DOC_FILES),$(DESTDIR)$(docdir)/$(f))\ - $(foreach f,$(SYS_FILES),$(DESTDIR)$(sysdir)/$(f))\ - $(foreach f,$(SYSCONF_FILES),$(DESTDIR)$(sysconfdir)/$(f)) + $(foreach f,$(ROOT_FILES),$(DESTDIR)$(prefix)/$(f))\ + $(foreach f,$(BIN_FILES),$(DESTDIR)$(bindir)/$(f))\ + $(foreach f,$(DOC_FILES),$(DESTDIR)$(docdir)/$(f))\ + $(foreach f,$(SYS_FILES),$(DESTDIR)$(sysdir)/$(f))\ + $(foreach f,$(SYSCONF_FILES),$(DESTDIR)$(sysconfdir)/$(f)) .PHONY: clean clean: