docs: Makefile: Fix make cleandocs by deleting generated .rst files

Message ID 20240208145001.61769-1-thorsten.blum@toblux.com
State New
Headers
Series docs: Makefile: Fix make cleandocs by deleting generated .rst files |

Commit Message

Thorsten Blum Feb. 8, 2024, 2:50 p.m. UTC
  The script tools/net/ynl/ynl-gen-rst.py (YNL_TOOL) generates several .rst
files (YNL_INDEX, YNL_RST_FILES) in Documentation/networking/netlink_spec
(YNL_RST_DIR) which are not deleted by make cleandocs.

Fix make cleandocs by deleting the generated .rst files.

Signed-off-by: Thorsten Blum <thorsten.blum@toblux.com>
---
 Documentation/Makefile | 1 +
 1 file changed, 1 insertion(+)
  

Comments

Jonathan Corbet Feb. 8, 2024, 10:52 p.m. UTC | #1
Thorsten Blum <thorsten.blum@toblux.com> writes:

> The script tools/net/ynl/ynl-gen-rst.py (YNL_TOOL) generates several .rst
> files (YNL_INDEX, YNL_RST_FILES) in Documentation/networking/netlink_spec
> (YNL_RST_DIR) which are not deleted by make cleandocs.
>
> Fix make cleandocs by deleting the generated .rst files.
>
> Signed-off-by: Thorsten Blum <thorsten.blum@toblux.com>
> ---
>  Documentation/Makefile | 1 +
>  1 file changed, 1 insertion(+)
>
> diff --git a/Documentation/Makefile b/Documentation/Makefile
> index 3885bbe260eb..4479910166fc 100644
> --- a/Documentation/Makefile
> +++ b/Documentation/Makefile
> @@ -176,6 +176,7 @@ refcheckdocs:
>  	$(Q)cd $(srctree);scripts/documentation-file-ref-check
>  
>  cleandocs:
> +	$(Q)rm -f $(YNL_INDEX) $(YNL_RST_FILES)
>  	$(Q)rm -rf $(BUILDDIR)
>  	$(Q)$(MAKE) BUILDDIR=$(abspath $(BUILDDIR)) $(build)=Documentation/userspace-api/media clean

So this seems worth doing ... except that there has been talk about not
depositing those files into the source tree in the first place.  Adding
Vegard and Breno to see if they have any thoughts on the matter...

Thanks,

jon
  
Breno Leitao Feb. 9, 2024, 9:38 a.m. UTC | #2
On Thu, Feb 08, 2024 at 03:52:08PM -0700, Jonathan Corbet wrote:
> Thorsten Blum <thorsten.blum@toblux.com> writes:
> 
> > The script tools/net/ynl/ynl-gen-rst.py (YNL_TOOL) generates several .rst
> > files (YNL_INDEX, YNL_RST_FILES) in Documentation/networking/netlink_spec
> > (YNL_RST_DIR) which are not deleted by make cleandocs.
> >
> > Fix make cleandocs by deleting the generated .rst files.
> >
> > Signed-off-by: Thorsten Blum <thorsten.blum@toblux.com>
> > ---
> >  Documentation/Makefile | 1 +
> >  1 file changed, 1 insertion(+)
> >
> > diff --git a/Documentation/Makefile b/Documentation/Makefile
> > index 3885bbe260eb..4479910166fc 100644
> > --- a/Documentation/Makefile
> > +++ b/Documentation/Makefile
> > @@ -176,6 +176,7 @@ refcheckdocs:
> >  	$(Q)cd $(srctree);scripts/documentation-file-ref-check
> >  
> >  cleandocs:
> > +	$(Q)rm -f $(YNL_INDEX) $(YNL_RST_FILES)

I haven't check but I _think_ that just deleting $(YNL_INDEX) is enough
here, since $(YNL_INDEX) depends on $(YNL_RST_FILES).

> >  	$(Q)rm -rf $(BUILDDIR)
> >  	$(Q)$(MAKE) BUILDDIR=$(abspath $(BUILDDIR)) $(build)=Documentation/userspace-api/media clean
> 
> So this seems worth doing ... except that there has been talk about not
> depositing those files into the source tree in the first place.  Adding
> Vegard and Breno to see if they have any thoughts on the matter...

Agree. This is definitely worth doing.
  
Vegard Nossum Feb. 9, 2024, 10:10 a.m. UTC | #3
On 09/02/2024 10:38, Breno Leitao wrote:
> On Thu, Feb 08, 2024 at 03:52:08PM -0700, Jonathan Corbet wrote:
>> Thorsten Blum <thorsten.blum@toblux.com> writes:
>>
>>> The script tools/net/ynl/ynl-gen-rst.py (YNL_TOOL) generates several .rst
>>> files (YNL_INDEX, YNL_RST_FILES) in Documentation/networking/netlink_spec
>>> (YNL_RST_DIR) which are not deleted by make cleandocs.
>>>
>>> Fix make cleandocs by deleting the generated .rst files.
>>>
>>> Signed-off-by: Thorsten Blum <thorsten.blum@toblux.com>
>>> ---
>>>   Documentation/Makefile | 1 +
>>>   1 file changed, 1 insertion(+)
>>>
>>> diff --git a/Documentation/Makefile b/Documentation/Makefile
>>> index 3885bbe260eb..4479910166fc 100644
>>> --- a/Documentation/Makefile
>>> +++ b/Documentation/Makefile
>>> @@ -176,6 +176,7 @@ refcheckdocs:
>>>   	$(Q)cd $(srctree);scripts/documentation-file-ref-check
>>>   
>>>   cleandocs:
>>> +	$(Q)rm -f $(YNL_INDEX) $(YNL_RST_FILES)
> 
> I haven't check but I _think_ that just deleting $(YNL_INDEX) is enough
> here, since $(YNL_INDEX) depends on $(YNL_RST_FILES).

I think removing all of them is the right thing to do.

>>>   	$(Q)rm -rf $(BUILDDIR)
>>>   	$(Q)$(MAKE) BUILDDIR=$(abspath $(BUILDDIR)) $(build)=Documentation/userspace-api/media clean
>>
>> So this seems worth doing ... except that there has been talk about not
>> depositing those files into the source tree in the first place.  Adding
>> Vegard and Breno to see if they have any thoughts on the matter...
> 
> Agree. This is definitely worth doing.

Agree too.

I'll have a look into putting those files in the build directory, this
patch shouldn't affect that.

Reviewed-by: Vegard Nossum <vegard.nossum@oracle.com>


Vegard
  
Jonathan Corbet Feb. 14, 2024, 10:43 p.m. UTC | #4
Thorsten Blum <thorsten.blum@toblux.com> writes:

> The script tools/net/ynl/ynl-gen-rst.py (YNL_TOOL) generates several .rst
> files (YNL_INDEX, YNL_RST_FILES) in Documentation/networking/netlink_spec
> (YNL_RST_DIR) which are not deleted by make cleandocs.
>
> Fix make cleandocs by deleting the generated .rst files.
>
> Signed-off-by: Thorsten Blum <thorsten.blum@toblux.com>
> ---
>  Documentation/Makefile | 1 +
>  1 file changed, 1 insertion(+)
>
> diff --git a/Documentation/Makefile b/Documentation/Makefile
> index 3885bbe260eb..4479910166fc 100644
> --- a/Documentation/Makefile
> +++ b/Documentation/Makefile
> @@ -176,6 +176,7 @@ refcheckdocs:
>  	$(Q)cd $(srctree);scripts/documentation-file-ref-check
>  
>  cleandocs:
> +	$(Q)rm -f $(YNL_INDEX) $(YNL_RST_FILES)
>  	$(Q)rm -rf $(BUILDDIR)
>  	$(Q)$(MAKE) BUILDDIR=$(abspath $(BUILDDIR)) $(build)=Documentation/userspace-api/media clean

Applied, thanks.

jon
  

Patch

diff --git a/Documentation/Makefile b/Documentation/Makefile
index 3885bbe260eb..4479910166fc 100644
--- a/Documentation/Makefile
+++ b/Documentation/Makefile
@@ -176,6 +176,7 @@  refcheckdocs:
 	$(Q)cd $(srctree);scripts/documentation-file-ref-check
 
 cleandocs:
+	$(Q)rm -f $(YNL_INDEX) $(YNL_RST_FILES)
 	$(Q)rm -rf $(BUILDDIR)
 	$(Q)$(MAKE) BUILDDIR=$(abspath $(BUILDDIR)) $(build)=Documentation/userspace-api/media clean