From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-we0-f179.google.com (mail-we0-f179.google.com [74.125.82.179]) by dpdk.org (Postfix) with ESMTP id 4BEDF5951 for ; Tue, 4 Feb 2014 16:53:49 +0100 (CET) Received: by mail-we0-f179.google.com with SMTP id q58so4393078wes.10 for ; Tue, 04 Feb 2014 07:55:10 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:from:to:subject:date:message-id:in-reply-to :references; bh=NjTlNdk8G/IIKl7dWFoBfVohq3pnyNpA1atiAcBL4vQ=; b=HjELpLvoOSRipuaXt6Fj2QlVK3AG+8Za39oGKio8739RrOjwquqvv6gH7GGgZQV3mn OESUlNv+uNjeHaWLHZhnIKtmmj5ZBgUJC8keltLoGiH0CHrDg+c0BXcXfeGuFsxtjFvQ brEKotsxoiOTxRx06oHAwwcJHg2ed6N9L1cdK+Xo0WGsbpUlzNWPKnj8N9X7DM1TRiR0 gChmIz38k27BNAEn5DsOVxAA36dUWHpXZgBF8/4cSD3VvjvISNEcF9l8mYxNCW93zLLI /3qPt5IAvFUMjEyKWUUSRFpX/DMU6h421oh1+pjF4uRzfr7PmgKDXNb8iZBxC1yp0mjA PTdQ== X-Gm-Message-State: ALoCoQnfWKOMPnNVYnRPtKaIkzI0LvdcPH2OMGKOBCAYWDHUjPx/gv27+17Mp2uqtrQULjcU160z X-Received: by 10.194.186.204 with SMTP id fm12mr28845869wjc.27.1391529310111; Tue, 04 Feb 2014 07:55:10 -0800 (PST) Received: from angus.dev.6wind.com (6wind.net2.nerim.net. [213.41.180.237]) by mx.google.com with ESMTPSA id q2sm53639203wjq.0.2014.02.04.07.55.08 for (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Tue, 04 Feb 2014 07:55:09 -0800 (PST) From: Thomas Monjalon To: dev@dpdk.org Date: Tue, 4 Feb 2014 16:54:26 +0100 Message-Id: <1391529271-24606-12-git-send-email-thomas.monjalon@6wind.com> X-Mailer: git-send-email 1.7.10.4 In-Reply-To: <1391529271-24606-1-git-send-email-thomas.monjalon@6wind.com> References: <1391529271-24606-1-git-send-email-thomas.monjalon@6wind.com> Subject: [dpdk-dev] [virtio-net-pmd PATCH 11/16] mk: allow to install lib and doc 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: Tue, 04 Feb 2014 15:53:49 -0000 Signed-off-by: Thomas Monjalon --- Makefile | 30 ++++++++++++++++++++++++++++-- 1 file changed, 28 insertions(+), 2 deletions(-) diff --git a/Makefile b/Makefile index 4ff4c1d..100864d 100644 --- a/Makefile +++ b/Makefile @@ -30,6 +30,7 @@ # OF THE POSSIBILITY OF SUCH DAMAGE. SOLIB = librte_pmd_virtio.so +DOC = dpdk-virtio-net-pmd.rst CC = $(CROSS)gcc override CPPFLAGS += -Wall -Wextra -Werror @@ -39,6 +40,12 @@ override LDFLAGS += -shared S ?= . O ?= . +prefix ?= /usr/local +exec_prefix ?= $(prefix) +libdir ?= $(exec_prefix)/lib +datarootdir ?= $(prefix)/share +docdir ?= $(datarootdir)/doc/dpdk + all : $O/$(SOLIB) $O : @@ -52,19 +59,38 @@ endif -I$(RTE_INCLUDE) -include $(RTE_INCLUDE)/rte_config.h \ -o $@ $< +install : $(DESTDIR)$(libdir)/$(SOLIB) +$(DESTDIR)$(libdir)/$(SOLIB): $O/$(SOLIB) + install -D -m 644 $< $@ + +install : $(DESTDIR)$(docdir)/$(DOC) +$(DESTDIR)$(docdir)/$(DOC) : $S/README.rst + install -D -m 644 $< $@ + clean : - rm -f $O/$(SOLIB) ifneq '$(abspath $O)' '$(CURDIR)' - rmdir -p $O 2>&- endif +uninstall : + - rm -f $(DESTDIR)$(libdir)/$(SOLIB) + - rmdir -p $(DESTDIR)$(libdir) 2>&- + - rm -f $(DESTDIR)$(docdir)/$(DOC) + - rmdir -p $(DESTDIR)$(docdir) 2>&- + help : @ echo 'rules:' @ echo ' all (default)' @ echo ' clean' - @ echo 'variables:' + @ echo ' install' + @ echo ' uninstall' + @ echo 'build variables:' @ echo ' RTE_INCLUDE (e.g. ../dpdk/build/include),' @ echo ' CPPFLAGS, CFLAGS, LDFLAGS,' @ echo ' S (source directory), O (build directory)' + @ echo 'install variables:' + @ echo ' DESTDIR (optional),' + @ echo ' prefix, exec_prefix, libdir, datarootdir, docdir' -.PHONY : all clean help +.PHONY : all clean install uninstall help -- 1.7.10.4