From b77b0b5385bace1d9cdf313975c6ac3a6960a918 Mon Sep 17 00:00:00 2001 From: Gregory Nutt Date: Sat, 6 Sep 2014 08:13:45 -0600 Subject: [PATCH] Add support for an installation directory: --- .gitignore | 1 + Makefile | 17 ++++++++++++----- 2 files changed, 13 insertions(+), 5 deletions(-) diff --git a/.gitignore b/.gitignore index 53befbf70..bcc844033 100644 --- a/.gitignore +++ b/.gitignore @@ -1,3 +1,4 @@ +/bin /external /.context /.config diff --git a/Makefile b/Makefile index 3ed1f3f87..3a8e2f07a 100644 --- a/Makefile +++ b/Makefile @@ -103,6 +103,10 @@ SUBDIRS += $(EXTERNAL_DIR) LIBPATH ?= $(TOPDIR)/libs +# The install path + +INSTALL_DIR = $(APPDIR)/bin + # The final build target BIN = libapps$(LIBEXT) @@ -114,12 +118,9 @@ all: $(BIN) define SDIR_template $(1)_$(2): - $(Q) $(MAKE) -C $(1) $(2) TOPDIR="$(TOPDIR)" APPDIR="$(APPDIR)" + $(Q) $(MAKE) -C $(1) $(2) TOPDIR="$(TOPDIR)" APPDIR="$(APPDIR)" INSTALL_DIR="$(INSTALL_DIR)" endef -$(INSTALLED_APPS): - $(Q) $(MAKE) -C $@ TOPDIR="$(TOPDIR)" APPDIR="$(APPDIR)" - $(foreach SDIR, $(INSTALLED_APPS), $(eval $(call SDIR_template,$(SDIR),all))) $(foreach SDIR, $(INSTALLED_APPS), $(eval $(call SDIR_template,$(SDIR),install))) $(foreach SDIR, $(INSTALLED_APPS), $(eval $(call SDIR_template,$(SDIR),context))) @@ -129,7 +130,12 @@ $(foreach SDIR, $(INSTALLED_APPS), $(eval $(call SDIR_template,$(SDIR),distclean $(BIN): $(foreach SDIR, $(INSTALLED_APPS), $(SDIR)_all) -install: $(foreach SDIR, $(INSTALLED_APPS), $(SDIR)_install) +.install: $(foreach SDIR, $(INSTALLED_APPS), $(SDIR)_install) + +$(INSTALL_DIR): + mkdir -p $(INSTALL_DIR) + +install: $(INSTALL_DIR) .install .import: $(BIN) install @@ -165,5 +171,6 @@ else ) endif $(call DELFILE, .depend) + $(call DELDIR, bin)