Makefile: introduce check-package target

Message ID 20180810215153.22987-1-thomas.petazzoni@bootlin.com
State Changes Requested
Headers show
Series
  • Makefile: introduce check-package target
Related show

Commit Message

Thomas Petazzoni Aug. 10, 2018, 9:51 p.m.
The snippet of code that runs a check-package on all
.mk/.hash/Config.in files is currently only available within
.gitlab-ci.yml, and isn't immediately and easily usable by Buildroot
users. In order to simplify this, this commit introduces a top-level
"check-package" make target that implements the same logic. The
.gitlab-ci.yml file is changed to use "make check-package".

Since this target is oriented towards Buildroot developers, we
intentionally do not clutter the already noisy "make help" text with
this additional make target.

Signed-off-by: Thomas Petazzoni <thomas.petazzoni@bootlin.com>
---
I often found myself copy/pasting this find command line from
.gitlab-ci.yml to my shell, and got tired of doing this, hence this
patch.
---
 .gitlab-ci.yml | 3 +--
 Makefile       | 4 ++++
 2 files changed, 5 insertions(+), 2 deletions(-)

Comments

Ricardo Martincoski Aug. 11, 2018, 12:44 a.m. | #1
Hello,

Very handy make target!

On Fri, Aug 10, 2018 at 06:51 PM, Thomas Petazzoni wrote:

[snip]
> ---
>  .gitlab-ci.yml | 3 +--
>  Makefile       | 4 ++++
>  2 files changed, 5 insertions(+), 2 deletions(-)

You forgot to change .gitlab-ci.yml.in

[snip]
> +++ b/Makefile
> @@ -1125,6 +1125,10 @@ release:
>  print-version:
>  	@echo $(BR2_VERSION_FULL)
>  
> +check-package:

Shouldn't it be added to noconfig_targets?


Regards,
Ricardo
Thomas Petazzoni Aug. 11, 2018, 10:44 a.m. | #2
Hello Ricardo,

On Fri, 10 Aug 2018 21:44:06 -0300, Ricardo Martincoski wrote:

> On Fri, Aug 10, 2018 at 06:51 PM, Thomas Petazzoni wrote:
> 
> [snip]
> > ---
> >  .gitlab-ci.yml | 3 +--
> >  Makefile       | 4 ++++
> >  2 files changed, 5 insertions(+), 2 deletions(-)  
> 
> You forgot to change .gitlab-ci.yml.in
> 
> [snip]
> > +++ b/Makefile
> > @@ -1125,6 +1125,10 @@ release:
> >  print-version:
> >  	@echo $(BR2_VERSION_FULL)
> >  
> > +check-package:  
> 
> Shouldn't it be added to noconfig_targets?

Thanks for your review! I've fixed those issues and sent a v2.

Best regards,

Thomas

Patch

diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml
index 9d4301076f..d4807c5c85 100644
--- a/.gitlab-ci.yml
+++ b/.gitlab-ci.yml
@@ -43,8 +43,7 @@  check-flake8:
 
 check-package:
     script:
-        - find . -type f \( -name '*.mk' -o -name '*.hash' -o -name 'Config.*' \)
-            -exec ./utils/check-package {} +
+        - make check-package
 
 .defconfig: &defconfig
     # Running the defconfigs for every push is too much, so limit to
diff --git a/Makefile b/Makefile
index f79d39fd26..e7fb216442 100644
--- a/Makefile
+++ b/Makefile
@@ -1125,6 +1125,10 @@  release:
 print-version:
 	@echo $(BR2_VERSION_FULL)
 
+check-package:
+	find $(TOPDIR) -type f \( -name '*.mk' -o -name '*.hash' -o -name 'Config.*' \) \
+		-exec ./utils/check-package {} +
+
 .PHONY: .gitlab-ci.yml
 .gitlab-ci.yml: .gitlab-ci.yml.in
 	cp $< $@