2019-08-21 04:15:48

by Masahiro Yamada

[permalink] [raw]
Subject: [PATCH v2 0/4] video/logo: various fix and cleanups of drivers/video/logo/Makefile

Changes in v2:
- Fix commit log

Masahiro Yamada (4):
video/logo: remove unneeded *.o pattern from clean-files
video/logo: do not generate unneeded logo C files
video/logo: simplify cmd_logo
video/logo: move pnmtologo tool to drivers/video/logo/ from scripts/

drivers/video/logo/.gitignore | 1 +
drivers/video/logo/Makefile | 36 ++++-----------------
{scripts => drivers/video/logo}/pnmtologo.c | 0
scripts/.gitignore | 1 -
scripts/Makefile | 2 --
5 files changed, 8 insertions(+), 32 deletions(-)
rename {scripts => drivers/video/logo}/pnmtologo.c (100%)

--
2.17.1


2019-08-21 04:15:50

by Masahiro Yamada

[permalink] [raw]
Subject: [PATCH v2 2/4] video/logo: do not generate unneeded logo C files

Currently, all the logo C files are generated irrespective of the
CONFIG options. Adding them to extra-y is wrong. What we need to do
here is to add them to 'targets' so that if_changed works properly.

Files listed in 'targets' are cleaned, so clean-files is unneeded.

Signed-off-by: Masahiro Yamada <[email protected]>
---

Changes in v2:
- Fix commit log

drivers/video/logo/Makefile | 21 ++-------------------
1 file changed, 2 insertions(+), 19 deletions(-)

diff --git a/drivers/video/logo/Makefile b/drivers/video/logo/Makefile
index 10b75ce3ce09..16f60c1e1766 100644
--- a/drivers/video/logo/Makefile
+++ b/drivers/video/logo/Makefile
@@ -18,23 +18,6 @@ obj-$(CONFIG_SPU_BASE) += logo_spe_clut224.o

# How to generate logo's

-# Use logo-cfiles to retrieve list of .c files to be built
-logo-cfiles = $(notdir $(patsubst %.$(2), %.c, \
- $(wildcard $(srctree)/$(src)/*$(1).$(2))))
-
-
-# Mono logos
-extra-y += $(call logo-cfiles,_mono,pbm)
-
-# VGA16 logos
-extra-y += $(call logo-cfiles,_vga16,ppm)
-
-# 224 Logos
-extra-y += $(call logo-cfiles,_clut224,ppm)
-
-# Gray 256
-extra-y += $(call logo-cfiles,_gray256,pgm)
-
pnmtologo := scripts/pnmtologo

# Create commands like "pnmtologo -t mono -n logo_mac_mono -o ..."
@@ -55,5 +38,5 @@ $(obj)/%_clut224.c: $(src)/%_clut224.ppm $(pnmtologo) FORCE
$(obj)/%_gray256.c: $(src)/%_gray256.pgm $(pnmtologo) FORCE
$(call if_changed,logo)

-# Files generated that shall be removed upon make clean
-clean-files := *_mono.c *_vga16.c *_clut224.c *_gray256.c
+# generated C files
+targets += *_mono.c *_vga16.c *_clut224.c *_gray256.c
--
2.17.1

2019-08-21 04:15:57

by Masahiro Yamada

[permalink] [raw]
Subject: [PATCH v2 1/4] video/logo: remove unneeded *.o pattern from clean-files

The pattern *.o is cleaned up globally by the top Makefile.

Signed-off-by: Masahiro Yamada <[email protected]>
---

Changes in v2: None

drivers/video/logo/Makefile | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/video/logo/Makefile b/drivers/video/logo/Makefile
index 228a89b9bdd1..10b75ce3ce09 100644
--- a/drivers/video/logo/Makefile
+++ b/drivers/video/logo/Makefile
@@ -56,4 +56,4 @@ $(obj)/%_gray256.c: $(src)/%_gray256.pgm $(pnmtologo) FORCE
$(call if_changed,logo)

# Files generated that shall be removed upon make clean
-clean-files := *.o *_mono.c *_vga16.c *_clut224.c *_gray256.c
+clean-files := *_mono.c *_vga16.c *_clut224.c *_gray256.c
--
2.17.1