mail archive of the barebox mailing list
 help / color / mirror / Atom feed
From: Johannes Zink <j.zink@pengutronix.de>
To: barebox@lists.infradead.org
Cc: patchwork-jzi@pengutronix.de, kernel@pengutronix.de,
	=ahmad@a3f.at, afa@pengutronix.de,
	Johannes Zink <j.zink@pengutronix.de>
Subject: [PATCH] fixup! imx-usb-loader: add commandline option for displaying version number
Date: Fri, 26 May 2023 09:08:47 +0200	[thread overview]
Message-ID: <20230526070847.52738-1-j.zink@pengutronix.de> (raw)

As Ahmad pointed out in [1], compilation failed if the prepare make
target was not called before compiling the imx-usb-loader, which caused
the generated file not to exist when building for the sandbox target and
broke the build.

As the included utsrelease file only contains a UTS_RELEASE macro
generated from the KERNELVERSION make variable: use the variable
directly and pass it via HOSTCFLAGS as a define. Leave the remaining
code untouched to still support compiling the imx-usb-loader from an
external makefile which does not define the UTS_RELEASE macro.

while at it: also propagate the version number to the target imx-usb-loader.

Fixes: c1b50061f4b3 ("imx-usb-loader: add commandline option for
displaying version number")

[1] 20230525181320.2277320-1-ahmad@a3f.at

Signed-off-by: Johannes Zink <j.zink@pengutronix.de>
---
 scripts/imx/Makefile | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/scripts/imx/Makefile b/scripts/imx/Makefile
index b3be3886d8eb..dca6be2fe1f4 100644
--- a/scripts/imx/Makefile
+++ b/scripts/imx/Makefile
@@ -3,10 +3,10 @@
 hostprogs-always-$(CONFIG_ARCH_IMX_IMXIMAGE)	+= imx-image
 hostprogs-always-$(CONFIG_ARCH_IMX_USBLOADER)	+= imx-usb-loader
 
-HOSTCFLAGS_imx-usb-loader.o = `pkg-config --cflags libusb-1.0` -include $(objtree)/include/generated/utsrelease.h
+HOSTCFLAGS_imx-usb-loader.o = `pkg-config --cflags libusb-1.0` -DUTS_RELEASE='"$(KERNELVERSION)"'
 HOSTLDLIBS_imx-usb-loader  = `pkg-config --libs libusb-1.0`
 
-imx-usb-loader-target-userccflags += `$(CROSS_PKG_CONFIG) --cflags libusb-1.0`
+imx-usb-loader-target-userccflags += `$(CROSS_PKG_CONFIG) --cflags libusb-1.0` -DUTS_RELEASE='"$(KERNELVERSION)"'
 imx-usb-loader-target-userldlibs += `$(CROSS_PKG_CONFIG) --libs libusb-1.0`
 
 HOSTCFLAGS_imx.o = -I$(srctree)/include/mach
-- 
2.39.2




             reply	other threads:[~2023-05-26  7:10 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-05-26  7:08 Johannes Zink [this message]
2023-05-26  7:50 ` Ahmad Fatoum
2023-05-26  8:19   ` Johannes Zink
2023-05-26  8:23     ` Ahmad Fatoum

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=20230526070847.52738-1-j.zink@pengutronix.de \
    --to=j.zink@pengutronix.de \
    --cc==ahmad@a3f.at \
    --cc=afa@pengutronix.de \
    --cc=barebox@lists.infradead.org \
    --cc=kernel@pengutronix.de \
    --cc=patchwork-jzi@pengutronix.de \
    /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