diff mbox series

[XEN,v6,19/31] build: rework .banner generation

Message ID 20210701141011.785641-20-anthony.perard@citrix.com (mailing list archive)
State New, archived
Headers show
Series xen: Build system improvements | expand

Commit Message

Anthony PERARD July 1, 2021, 2:09 p.m. UTC
Avoid depending on Makefile but still allow to rebuild the banner when
$(XEN_FULLVERSION) changes.

Also add a dependency on tools/xen.flf, even if not expected to
change.

Signed-off-by: Anthony PERARD <anthony.perard@citrix.com>
---
 xen/Makefile | 20 +++++++++++++-------
 1 file changed, 13 insertions(+), 7 deletions(-)

Comments

Jan Beulich Aug. 5, 2021, 7:09 a.m. UTC | #1
On 01.07.2021 16:09, Anthony PERARD wrote:
> Avoid depending on Makefile but still allow to rebuild the banner when
> $(XEN_FULLVERSION) changes.
> 
> Also add a dependency on tools/xen.flf, even if not expected to
> change.
> 
> Signed-off-by: Anthony PERARD <anthony.perard@citrix.com>

Reviewed-by: Jan Beulich <jbeulich@suse.com>

This looks to be independent of earlier patches in this series? If so,
I'd be happy to commit without waiting for earlier patches to get
review comments addressed.

Jan
Anthony PERARD Aug. 9, 2021, 1:31 p.m. UTC | #2
On Thu, Aug 05, 2021 at 09:09:13AM +0200, Jan Beulich wrote:
> On 01.07.2021 16:09, Anthony PERARD wrote:
> > Avoid depending on Makefile but still allow to rebuild the banner when
> > $(XEN_FULLVERSION) changes.
> > 
> > Also add a dependency on tools/xen.flf, even if not expected to
> > change.
> > 
> > Signed-off-by: Anthony PERARD <anthony.perard@citrix.com>
> 
> Reviewed-by: Jan Beulich <jbeulich@suse.com>
> 
> This looks to be independent of earlier patches in this series? If so,

Yes, it's independent.

> I'd be happy to commit without waiting for earlier patches to get
> review comments addressed.

Thanks,
diff mbox series

Patch

diff --git a/xen/Makefile b/xen/Makefile
index 7e3e4c42d77b..267ae77aef7a 100644
--- a/xen/Makefile
+++ b/xen/Makefile
@@ -399,13 +399,19 @@  delete-unfresh-files:
 		rm -f include/xen/compile.h; \
 	fi
 
-.banner: Makefile
-	@if which figlet >/dev/null 2>&1 ; then \
-		echo " Xen $(XEN_FULLVERSION)" | figlet -f tools/xen.flf > $@.tmp; \
-	else \
-		echo " Xen $(XEN_FULLVERSION)" > $@.tmp; \
-	fi
-	@mv -f $@.tmp $@
+quiet_cmd_banner = BANNER  $@
+define cmd_banner
+    if which figlet >/dev/null 2>&1 ; then \
+	echo " Xen $(XEN_FULLVERSION)" | figlet -f $< > $@.tmp; \
+    else \
+	echo " Xen $(XEN_FULLVERSION)" > $@.tmp; \
+    fi; \
+    mv -f $@.tmp $@
+endef
+
+.banner: tools/xen.flf FORCE
+	$(call if_changed,banner)
+targets += .banner
 
 # compile.h contains dynamic build info. Rebuilt on every 'make' invocation.
 include/xen/compile.h: include/xen/compile.h.in .banner