From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 106243 invoked by alias); 15 Nov 2016 18:36:09 -0000 Mailing-List: contact gdb-patches-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: gdb-patches-owner@sourceware.org Received: (qmail 106227 invoked by uid 89); 15 Nov 2016 18:36:08 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-3.9 required=5.0 tests=BAYES_00,KAM_ASCII_DIVIDERS,RP_MATCHES_RCVD,SPF_HELO_PASS autolearn=ham version=3.3.2 spammy= X-HELO: mx1.redhat.com Received: from mx1.redhat.com (HELO mx1.redhat.com) (209.132.183.28) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Tue, 15 Nov 2016 18:36:07 +0000 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 C0CFBA7386; Tue, 15 Nov 2016 18:36:05 +0000 (UTC) Received: from [127.0.0.1] (ovpn03.gateway.prod.ext.phx2.redhat.com [10.5.9.3]) by int-mx13.intmail.prod.int.phx2.redhat.com (8.14.4/8.14.4) with ESMTP id uAFIa4Hc010984; Tue, 15 Nov 2016 13:36:05 -0500 Subject: Re: [PATCH 2/4] Makefile: Replace explicit subdir rules with pattern rules To: Simon Marchi References: <20161113034625.8237-1-simon.marchi@polymtl.ca> <20161113034625.8237-3-simon.marchi@polymtl.ca> <0af6b4a0-1c57-59ba-c25f-24a68136a6c5@redhat.com> Cc: gdb-patches@sourceware.org From: Pedro Alves Message-ID: <6f62ae95-b0a4-48cc-cc09-63a57fa18c44@redhat.com> Date: Tue, 15 Nov 2016 18:36:00 -0000 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:45.0) Gecko/20100101 Thunderbird/45.4.0 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset=windows-1252 Content-Transfer-Encoding: 7bit X-SW-Source: 2016-11/txt/msg00385.txt.bz2 On 11/15/2016 06:00 PM, Simon Marchi wrote: > On 2016-11-15 12:54, Pedro Alves wrote: >> On 11/13/2016 03:46 AM, Simon Marchi wrote: >>> # Need to explicitly specify the compile rule as make will do nothing >>> # or try to compile the object file into the sub-directory. >> >> Do these comments need adjustment? > > I thought they were still true and relevant after the change. What do > you think? But should we at least merge them? Looking at your branch on github, we end up with: ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ # # gdb/cli/ dependencies # # Need to explicitly specify the compile rule as make will do nothing # or try to compile the object file into the sub-directory. %.o: $(srcdir)/cli/%.c $(COMPILE) $< $(POSTCOMPILE) # GCC Compile support dependencies # # Need to explicitly specify the compile rule as make will do nothing # or try to compile the object file into the sub-directory. %.o: $(srcdir)/compile/%.c $(COMPILE) $< $(POSTCOMPILE) # # GDBTK sub-directory # # Need to explicitly specify the compile rule as make will do nothing # or try to compile the object file into the mi directory. all-gdbtk: insight$(EXEEXT) ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ The last one is strange, for talking about MI. And then a bit further below, we have the same comment several times again: ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ # # gdb/mi/ dependencies # # Need to explicitly specify the compile rule as make will do nothing # or try to compile the object file into the sub-directory. %.o: $(srcdir)/mi/%.c $(COMPILE) $< # gdb/common/ dependencies # # Need to explicitly specify the compile rule as make will do nothing # or try to compile the object file into the sub-directory. %.o: ${srcdir}/common/%.c $(COMPILE) $< $(POSTCOMPILE) common-agent.o: $(srcdir)/common/agent.c $(COMPILE) $(srcdir)/common/agent.c $(POSTCOMPILE) # # gdb/target/ dependencies # # Need to explicitly specify the compile rule as make will do nothing # or try to compile the object file into the sub-directory. %.o: ${srcdir}/target/%.c $(COMPILE) $< $(POSTCOMPILE) # # gdb/arch/ dependencies # # Need to explicitly specify the compile rule as make will do nothing # or try to compile the object file into the sub-directory. %.o: ${srcdir}/arch/%.c $(COMPILE) $< $(POSTCOMPILE) # gdb/nat/ dependencies # # Need to explicitly specify the compile rule as make will do nothing # or try to compile the object file into the sub-directory. %.o: ${srcdir}/nat/%.c $(COMPILE) $< $(POSTCOMPILE) # # gdb/tui/ dependencies # # Need to explicitly specify the compile rule as make will do nothing # or try to compile the object file into the sub-directory. %.o: $(srcdir)/tui/%.c $(COMPILE) $< $(POSTCOMPILE) # gdb/guile dependencies # # Need to explicitly specify the compile rule as make will do nothing # or try to compile the object file into the sub-directory. %.o: $(srcdir)/guile/%.c $(COMPILE) $< $(POSTCOMPILE) # gdb/python/ dependencies # # Need to explicitly specify the compile rule as make will do nothing # or try to compile the object file into the sub-directory. # Flags needed to compile Python code PYTHON_CFLAGS=@PYTHON_CFLAGS@ %.o: $(srcdir)/python/%.c $(COMPILE) $(PYTHON_CFLAGS) $< $(POSTCOMPILE) ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ I think a single comment talking about needing a compile rule for each subdir, might be clearer/simpler. Also, the cases that are exceptions I think would benefit from a comment, like e.g., the common-agent.o rule. Thanks, Pedro Alves