From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-we0-f172.google.com (mail-we0-f172.google.com [74.125.82.172]) by dpdk.org (Postfix) with ESMTP id 9EC4F68FC for ; Tue, 4 Feb 2014 16:53:36 +0100 (CET) Received: by mail-we0-f172.google.com with SMTP id p61so4381794wes.31 for ; Tue, 04 Feb 2014 07:54:57 -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=rPDJ4cpFsCAx2XNiZNSp706qlPKHVdOrcg5UJywoL+4=; b=Me/QXFJQBjaLJvXe1Kv640eUP72I9bx1wHiO3zhty4GrLjvhxBCdbRLaYqhBPImDlM Vz3jrlLp/61l/1fsAUcj/2CB0n0850Y9VeQJ6S5GwK+sxe0TGSDzVx5aHWV3x6cIEaPy XoU8aQhGenaLtnJLv+my9Mq1QBjKkfhuZPyU6RTodWve5HtTVqGGGlorNFDGW/j01UNk hxHY3/PASn+aAhT/tJD695tgukL+fRqu21Fpe5nlRnXHe91ROhmBZGWJgScchtg1s44S L6Mxh31K/cEA2gr/aC5YF+9mTmSbvPsBcmNg8KUaJEu95+3maJftkPAwY1kbmqBUSMy/ qN4A== X-Gm-Message-State: ALoCoQmy1W6mdFSM5RitUx+8UvRlyN418YDbUqNqqRyLqdedKhZnj0oSfIHQeAVOauPFr9svhXWk X-Received: by 10.180.77.200 with SMTP id u8mr13311934wiw.48.1391529297429; Tue, 04 Feb 2014 07:54:57 -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.54.56 for (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Tue, 04 Feb 2014 07:54:56 -0800 (PST) From: Thomas Monjalon To: dev@dpdk.org Date: Tue, 4 Feb 2014 16:54:20 +0100 Message-Id: <1391529271-24606-6-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] [vmxnet3-usermap PATCH 05/16] pmd: allow to build outside of the source directory 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:36 -0000 S specify source directory (when not already in). O specify output directory (when different of current one). Signed-off-by: Thomas Monjalon --- pmd/Makefile | 21 ++++++++++++++++----- 1 file changed, 16 insertions(+), 5 deletions(-) diff --git a/pmd/Makefile b/pmd/Makefile index d8eff33..2d66fb7 100644 --- a/pmd/Makefile +++ b/pmd/Makefile @@ -36,19 +36,29 @@ override CPPFLAGS += -Wall -Wextra -Werror override CFLAGS += -fPIC override LDFLAGS += -shared -KMOD_INCLUDE ?= ../kmod +KMOD_INCLUDE ?= $S/../kmod +S ?= . +O ?= . -all : +all : $O/$(SOLIB) + +$O : + mkdir -p $@ + +$O/$(SOLIB) : $S/vmxnet3.c | $O ifeq '$(RTE_INCLUDE)' '' @ echo 'ERROR: RTE_INCLUDE is not set' && false endif $(CC) $(CPPFLAGS) $(CFLAGS) $(LDFLAGS) \ -I$(RTE_INCLUDE) -include $(RTE_INCLUDE)/rte_config.h \ -I$(KMOD_INCLUDE) -I$(KMOD_INCLUDE)/shared \ - -o $(SOLIB) vmxnet3.c + -o $@ $< clean : - rm -f $(SOLIB) + - rm -f $O/$(SOLIB) +ifneq '$(abspath $O)' '$(CURDIR)' + - rmdir -p $O 2>&- +endif help : @ echo 'rules:' @@ -56,6 +66,7 @@ help : @ echo ' clean' @ echo 'build variables:' @ echo ' RTE_INCLUDE (e.g. ../dpdk/build/include),' - @ echo ' CPPFLAGS, CFLAGS, LDFLAGS' + @ echo ' CPPFLAGS, CFLAGS, LDFLAGS,' + @ echo ' S (source directory), O (build directory)' .PHONY : all clean help -- 1.7.10.4