Received: by 2002:a25:8b91:0:0:0:0:0 with SMTP id j17csp2446296ybl; Mon, 20 Jan 2020 03:09:24 -0800 (PST) X-Google-Smtp-Source: APXvYqz9ETWvLn9IL9/G6Y2i0NRW93qHM3RfTXn1QDgJRc/K7JsLzztC2fIY9l3Ke7sDBHrcD3Ah X-Received: by 2002:aca:4fc2:: with SMTP id d185mr12596939oib.33.1579518564427; Mon, 20 Jan 2020 03:09:24 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1579518564; cv=none; d=google.com; s=arc-20160816; b=Y4jv+YyQy+P1o2Ne4U2MiLkPjs3xO9i0qMv6x5TBvrYkQOl1I82C0LHAidj3wRrEeM c51JoEXd9sxIcozSedU26jiF1s4pGIxCzWggBXmqn4YZX4YHDSxuRUbqGNxy1NaMB06e Yu2jJnzlRFn2u1+M/Cd/GOgfXFU7Z3YX8SocxvivZXpFpw803ezEQ2oogGp1AEPVwkc3 fgA/+hwLpXgiRm6Y8O4H8+hCKphunmGk19giqyNx46/jwUF3yVPQ43HekbcF7fL+9O2Y 1p0j9YcmkdUcrs4B5thbW0shuXuEtSrnifXXGf5HZtl14G5ONbJTfvLaq045RZNLLqdn +8bw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:mime-version:message-id:date:references :in-reply-to:subject:cc:to:from:dkim-signature; bh=GBr/Vebb3VXffLj0Is78F4eUTgwO3xgPG3+P62qQsx8=; b=V9jlv5qlhSL+zFU4M+59QBjuuZ6qnmgl78lHJb3nKZPUJC+gaIF9vN56yJlw5DhBKM iMfu/BwunJ6JG2O5qwViKBeo/rPvwxSQfELbAd0g/oyWukPGZFzgfGX7XTj2FdBhHxQ/ yuI5z6YLGPnyxjEWKL5S6OUEEeQgyLyq29kAyIpU3s1I7Nj+SNGaVBkYh+yNgWYx9c5P QDtiyYUnLgkYrPkRpFhaehIfM8jJqJmTaMrEZE8ozM3DwMQ2psznmPqfEwHNixd0l/YQ 7rxg7uHBQrBwdQt+1qynXRU4UFildOD92fVi6qyjUd1vx+2se1bqQ69uJwuuAjJO0w5r +UbA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b="B7TS/pxS"; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=redhat.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id j143si16977858oib.16.2020.01.20.03.09.12; Mon, 20 Jan 2020 03:09:24 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b="B7TS/pxS"; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=redhat.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726876AbgATLG6 (ORCPT + 99 others); Mon, 20 Jan 2020 06:06:58 -0500 Received: from us-smtp-2.mimecast.com ([205.139.110.61]:49906 "EHLO us-smtp-delivery-1.mimecast.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1726148AbgATLG6 (ORCPT ); Mon, 20 Jan 2020 06:06:58 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1579518417; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: in-reply-to:in-reply-to:references:references; bh=GBr/Vebb3VXffLj0Is78F4eUTgwO3xgPG3+P62qQsx8=; b=B7TS/pxSE85KOZPnucMq7MiF8znZC5m023mFLV4+fbvRoGQ/U5uSj2KUvgb9MSDn5lj6P+ GCXfb3RgmczfjNwcoQ4u75Bbcyx2G7G9QkO12CtrbxOx+rQCg181eCP6u+ETY20ddboSuj 2CAHVn3ZGUBsaFCNIFVi97BzmCR/348= Received: from mail-lj1-f199.google.com (mail-lj1-f199.google.com [209.85.208.199]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-374-IUHroKxKOjCx9Vkd99DuxA-1; Mon, 20 Jan 2020 06:06:48 -0500 X-MC-Unique: IUHroKxKOjCx9Vkd99DuxA-1 Received: by mail-lj1-f199.google.com with SMTP id f19so7453292ljm.0 for ; Mon, 20 Jan 2020 03:06:48 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:in-reply-to:references:date :message-id:mime-version; bh=GBr/Vebb3VXffLj0Is78F4eUTgwO3xgPG3+P62qQsx8=; b=quO/8wAERDLJAgKupd9G8qR+cy4Fk7xEcwXrvKnHkD8OOy6pHq4JRY66fpMeQoXjIz JnzkTCvOYVJRZRGIhNOP9CQx9rB8I1H2e83F8fQlfySIYPbFoWvYl/h6909WvAYNtQHO 73yz4d5n47yMrkakXZjByoAhB6QlUhzi0knaserjBJssb3lTpHfQ4SSNPJCR9RNLSvB1 +o5pR2lsMCyBngXv+LtCqNUGv0tBziQG1p3QX59VAAqX4Q9QQxf77lgCe+6B/Js/Rcz8 eP0+zdC5voA77d0aXSTLFOv1hvd1Qadexed/A96JKfesIxTWPK6dNQxb1YxDjc78kVxK 28PQ== X-Gm-Message-State: APjAAAVQxsTuKpcHaGccYk9OZ8L6ki+BR995iUQvvJB4H/0nejc31b9N 1WO4tNCgC+njIB2yZB7sPDDCpadzyvcc90JGD3D9kWmdEU5NVV5nYxHUt4Qk+z7XXElGV8YaUN/ Xyl+BsG10T+BRqmh2r/kr0Of8 X-Received: by 2002:a2e:8e22:: with SMTP id r2mr12213810ljk.51.1579518406711; Mon, 20 Jan 2020 03:06:46 -0800 (PST) X-Received: by 2002:a2e:8e22:: with SMTP id r2mr12213786ljk.51.1579518406456; Mon, 20 Jan 2020 03:06:46 -0800 (PST) Received: from alrua-x1.borgediget.toke.dk ([85.204.121.218]) by smtp.gmail.com with ESMTPSA id p136sm16758946lfa.8.2020.01.20.03.06.45 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 20 Jan 2020 03:06:45 -0800 (PST) Received: by alrua-x1.borgediget.toke.dk (Postfix, from userid 1000) id C1D8A1804D6; Mon, 20 Jan 2020 12:06:44 +0100 (CET) From: Toke =?utf-8?Q?H=C3=B8iland-J=C3=B8rgensen?= To: Andrii Nakryiko Cc: Alexei Starovoitov , Daniel Borkmann , Martin KaFai Lau , Song Liu , Yonghong Song , Andrii Nakryiko , Doug Ledford , Jason Gunthorpe , "David S. Miller" , Jakub Kicinski , Jesper Dangaard Brouer , John Fastabend , Peter Zijlstra , Ingo Molnar , Arnaldo Carvalho de Melo , Mark Rutland , Alexander Shishkin , Jiri Olsa , Namhyung Kim , Shuah Khan , Networking , bpf , open list , linux-rdma@vger.kernel.org, "open list\:KERNEL SELFTEST FRAMEWORK" , clang-built-linux@googlegroups.com Subject: Re: [PATCH bpf-next v4 09/10] selftests: Remove tools/lib/bpf from include path In-Reply-To: References: <157926819690.1555735.10756593211671752826.stgit@toke.dk> <157926820677.1555735.5437255599683298212.stgit@toke.dk> X-Clacks-Overhead: GNU Terry Pratchett Date: Mon, 20 Jan 2020 12:06:44 +0100 Message-ID: <878sm2pet7.fsf@toke.dk> MIME-Version: 1.0 Content-Type: text/plain Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org [...] > I really-really didn't like this alternating dependency on directory > or a set of file, depending on current state of those temporary > directories. Then also this ugly check to avoid circular dependency. > All that seemed wrong. So I played a bit with how to achieve the same > differently, and here's what I came up with, which I like a bit > better. What do you think? > > $(BPFOBJ): $(wildcard $(BPFDIR)/*.c $(BPFDIR)/*.h $(BPFDIR)/Makefile) \ > ../../../include/uapi/linux/bpf.h \ > | $(INCLUDE_DIR) $(BUILD_DIR)/libbpf > $(Q)$(MAKE) $(submake_extras) -C $(BPFDIR) OUTPUT=$(BUILD_DIR)/libbpf/ \ > DESTDIR=$(SCRATCH_DIR) prefix= all install_headers > > So, essentially, just make sure that we install local copies of > headers whenever libbpf.a needs to be re-built. > ../../../include/uapi/linux/bpf.h ensures we don't miss uapi header > changes as well. Now anything that uses libbpf headers will need to > depend on $(BPFOBJ) and will automatically get up-to-date local copies > of headers. > > This seems much simpler. Please give it a try, thanks! Yes, this is a good idea! It did actually occur to me that the $(BPFOBJ) rule could just include the install_headers make arg, but only after I sent out this latest version. Thank you for taking the time to work out the details, I'll fold this in :) -Toke