From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mga02.intel.com (mga02.intel.com [134.134.136.20]) by dpdk.org (Postfix) with ESMTP id 61E302A66 for ; Fri, 18 Sep 2015 22:32:58 +0200 (CEST) Received: from orsmga001.jf.intel.com ([10.7.209.18]) by orsmga101.jf.intel.com with ESMTP; 18 Sep 2015 13:32:58 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.17,554,1437462000"; d="scan'208";a="772118376" Received: from mcarril6-mobl.zpn.intel.com ([10.219.16.35]) by orsmga001.jf.intel.com with ESMTP; 18 Sep 2015 13:32:57 -0700 From: Mario Carrillo To: dev@dpdk.org Date: Fri, 18 Sep 2015 15:33:04 -0500 Message-Id: <1442608390-12537-2-git-send-email-mario.alfredo.c.arevalo@intel.com> X-Mailer: git-send-email 2.1.0 In-Reply-To: <1442608390-12537-1-git-send-email-mario.alfredo.c.arevalo@intel.com> References: <1442608390-12537-1-git-send-email-mario.alfredo.c.arevalo@intel.com> Subject: [dpdk-dev] [PATCH 1/7] mk: Add hierarchy-file support X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: patches and discussions about DPDK List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 18 Sep 2015 20:32:59 -0000 Add hierarchy-file support to the DPDK scripts, tools, examples, makefiles and config files when invoking "make install H=1" (hierarchy-file) This hierarchy is based on: http://www.freedesktop.org/software/systemd/man/file-hierarchy.html and dpdk spec file. scripts, tools, examples, makefiles and config files will be installed in: $(DESTDIR)/usr/share/dpdk Signed-off-by: Mario Carrillo --- mk/rte.sdkinstall.mk | 34 ++++++++++++++++++++++++++++++++++ 1 file changed, 34 insertions(+) diff --git a/mk/rte.sdkinstall.mk b/mk/rte.sdkinstall.mk index 86c98a5..3b8169b 100644 --- a/mk/rte.sdkinstall.mk +++ b/mk/rte.sdkinstall.mk @@ -43,6 +43,23 @@ ifndef T T=* endif +# When H (hierarchy-file) varible is equal "1" it will install files +# according to the next proposal: +# http://www.freedesktop.org/software/systemd/man/file-hierarchy.html +# some variables get values from .config in order not to set a target again. +ifeq ($(H),1) +include $(BUILD_DIR)/build/.config +RTE_ARCH := $(CONFIG_RTE_ARCH:"%"=%) +RTE_MACHINE := $(CONFIG_RTE_MACHINE:"%"=%) +RTE_EXEC_ENV := $(CONFIG_RTE_EXEC_ENV:"%"=%) +RTE_TOOLCHAIN := $(CONFIG_RTE_TOOLCHAIN:"%"=%) +RTE_TARGET := $(RTE_ARCH)-$(RTE_MACHINE)-$(RTE_EXEC_ENV)-$(RTE_TOOLCHAIN) +T := $(RTE_ARCH)-$(RTE_MACHINE)-$(RTE_EXEC_ENV)-$(RTE_TOOLCHAIN) +DATA_DIR := $(DESTDIR)/usr/share +INCLUDE_DIR := $(DESTDIR)/usr/include +export INCLUDE_DIR +endif + # # install: build sdk for all supported targets # @@ -56,6 +73,22 @@ install: $(INSTALL_TARGETS) %_install: @echo ================== Installing $* +# +# Install config and environment files +# according to freedesktop hierarchy-file when H=1 +# +ifeq ($(H),1) + $(Q)$(MAKE) all O=$(BUILD_DIR)/build + @[ -d $(DATA_DIR)/dpdk ] || mkdir -p $(DATA_DIR)/dpdk + $(Q)cp -a $(BUILD_DIR)/mk $(DATA_DIR)/dpdk + $(Q)cp -a $(BUILD_DIR)/scripts $(DATA_DIR)/dpdk + $(Q)cp -a $(BUILD_DIR)/examples $(DATA_DIR)/dpdk + $(Q)cp -a $(BUILD_DIR)/tools $(DATA_DIR)/dpdk + @[ -d $(INCLUDE_DIR) ] || mkdir -p $(INCLUDE_DIR) + $(Q)cp -f $(BUILD_DIR)/build/include/rte_config.h $(INCLUDE_DIR) + @[ -d $(DATA_DIR)/dpdk/config ] || mkdir -p $(DATA_DIR)/dpdk/config + $(Q)cp -f $(BUILD_DIR)/build/.config $(DATA_DIR)/dpdk/config +else $(Q)if [ ! -f $(BUILD_DIR)/$*/.config ]; then \ $(MAKE) config T=$* O=$(BUILD_DIR)/$*; \ elif cmp -s $(BUILD_DIR)/$*/.config.orig $(BUILD_DIR)/$*/.config; then \ @@ -79,6 +112,7 @@ install: $(INSTALL_TARGETS) UNINSTALL_TARGETS := $(addsuffix _uninstall,\ $(filter-out %~,$(INSTALL_CONFIGS))) +endif .PHONY: uninstall uninstall: $(UNINSTALL_TARGETS) -- 2.1.0