From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.133.124]) by sourceware.org (Postfix) with ESMTPS id 6F23E39AF0E2 for ; Thu, 6 Jun 2024 17:50:10 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org 6F23E39AF0E2 Authentication-Results: sourceware.org; dmarc=pass (p=none dis=none) header.from=redhat.com Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=redhat.com ARC-Filter: OpenARC Filter v1.0.0 sourceware.org 6F23E39AF0E2 Authentication-Results: server2.sourceware.org; arc=none smtp.remote-ip=170.10.133.124 ARC-Seal: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1717696212; cv=none; b=vVZUT9DhIhUjBWJ9SVq1uIymbqSMXbSzQlGpu9ifGPGalFQIT+YLCC7Xe4pMrpgWFZUaR/Y9qN2ebxoonAaE3OrATZYWnmfeb7FjPMXH46hBGsk0n6XxZG9JwPpLDfwphumpJcmUHykhHp3ClhHDZFwpcre49L1Y6g9mS2he7KY= ARC-Message-Signature: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1717696212; c=relaxed/simple; bh=g/9z1NqxYg/ytJ/4z8TjCV6+DQYa+Q3wPddhWOObDds=; h=DKIM-Signature:From:To:Subject:Date:Message-Id:MIME-Version; b=eY2WDMWI/kSRsr0FCYPMPQApRQV/EGV6a/zdO2FzhiTVZ4qcRtAAprr4PsfLBnM2t5m9XwqrvqL9Y3MKzylbGPPCVymAwW3KhB40dL8M0botRarBEUa0Ea9RIHlqVwaBz3gDnXnaiyxfjRoOIATztXiBAWvYWGJ74pewXeknMGs= ARC-Authentication-Results: i=1; server2.sourceware.org DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1717696210; 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: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=u3ORoYuowABN3ZKLlNFiuxND5NyJiGgLMhEgkh7mFlA=; b=DMJCN1jrT98ty4eyo5FSNaXGmxoDdYFll5dxMSZa7rPVHZQGnBxvkE7+/dRtU4DWEuHZ4R PjD03rAxPdnMhE8LmiBLpAgtlllbxE0pwjSIddc54Df9A8oaHyQD4D5j5nTcu6FgNnbowd e1ZeN+1X19rwWcNksc/LM45D17TvOeU= Received: from mail-ej1-f69.google.com (mail-ej1-f69.google.com [209.85.218.69]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-622-hRbFtqftOyWZ9aDwO5CWaQ-1; Thu, 06 Jun 2024 13:50:08 -0400 X-MC-Unique: hRbFtqftOyWZ9aDwO5CWaQ-1 Received: by mail-ej1-f69.google.com with SMTP id a640c23a62f3a-a6c72164f46so69913566b.1 for ; Thu, 06 Jun 2024 10:50:08 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1717696206; x=1718301006; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=u3ORoYuowABN3ZKLlNFiuxND5NyJiGgLMhEgkh7mFlA=; b=TnFUbZ5JlhJZEK7v2tm4Uyn10+Y1yhYkmR3tmAqd7oSyG60fL63pqwXpMxklQwZy4v /2GGNKhgTrbdqTl27biY+Jys+EnLn1m0n2zuKaug+rbS2EmcpZiGgbUHqFwcoDFb5ANV k6U9GuSq3/C6RTKqxrqCk3bdxPVk/utDSDHC1LGNiSvXg6Fd6mdvV0E4nomzviJ+orWV ZOY562nicSF5BNjd+4Rb3lYXuChq2WLsg61cDZsmUPktd5hasMFzvU5vym1CGPnfFaAy I/zzJykiIJscnE4dbj2P3WAiFRLZF1ShZ3SK62X2bve2hvWdJACEnSUsKE9S451vCCuO 7wjQ== X-Gm-Message-State: AOJu0Ywd3WHP0Kss0S+j65boWkVu3YPJYUGqRMUVIRDCugIWrhnrFzHb BQUZpvoecaX3BJ0GO63AAPYK4m9qcMoeUGg09aEpBY4nkLI2rMJCATzqCWyYY+SE3eVgT3Ian7W dwjXeP6skXyu6RzVVZx/9y3M8ou7GnC54gMzF4TFa4NB3JJnC3nQa3Wwiym1p2mAfdtvxIcpHS5 bNkma/q/rcWXbkbnCTO6RE0ILI8vZoremtElH4gwzSJ/0= X-Received: by 2002:a17:906:1d08:b0:a68:e4ec:6ed2 with SMTP id a640c23a62f3a-a6cd675cdb2mr17328266b.31.1717696205962; Thu, 06 Jun 2024 10:50:05 -0700 (PDT) X-Google-Smtp-Source: AGHT+IFHyt+u+H9SOch0/FH9fF+cok0qF/5Za6lfvwx155ytjS27V6U8qE4rSHV9rcyYs1SFLzL3DA== X-Received: by 2002:a17:906:1d08:b0:a68:e4ec:6ed2 with SMTP id a640c23a62f3a-a6cd675cdb2mr17326666b.31.1717696205507; Thu, 06 Jun 2024 10:50:05 -0700 (PDT) Received: from localhost (92.40.184.206.threembb.co.uk. [92.40.184.206]) by smtp.gmail.com with ESMTPSA id a640c23a62f3a-a6c805ce1a4sm124651366b.75.2024.06.06.10.50.04 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 06 Jun 2024 10:50:04 -0700 (PDT) From: Andrew Burgess To: gdb-patches@sourceware.org Cc: Andrew Burgess Subject: [PATCHv3 2/6] gdb/doc: merge rules for building .1 and .5 man pages Date: Thu, 6 Jun 2024 18:49:54 +0100 Message-Id: X-Mailer: git-send-email 2.25.4 In-Reply-To: References: MIME-Version: 1.0 X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Transfer-Encoding: 8bit Content-Type: text/plain; charset="US-ASCII"; x-default=true X-Spam-Status: No, score=-11.9 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH,DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,GIT_PATCH_0,RCVD_IN_DNSWL_NONE,RCVD_IN_MSPIKE_H4,RCVD_IN_MSPIKE_WL,SPF_HELO_NONE,SPF_NONE,TXREP,T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on server2.sourceware.org List-Id: We have two rules, one each for building the .1 and .5 man pages. The only actual difference is that one rule passes --section=1 and the other passes --section=5 (see the definitions of POD2MAN1 and POD2MAN5 respectively. I figure by using the suffix from the target of the rule we can combine these two rules into one. I use: $(subst .,,$(suffix $@)) This gets the suffix from the target, either '.1' or '.5', and the 'subst' removes the '.' leaving '1' or '5'. Now that I'm not using a static pattern rule for building the man pages, the advice in the 'make' documentation is to not use $*, so I've moved away from that to instead use $(basename $@), e.g. for 'gdbinit.5' this gives 'gdbinit', which is what we want. There should be no difference in what is created after this change. --- gdb/doc/Makefile.in | 23 +++++++++-------------- 1 file changed, 9 insertions(+), 14 deletions(-) diff --git a/gdb/doc/Makefile.in b/gdb/doc/Makefile.in index 1a0791d518f..70d65d58ed0 100644 --- a/gdb/doc/Makefile.in +++ b/gdb/doc/Makefile.in @@ -178,10 +178,8 @@ MANCONF = -Dman TEXI2POD = perl $(srcdir)/../../etc/texi2pod.pl \ $(MAKEINFOFLAGS) $(MAKEINFO_EXTRA_FLAGS) -POD2MAN1 = pod2man --center="GNU Development Tools" \ - --release="gdb-`sed q version.subst`" --section=1 -POD2MAN5 = pod2man --center="GNU Development Tools" \ - --release="gdb-`sed q version.subst`" --section=5 +POD2MAN = pod2man --center="GNU Development Tools" \ + --release="gdb-`sed q version.subst`" # List of man pages generated from gdb.texi MAN1S = gdb.1 gdbserver.1 gcore.1 gdb-add-index.1 @@ -654,17 +652,14 @@ annotate/index.html: $(ANNOTATE_DOC_FILES) # pages, then the .pod files must become a dependency, this will # trigger an attempt to rebuild these files while building and # installing a release of GDB, which is something we don't want. -$(MAN1S) : %.1 : $(GDB_DOC_FILES) - $(ECHO_TEXI2POD) $(TEXI2POD) $(MANCONF) -D$* < $(srcdir)/gdb.texinfo > $*.pod - $(ECHO_TEXI2MAN) ($(POD2MAN1) $*.pod | sed -e '/^.if n .na/d' > $@.T$$$$ && \ +$(MAN1S) $(MAN5S) : version.subst $(GDB_DOC_FILES) + $(ECHO_TEXI2POD) $(TEXI2POD) $(MANCONF) -D$(basename $@) \ + < $(srcdir)/gdb.texinfo > $(basename $@).pod + $(ECHO_TEXI2MAN) ($(POD2MAN) --section=$(subst .,,$(suffix $@)) \ + $(basename $@).pod | \ + sed -e '/^.if n .na/d' > $@.T$$$$ && \ mv -f $@.T$$$$ $@) || (rm -f $@.T$$$$ && exit 1) - $(SILENCE) rm -f $*.pod - -$(MAN5S) : %.5 : $(GDB_DOC_FILES) - $(ECHO_TEXI2POD) $(TEXI2POD) $(MANCONF) -D$* < $(srcdir)/gdb.texinfo > $*.pod - $(ECHO_TEXI2MAN) ($(POD2MAN5) $*.pod | sed -e '/^.if n .na/d' > $@.T$$$$ && \ - mv -f $@.T$$$$ $@) || (rm -f $@.T$$$$ && exit 1) - $(SILENCE) rm -f $*.pod + $(SILENCE) rm -f $(basename $@).pod force: -- 2.25.4