Fix issue with $(INSTALL_DIR) being access before it was defined. Was leading to install issues when all hadn't been run yet.
Signed-off-by: Garrett Cooper <yanegomi@gmail.com>
diff --git a/Makefile b/Makefile
index 703e0c7..6757973 100644
--- a/Makefile
+++ b/Makefile
@@ -99,8 +99,10 @@
.PHONY: include-all include-install
include-install: include/config.h include/mk/config.mk include-all
-# build tree bootstrap targets.
-$(addprefix $(abs_top_builddir)/,$(BOOTSTRAP_TARGETS)) $(INSTALL_DIR): %:
+INSTALL_DIR := $(DESTDIR)/$(prefix)
+
+# build tree bootstrap targets and $(INSTALL_DIR) target.
+$(addprefix $(abs_top_builddir)/,$(BOOTSTRAP_TARGETS)) $(INSTALL_DIR):
mkdir -m 00755 -p "$@"
## Pattern based subtarget rules.
@@ -138,12 +140,9 @@
# include-install is separate to avoid creating a circular dependency below in
# the install target.
.SECONDEXPANSION:
-$(INSTALL_TARGETS) include-install lib-install: %-install: \
- $(abs_top_builddir)/$$*
+$(INSTALL_TARGETS) include-install lib-install: %-install: $(abs_top_builddir)/$$*
$(MAKE) -C $* -f "$(abs_top_srcdir)/$*/Makefile" install
-INSTALL_DIR := $(DESTDIR)/$(prefix)
-
# Just in case configure hasn't been run yet, let's not overambitiously remove
# the $(INSTALL_DIR).
clean:: $(CLEAN_TARGETS)