From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-0.9 required=3.0 tests=DKIMWL_WL_HIGH,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI, SPF_HELO_NONE,SPF_PASS autolearn=no autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id CB70CC2D0DB for ; Mon, 20 Jan 2020 11:06:53 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id A2AE7208E4 for ; Mon, 20 Jan 2020 11:06:53 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (1024-bit key) header.d=redhat.com header.i=@redhat.com header.b="i20Ka0c4" Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726642AbgATLGx (ORCPT ); Mon, 20 Jan 2020 06:06:53 -0500 Received: from us-smtp-delivery-1.mimecast.com ([207.211.31.120]:30971 "EHLO us-smtp-1.mimecast.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1726148AbgATLGw (ORCPT ); Mon, 20 Jan 2020 06:06:52 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1579518411; 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=i20Ka0c4AsBFvFOvz/S1g52CSj4yyOSq04XbJqRTit68W12zZ+escxoRMuTEjACV6bpKFm V0SdY4qlrg7rrryr58kSXovMLkXZBlmiMB129aPFpdkO9iIar2iBeUZv/rp3aBJA6Ttike WNnceN32jEQsZCqKQCq1eSkmJcprNxY= Received: from mail-lj1-f197.google.com (mail-lj1-f197.google.com [209.85.208.197]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-407-dV-XKU_uOmiAFiNY4wM7rg-1; Mon, 20 Jan 2020 06:06:48 -0500 X-MC-Unique: dV-XKU_uOmiAFiNY4wM7rg-1 Received: by mail-lj1-f197.google.com with SMTP id v1so7423139lja.21 for ; Mon, 20 Jan 2020 03:06:47 -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=QiZOPOmegmRCWNpFQKxK03T6GxHBz4jEq+xfDfTfUDg2DyJhnoUsoCmKlCGouXfFnA vr3dB4oC455W8tmhfelCarCeYW1/xUY3tKf2noUU4jKDVAqnwDIYftcaOMRoynNJJQsm lpdZNI+JQrIQVpru1aPFBpjxO525YzviHB1MTf4s2d0s8e0RU2nJUCgqsV7dgX7VyWOl bIJ4IYwrr4miXyRJA6Ouc4b8hxHK6BdpnTuT7U9VqhCgp7jUdYHGsKM+Xb7zciEwayA4 eu5NfjL47kiTgAhvos39iZIxJLLJcy8VgF77CcvDzj0HdVVeMgGjoIwL/nKhx4Gd1Fhq cUwQ== X-Gm-Message-State: APjAAAX6Q6gOcci6RYCsEQO2EuD3wzlMOHp25cxSIeaApcyQ28sI2s1K VZl9SJOVLgbUSmwoHSeKo6Scu2cCOQfdf2IGHt2jvv7spoMgIS5lbDWD5SvjZu43zGi6A9sLeJs EL/iUQW0Of3vQ20Mku4V48SdxNl55 X-Received: by 2002:a2e:8e22:: with SMTP id r2mr12213808ljk.51.1579518406711; Mon, 20 Jan 2020 03:06:46 -0800 (PST) X-Google-Smtp-Source: APXvYqwRHGGNFbd5H0/cF1REV/7+jcnpPn0KrgS8p2w5aL+jlmOCDTBslDcW/9arMdp3KMXCx8EM9A== 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-kselftest-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kselftest@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