Received: by 2002:a25:d7c1:0:0:0:0:0 with SMTP id o184csp2072265ybg; Sun, 27 Oct 2019 10:28:15 -0700 (PDT) X-Google-Smtp-Source: APXvYqwEHK1QOD+47rl17EL6qYtUVgsBYrOfkYaq0p46Rb/kwaoo5m8cBmphp2jzHYyG6gDfbL+6 X-Received: by 2002:aa7:df85:: with SMTP id b5mr15318390edy.298.1572197295300; Sun, 27 Oct 2019 10:28:15 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1572197295; cv=none; d=google.com; s=arc-20160816; b=VGFIVv3ZG3r/38HQME9b5vo8HB7+SVR/qjOqFr+k7q0XqcU9ZK1aucp77DH61WGQ4A RFzYBj67pvFsmf11Ya7u+co16gHdaVqbj5+BrIAFVyurHDid6zoxgzCs0hJnSuiiY3wb 0llyJIWgim7ELfhIaSQ4ZMpT29WRrn3BlKeAlGkrgfnvA3I10R05fZjQZ7BzIlpZIi+1 c3pt/4nXzZRWai9ODRLhR7u2F0RSQ17K5O44XoSeQUTE5cWRjYVoAe99/U03mznGVm9H b/8uGIzR7Ntaj2Rtz7qwuWsbTLREfFpIY3QGcPR2sOIPG1Uy5or8uYOWhFaZXcoD4+Bd RyTQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :references:in-reply-to:message-id:subject:cc:to:from:date :dkim-signature; bh=et2Oh/gnYgisI2rBwCo8+HDok6/khdwq9db9N5LSdEA=; b=CQYJjt9r6O18lvb3gvw74EWNJIJqigyeYdiwlGxQJqAbcP+x2w89tA/OE/9DhL3IzP 5ZzTgv0Unw5fukHTZgKsHme32Pl7uS3tjPB1J5l5+CSGl0sgYBKcHzSlMBjpnGDRqZb/ h91Kgc1G1+cFaspGSYLzscCjxV7MhJyFSVDh0gnxFpxn4zkapCpqkw6FaCWkD2WJB1SW EAIg1GEDnEbizQ9pJGVxvEbU9cDQ366iR46zhUhatvlJvS2mmUCQnssp5lojmRIbsOX7 I14Zov0HSFjXN6RNxtefiGxCGrSXe1E8Z1v7BjCdfZbq9AnbcP8wnusWgA1KwTpCaEhh N8jA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=DBk5telX; 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=kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id e25si5880709ede.335.2019.10.27.10.27.51; Sun, 27 Oct 2019 10:28:15 -0700 (PDT) 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=@kernel.org header.s=default header.b=DBk5telX; 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=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727080AbfJ0QyU (ORCPT + 99 others); Sun, 27 Oct 2019 12:54:20 -0400 Received: from mail.kernel.org ([198.145.29.99]:51672 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727020AbfJ0QyT (ORCPT ); Sun, 27 Oct 2019 12:54:19 -0400 Received: from archlinux (cpc149474-cmbg20-2-0-cust94.5-4.cable.virginm.net [82.4.196.95]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id 66B6620679; Sun, 27 Oct 2019 16:54:17 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1572195259; bh=UtW9WD0HiBxpIq582FMAfo26riGb2a3TbmlgtH2/1lM=; h=Date:From:To:Cc:Subject:In-Reply-To:References:From; b=DBk5telXr+C5J+fj7tcudQcIpfg0hzVdbJeDUyY2OB+yBv8lp/aI7rI04uRsbNFR9 1B6UBme6GiEl2LThpZcgD+uH/E5KH7riNRl4S7vIOAj4XgaxLxdEcWya+L9tklzHf0 Qe+Ax2uo+vDurk2W2h0GQ0+odyZjOJu/Ca6FvG1A= Date: Sun, 27 Oct 2019 16:54:14 +0000 From: Jonathan Cameron To: Laura Abbott Cc: Jiri Olsa , Hartmut Knaack , Lars-Peter Clausen , Peter Meerwald-Stadler , linux-iio@vger.kernel.org, linux-kernel@vger.kernel.org, Masahiro Yamada Subject: Re: [PATCH] tools: iio: Correctly add make dependency for iio_utils Message-ID: <20191027165414.3e4c3530@archlinux> In-Reply-To: <20191018172908.3761-1-labbott@redhat.com> References: <20191018172908.3761-1-labbott@redhat.com> X-Mailer: Claws Mail 3.17.4 (GTK+ 2.24.32; x86_64-pc-linux-gnu) MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Fri, 18 Oct 2019 13:29:08 -0400 Laura Abbott wrote: > iio tools fail to build correctly with make parallelization: > > $ make -s -j24 > fixdep: error opening depfile: ./.iio_utils.o.d: No such file or directory > make[1]: *** [/home/labbott/linux_upstream/tools/build/Makefile.build:96: iio_utils.o] Error 2 > make: *** [Makefile:43: iio_event_monitor-in.o] Error 2 > make: *** Waiting for unfinished jobs.... > > This is because iio_utils.o is used across multiple targets. > Fix this by making iio_utils.o a proper dependency. > > Signed-off-by: Laura Abbott This looks fine to me, but my Makefile foo is decidedly limited. Anyone else want to give a view? It seems sensible to backport this to stable as it seems low risk and will avoid some odd issues for distros. Thanks, Jonathan > --- > I realize that we don't really need the parallelization for tools > because it's so small but when building with the distro we want to use > the same make command and -j wherever possible. > > This same issue also appears in the gpio tools so if this looks like an > okay approach I'll fix it there as well. > --- > tools/iio/Build | 1 + > tools/iio/Makefile | 10 +++++++--- > 2 files changed, 8 insertions(+), 3 deletions(-) > > diff --git a/tools/iio/Build b/tools/iio/Build > index f74cbda64710..8d0f3af3723f 100644 > --- a/tools/iio/Build > +++ b/tools/iio/Build > @@ -1,3 +1,4 @@ > +iio_utils-y += iio_utils.o > lsiio-y += lsiio.o iio_utils.o > iio_event_monitor-y += iio_event_monitor.o iio_utils.o > iio_generic_buffer-y += iio_generic_buffer.o iio_utils.o > diff --git a/tools/iio/Makefile b/tools/iio/Makefile > index e22378dba244..3de763d9ab70 100644 > --- a/tools/iio/Makefile > +++ b/tools/iio/Makefile > @@ -32,20 +32,24 @@ $(OUTPUT)include/linux/iio: ../../include/uapi/linux/iio > > prepare: $(OUTPUT)include/linux/iio > > +IIO_UTILS_IN := $(OUTPUT)iio_utils-in.o > +$(IIO_UTILS_IN): prepare FORCE > + $(Q)$(MAKE) $(build)=iio_utils > + > LSIIO_IN := $(OUTPUT)lsiio-in.o > -$(LSIIO_IN): prepare FORCE > +$(LSIIO_IN): prepare FORCE $(OUTPUT)iio_utils-in.o > $(Q)$(MAKE) $(build)=lsiio > $(OUTPUT)lsiio: $(LSIIO_IN) > $(QUIET_LINK)$(CC) $(CFLAGS) $(LDFLAGS) $< -o $@ > > IIO_EVENT_MONITOR_IN := $(OUTPUT)iio_event_monitor-in.o > -$(IIO_EVENT_MONITOR_IN): prepare FORCE > +$(IIO_EVENT_MONITOR_IN): prepare FORCE $(OUTPUT)iio_utils-in.o > $(Q)$(MAKE) $(build)=iio_event_monitor > $(OUTPUT)iio_event_monitor: $(IIO_EVENT_MONITOR_IN) > $(QUIET_LINK)$(CC) $(CFLAGS) $(LDFLAGS) $< -o $@ > > IIO_GENERIC_BUFFER_IN := $(OUTPUT)iio_generic_buffer-in.o > -$(IIO_GENERIC_BUFFER_IN): prepare FORCE > +$(IIO_GENERIC_BUFFER_IN): prepare FORCE $(OUTPUT)iio_utils-in.o > $(Q)$(MAKE) $(build)=iio_generic_buffer > $(OUTPUT)iio_generic_buffer: $(IIO_GENERIC_BUFFER_IN) > $(QUIET_LINK)$(CC) $(CFLAGS) $(LDFLAGS) $< -o $@