xen-devel.lists.xenproject.org archive mirror
 help / color / mirror / Atom feed
From: "Daniel P. Smith" <dpsmith@apertussolutions.com>
To: Anthony PERARD <anthony.perard@citrix.com>,
	xen-devel@lists.xenproject.org
Subject: Re: [XEN PATCH] build: fix building flask headers before descending in flask/ss/
Date: Fri, 20 Jan 2023 09:13:47 -0500	[thread overview]
Message-ID: <c3e4b2f6-b2b9-b496-a4a3-6292433f695d@apertussolutions.com> (raw)
In-Reply-To: <20230120133626.55680-1-anthony.perard@citrix.com>

On 1/20/23 08:36, Anthony PERARD wrote:
> Unfortunatly, adding prerequisite to "$(obj)/ss/built_in.o" doesn't
> work because we have "$(obj)/%/built_in.o: $(obj)/% ;" in Rules.mk.
> So, make is allow to try to build objects in "xsm/flask/ss/" before
> generating the headers.
> 
> Adding a prerequisite on "$(obj)/ss" instead will fix the issue has
> that the target used to run make in this subdirectory.
> 
> Unfortunatly, that target is also used when running `make clean`, so
> we need to ignore it in this case. $(MAKECMDGOALS) can't be used in
> this case as it is empty, but we can guess which operation is done by
> looking at the list of loaded makefiles.
> 
> Fixes: 7a3bcd2babcc ("build: build everything from the root dir, use obj=$subdir")
> Reported-by: "Daniel P. Smith" <dpsmith@apertussolutions.com>
> Signed-off-by: Anthony PERARD <anthony.perard@citrix.com>
> ---
>   xen/xsm/flask/Makefile | 6 +++++-
>   1 file changed, 5 insertions(+), 1 deletion(-)
> 
> diff --git a/xen/xsm/flask/Makefile b/xen/xsm/flask/Makefile
> index d25312f4fa..2d24346ee3 100644
> --- a/xen/xsm/flask/Makefile
> +++ b/xen/xsm/flask/Makefile
> @@ -16,7 +16,11 @@ FLASK_H_FILES := flask.h class_to_string.h initial_sid_to_string.h
>   AV_H_FILES := av_perm_to_string.h av_permissions.h
>   ALL_H_FILES := $(addprefix include/,$(FLASK_H_FILES) $(AV_H_FILES))
>   
> -$(addprefix $(obj)/,$(obj-y)) $(obj)/ss/built_in.o: $(addprefix $(obj)/,$(ALL_H_FILES))
> +# Adding prerequisite to descending into ss/ folder only when not running `make
> +# clean`.
> +ifeq ($(filter %/Makefile.clean,$(MAKEFILE_LIST)),)
> +$(addprefix $(obj)/,$(obj-y)) $(obj)/ss: $(addprefix $(obj)/,$(ALL_H_FILES))
> +endif
>   extra-y += $(ALL_H_FILES)
>   
>   mkflask := $(srcdir)/policy/mkflask.sh

It builds for me, but I also do not have a large enough system to do a 
`-j16` to confirm it at the scale for which it occurred. Regardless, I 
will ack it.

Acked-by: Daniel P. Smith <dpsmith@apertussolutions.com>


  reply	other threads:[~2023-01-20 14:14 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-01-20 13:36 [XEN PATCH] build: fix building flask headers before descending in flask/ss/ Anthony PERARD
2023-01-20 14:13 ` Daniel P. Smith [this message]
2023-01-20 14:16 ` Jan Beulich
2023-01-20 14:30   ` Anthony PERARD

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=c3e4b2f6-b2b9-b496-a4a3-6292433f695d@apertussolutions.com \
    --to=dpsmith@apertussolutions.com \
    --cc=anthony.perard@citrix.com \
    --cc=xen-devel@lists.xenproject.org \
    /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).