From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1756195AbdKCMh0 (ORCPT ); Fri, 3 Nov 2017 08:37:26 -0400 Received: from mx1.redhat.com ([209.132.183.28]:32804 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1750826AbdKCMhX (ORCPT ); Fri, 3 Nov 2017 08:37:23 -0400 DMARC-Filter: OpenDMARC Filter v1.3.2 mx1.redhat.com 43D4E491 Authentication-Results: ext-mx05.extmail.prod.ext.phx2.redhat.com; dmarc=none (p=none dis=none) header.from=redhat.com Authentication-Results: ext-mx05.extmail.prod.ext.phx2.redhat.com; spf=fail smtp.mailfrom=vkuznets@redhat.com From: Vitaly Kuznetsov To: devel@linuxdriverproject.org Cc: linux-kernel@vger.kernel.org, "K. Y. Srinivasan" , Haiyang Zhang , Stephen Hemminger Subject: [PATCH] tools/hv: add install target to Makefile Date: Fri, 3 Nov 2017 13:37:20 +0100 Message-Id: <20171103123720.6311-1-vkuznets@redhat.com> X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.29]); Fri, 03 Nov 2017 12:37:23 +0000 (UTC) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Makefiles usually come with 'install' target included so each distro doesn't need to implement the procedure from scratch. Add it to tools/hv. Signed-off-by: Vitaly Kuznetsov --- tools/hv/Makefile | 23 ++++++++++++++++++++++- 1 file changed, 22 insertions(+), 1 deletion(-) diff --git a/tools/hv/Makefile b/tools/hv/Makefile index 0d1e61b81844..e8f0a0a691d3 100644 --- a/tools/hv/Makefile +++ b/tools/hv/Makefile @@ -6,9 +6,30 @@ CFLAGS = $(WARNINGS) -g $(shell getconf LFS_CFLAGS) CFLAGS += -D__EXPORTED_HEADERS__ -I../../include/uapi -I../../include -all: hv_kvp_daemon hv_vss_daemon hv_fcopy_daemon +sbindir ?= /usr/sbin +libexecdir ?= /usr/libexec +sharedstatedir ?= /var/lib + +ALL_PROGRAMS := hv_kvp_daemon hv_vss_daemon hv_fcopy_daemon + +ALL_SCRIPTS := hv_get_dhcp_info.sh hv_get_dns_info.sh hv_set_ifconfig.sh + +all: $(ALL_PROGRAMS) + %: %.c $(CC) $(CFLAGS) -o $@ $^ clean: $(RM) hv_kvp_daemon hv_vss_daemon hv_fcopy_daemon + +install: all + install -d -m 755 $(DESTDIR)$(sbindir); \ + install -d -m 755 $(DESTDIR)$(libexecdir)/hypervkvpd; \ + install -d -m 755 $(DESTDIR)$(sharedstatedir); \ + for program in $(ALL_PROGRAMS); do \ + install $$program -m 755 $(DESTDIR)$(sbindir); \ + done; \ + install -m 755 lsvmbus $(DESTDIR)$(sbindir); \ + for script in $(ALL_SCRIPTS); do \ + install $$script -m 755 $(DESTDIR)$(libexecdir)/hypervkvpd/$${script%.sh}; \ + done -- 2.13.6