From: Jakub Kicinski <kuba@kernel.org>
To: Jan Stancek <jstancek@redhat.com>
Cc: donald.hunter@gmail.com, stfomichev@gmail.com, pabeni@redhat.com,
davem@davemloft.net, edumazet@google.com, horms@kernel.org,
netdev@vger.kernel.org, linux-kernel@vger.kernel.org
Subject: Re: [PATCH v2 4/5] tools: ynl: add install target for specs and docs
Date: Tue, 10 Dec 2024 19:31:10 -0800 [thread overview]
Message-ID: <20241210193110.18ddb9f6@kernel.org> (raw)
In-Reply-To: <0271f19ad8f5453d2fea5b0f05648b9c2667d771.1733755068.git.jstancek@redhat.com>
On Mon, 9 Dec 2024 15:47:16 +0100 Jan Stancek wrote:
> +SPECS_PATHS=$(wildcard ../../../../Documentation/netlink/specs/*.yaml)
Maybe factor out:
SPECS_DIR := ../../../../Documentation/netlink/specs
? It's pretty long and we repeat it all over the place.
> +SPECS=$(patsubst ../../../../Documentation/netlink/specs/%.yaml,%,${SPECS_PATHS})
> +RSTS=$(patsubst %,%.rst,${SPECS})
> +
> +all: protos.a $(HDRS) $(SRCS) $(KHDRS) $(KSRCS) $(UAPI) $(RSTS)
>
> protos.a: $(OBJS)
> @echo -e "\tAR $@"
> @@ -40,8 +50,12 @@ protos.a: $(OBJS)
> @echo -e "\tCC $@"
> @$(COMPILE.c) $(CFLAGS_$*) -o $@ $<
>
> +%.rst: ../../../../Documentation/netlink/specs/%.yaml $(TOOL2)
TOOL2 -> TOOL_RST ?
> + @echo -e "\tGEN_RST $@"
> + @$(TOOL_RST) -o $@ -i $<
> +
> clean:
> - rm -f *.o
> + rm -f *.o *.rst
No strong preference but I'd count .rst as final artifacts so I'd clean
them up in distclean target only, not the clean target. The distinction
itself may be a local custom..
> distclean: clean
> rm -f *.c *.h *.a
> @@ -49,5 +63,19 @@ distclean: clean
> regen:
> @../ynl-regen.sh
>
> -.PHONY: all clean distclean regen
> +install-rsts:
> + @echo -e "\tINSTALL generated docs"
> + @$(INSTALL) -d $(DESTDIR)$(docdir)/ynl
> + @$(INSTALL) -m 0644 $(RSTS) $(DESTDIR)$(docdir)/ynl/
> +
> +install-specs:
> + @echo -e "\tINSTALL specs"
> + @$(INSTALL) -d $(DESTDIR)$(datarootdir)/ynl
> + @$(INSTALL) -m 0644 ../../../../Documentation/netlink/*.yaml $(DESTDIR)$(datarootdir)/ynl/
> + @$(INSTALL) -d $(DESTDIR)$(datarootdir)/ynl/specs
> + @$(INSTALL) -m 0644 ../../../../Documentation/netlink/specs/*.yaml $(DESTDIR)$(datarootdir)/ynl/specs/
> +
> +install: install-rsts install-specs
> +
> +.PHONY: all clean distclean regen install
I think .PHONY needs install-rsts install-specs, too?
> .DEFAULT_GOAL: all
--
pw-bot: cr
next prev parent reply other threads:[~2024-12-11 3:31 UTC|newest]
Thread overview: 14+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-12-09 14:47 [PATCH v2 0/5] tools: ynl: add install target Jan Stancek
2024-12-09 14:47 ` [PATCH v2 1/5] tools: ynl: move python code to separate sub-directory Jan Stancek
2024-12-09 14:47 ` [PATCH v2 2/5] tools: ynl: provide symlinks to user-facing scripts for compatibility Jan Stancek
2024-12-11 3:26 ` Jakub Kicinski
2024-12-11 9:21 ` Donald Hunter
2024-12-11 12:42 ` Jan Stancek
2024-12-12 2:13 ` Jakub Kicinski
2024-12-09 14:47 ` [PATCH v2 3/5] tools: ynl: add initial pyproject.toml for packaging Jan Stancek
2024-12-09 14:47 ` [PATCH v2 4/5] tools: ynl: add install target for specs and docs Jan Stancek
2024-12-11 3:31 ` Jakub Kicinski [this message]
2024-12-09 14:47 ` [PATCH v2 5/5] tools: ynl: add main install target Jan Stancek
2024-12-09 21:30 ` Joe Damato
2024-12-10 13:56 ` Jan Stancek
2024-12-10 16:34 ` Joe Damato
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20241210193110.18ddb9f6@kernel.org \
--to=kuba@kernel.org \
--cc=davem@davemloft.net \
--cc=donald.hunter@gmail.com \
--cc=edumazet@google.com \
--cc=horms@kernel.org \
--cc=jstancek@redhat.com \
--cc=linux-kernel@vger.kernel.org \
--cc=netdev@vger.kernel.org \
--cc=pabeni@redhat.com \
--cc=stfomichev@gmail.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).