From: Chen Yu <yu.c.chen@intel.com>
To: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
Cc: linux-acpi@vger.kernel.org, Robert Moore <robert.moore@intel.com>,
"Rafael J. Wysocki" <rafael.j.wysocki@intel.com>,
Len Brown <lenb@kernel.org>,
devel@acpica.org, linux-kernel@vger.kernel.org
Subject: Re: [PATCH] tools/power/acpi: Fix the compile error when output directory is specified
Date: Wed, 24 Nov 2021 01:03:32 +0800 [thread overview]
Message-ID: <20211123170332.GA27921@chenyu5-mobl1> (raw)
In-Reply-To: <YZzyQ2FD2meImsHD@smile.fi.intel.com>
On Tue, Nov 23, 2021 at 03:53:07PM +0200, Andy Shevchenko wrote:
> On Tue, Nov 23, 2021 at 09:23:30PM +0800, Chen Yu wrote:
> > Compiling the tool when output directory parameter is specified would
> > trigger the following error:
> >
> > make O=/data/test/tmp/ -C tools/power/acpi/
> >
> > make: Entering directory '/data/src/kernel/linux/tools/power/acpi'
> > DESCEND tools/acpidbg
> > make[1]: Entering directory '/data/src/kernel/linux/tools/power/acpi/tools/acpidbg'
> > MKDIR include
> > CP include
> > CC tools/acpidbg/acpidbg.o
> > Assembler messages:
> > Fatal error: can't create /data/test/tmp/tools/power/acpi/tools/acpidbg/acpidbg.o: No such file or directory
> > make[1]: *** [../../Makefile.rules:24: /data/test/tmp/tools/power/acpi/tools/acpidbg/acpidbg.o] Error 1
> > make[1]: Leaving directory '/data/src/kernel/linux/tools/power/acpi/tools/acpidbg'
> > make: *** [Makefile:18: acpidbg] Error 2
> > make: Leaving directory '/data/src/kernel/linux/tools/power/acpi'
> >
> > This is because the output directory has not been created yet. Fix this issue by
> > creating the output directory before compiling.
>
> Reviewed-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
> Thanks!
>
Thanks for review.
> >
> > $(objdir)%.o: %.c $(KERNEL_INCLUDE)
> > $(ECHO) " CC " $(subst $(OUTPUT),,$@)
> > + $(QUIET) $(MKDIR) -p $(objdir) 2>/dev/null
>
> Not sure we need the `2>/dev/null` part.
>
If the 'O=' is a read-only directory, mkdir would print errors
and adding 2> would avoid printing it. So the user could focus
on the real compile error.
without '2>' :
make O=/data/test/tmp -C tools/power/acpi/
make: Entering directory '/data/src/kernel/linux/tools/power/acpi'
DESCEND tools/acpidbg
mkdir: cannot create directory ‘/data/test/tmp/tools’: Permission denied
thanks,
Chenyu
> > $(QUIET) $(CC) -c $(CFLAGS) -o $@ $<
> >
> > all: $(OUTPUT)$(TOOL)
> > --
> > 2.25.1
> >
>
> --
> With Best Regards,
> Andy Shevchenko
>
>
next prev parent reply other threads:[~2021-11-23 17:06 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2021-11-23 13:23 [PATCH] tools/power/acpi: Fix the compile error when output directory is specified Chen Yu
2021-11-23 13:53 ` Andy Shevchenko
2021-11-23 17:03 ` Chen Yu [this message]
2021-12-08 14:12 ` Rafael J. Wysocki
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=20211123170332.GA27921@chenyu5-mobl1 \
--to=yu.c.chen@intel.com \
--cc=andriy.shevchenko@linux.intel.com \
--cc=devel@acpica.org \
--cc=lenb@kernel.org \
--cc=linux-acpi@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=rafael.j.wysocki@intel.com \
--cc=robert.moore@intel.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).