From patchwork Tue Apr 26 11:09:32 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jesper Dangaard Brouer X-Patchwork-Id: 8937811 Return-Path: X-Original-To: patchwork-linux-kbuild@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork1.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.136]) by patchwork1.web.kernel.org (Postfix) with ESMTP id 583539F1C1 for ; Tue, 26 Apr 2016 11:09:48 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 7971320121 for ; Tue, 26 Apr 2016 11:09:47 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 9632E2011B for ; Tue, 26 Apr 2016 11:09:46 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752622AbcDZLJf (ORCPT ); Tue, 26 Apr 2016 07:09:35 -0400 Received: from mx1.redhat.com ([209.132.183.28]:52342 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752621AbcDZLJe (ORCPT ); Tue, 26 Apr 2016 07:09:34 -0400 Received: from int-mx13.intmail.prod.int.phx2.redhat.com (int-mx13.intmail.prod.int.phx2.redhat.com [10.5.11.26]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 102A38112A; Tue, 26 Apr 2016 11:09:34 +0000 (UTC) Received: from firesoul.localdomain (ovpn-200-34.brq.redhat.com [10.40.200.34]) by int-mx13.intmail.prod.int.phx2.redhat.com (8.14.4/8.14.4) with ESMTP id u3QB9XbM006680; Tue, 26 Apr 2016 07:09:33 -0400 Received: from [192.168.42.3] (localhost [IPv6:::1]) by firesoul.localdomain (Postfix) with ESMTP id BDB8F30736C72; Tue, 26 Apr 2016 13:09:32 +0200 (CEST) Subject: [net-next PATCH 4/4] samples/bpf: allow make to be run from samples/bpf/ directory From: Jesper Dangaard Brouer To: netdev@vger.kernel.org Cc: bblanco@plumgrid.com, borkmann@iogearbox.net, alexei.starovoitov@gmail.com, linux-kbuild@vger.kernel.org, Jesper Dangaard Brouer Date: Tue, 26 Apr 2016 13:09:32 +0200 Message-ID: <20160426110932.20716.51360.stgit@firesoul> In-Reply-To: <20160426110828.20716.13392.stgit@firesoul> References: <20160426110828.20716.13392.stgit@firesoul> User-Agent: StGit/0.17.1-dirty MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.68 on 10.5.11.26 Sender: linux-kbuild-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kbuild@vger.kernel.org X-Spam-Status: No, score=-7.9 required=5.0 tests=BAYES_00, RCVD_IN_DNSWL_HI, RP_MATCHES_RCVD, UNPARSEABLE_RELAY autolearn=unavailable version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP It is not intuitive that 'make' must be run from the top level directory with argument "samples/bpf/" to compile these eBPF samples. Introduce a kbuild make file trick that allow make to be run from the "samples/bpf/" directory itself. It basically change to the top level directory and call "make samples/bpf/" with the "/" slash after the directory name. Also add a clean target that only cleans this directory, by taking advantage of the kbuild external module setting M=$PWD. Signed-off-by: Jesper Dangaard Brouer --- samples/bpf/Makefile | 8 ++++++++ samples/bpf/README.rst | 3 +++ 2 files changed, 11 insertions(+) -- To unsubscribe from this list: send the line "unsubscribe linux-kbuild" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html diff --git a/samples/bpf/Makefile b/samples/bpf/Makefile index 7ac66f5bbbf5..7370dfee482f 100644 --- a/samples/bpf/Makefile +++ b/samples/bpf/Makefile @@ -85,6 +85,14 @@ HOSTLOADLIBES_test_overhead += -lelf -lrt # make samples/bpf/ LLC=~/git/llvm/build/bin/llc LLC ?= llc +# Trick to allow make to be run from this directory +all: + $(MAKE) -C ../../ $$PWD/ + +clean: + $(MAKE) -C ../../ M=$$PWD clean + @rm -f *~ + # Verify LLVM compiler is available and bpf target is supported .PHONY: verify_cmd_llc verify_target_bpf diff --git a/samples/bpf/README.rst b/samples/bpf/README.rst index 3e1ac05d8e7c..3a9e6c4099aa 100644 --- a/samples/bpf/README.rst +++ b/samples/bpf/README.rst @@ -47,6 +47,9 @@ For compiling goto kernel top level build directory and run make like:: Do notice the "/" slash after the directory name. +It is also possible to call make from this directory. This will just +hide the the invocation of make as above with the appended "/". + Manually compiling LLVM with 'bpf' support ------------------------------------------