* [PATCH] kbuild: comments cleanup in Makefile.lib
@ 2017-09-19 11:36 ` Cao jin
0 siblings, 0 replies; 5+ messages in thread
From: Cao jin @ 2017-09-19 11:36 UTC (permalink / raw)
To: linux-kbuild, linux-kernel; +Cc: yamada.masahiro, mmarek
It has:
1. Move comments close to what it want to comment.
2. Comments cleanup & improvement.
Signed-off-by: Cao jin <caoj.fnst@cn.fujitsu.com>
---
scripts/Makefile.lib | 19 ++++++-------------
1 file changed, 6 insertions(+), 13 deletions(-)
diff --git a/scripts/Makefile.lib b/scripts/Makefile.lib
index 58c05e5..7de9c08 100644
--- a/scripts/Makefile.lib
+++ b/scripts/Makefile.lib
@@ -4,8 +4,7 @@ ccflags-y += $(EXTRA_CFLAGS)
cppflags-y += $(EXTRA_CPPFLAGS)
ldflags-y += $(EXTRA_LDFLAGS)
-#
-# flags that take effect in sub directories
+# flags that take effect in current and sub directories
export KBUILD_SUBDIR_ASFLAGS := $(KBUILD_SUBDIR_ASFLAGS) $(subdir-asflags-y)
export KBUILD_SUBDIR_CCFLAGS := $(KBUILD_SUBDIR_CCFLAGS) $(subdir-ccflags-y)
@@ -14,14 +13,16 @@ export KBUILD_SUBDIR_CCFLAGS := $(KBUILD_SUBDIR_CCFLAGS) $(subdir-ccflags-y)
# When an object is listed to be built compiled-in and modular,
# only build the compiled-in version
-
obj-m := $(filter-out $(obj-y),$(obj-m))
# Libraries are always collected in one lib file.
# Filter out objects already built-in
-
lib-y := $(filter-out $(obj-y), $(sort $(lib-y) $(lib-m)))
+# Determine modorder.
+# Unfortunately, we don't have information about ordering between -y
+# and -m subdirs. Just put -y's first.
+modorder := $(patsubst %/,%/modules.order, $(filter %/, $(obj-y)) $(obj-m:.o=.ko))
# Handle objects in subdirs
# ---------------------------------------------------------------------------
@@ -29,12 +30,6 @@ lib-y := $(filter-out $(obj-y), $(sort $(lib-y) $(lib-m)))
# and add the directory to the list of dirs to descend into: $(subdir-y)
# o if we encounter foo/ in $(obj-m), remove it from $(obj-m)
# and add the directory to the list of dirs to descend into: $(subdir-m)
-
-# Determine modorder.
-# Unfortunately, we don't have information about ordering between -y
-# and -m subdirs. Just put -y's first.
-modorder := $(patsubst %/,%/modules.order, $(filter %/, $(obj-y)) $(obj-m:.o=.ko))
-
__subdir-y := $(patsubst %/,%,$(filter %/, $(obj-y)))
subdir-y += $(__subdir-y)
__subdir-m := $(patsubst %/,%,$(filter %/, $(obj-m)))
@@ -43,10 +38,9 @@ obj-y := $(patsubst %/, %/built-in.o, $(obj-y))
obj-m := $(filter-out %/, $(obj-m))
# Subdirectories we need to descend into
-
subdir-ym := $(sort $(subdir-y) $(subdir-m))
-# if $(foo-objs) exists, foo.o is a composite object
+# if $(foo-objs) or $(foo-y) or $(foo-m) exists, foo.o is a composite object
multi-used-y := $(sort $(foreach m,$(obj-y), $(if $(strip $($(m:.o=-objs)) $($(m:.o=-y))), $(m))))
multi-used-m := $(sort $(foreach m,$(obj-m), $(if $(strip $($(m:.o=-objs)) $($(m:.o=-y)) $($(m:.o=-m))), $(m))))
multi-used := $(multi-used-y) $(multi-used-m)
@@ -90,7 +84,6 @@ subdir-ym := $(addprefix $(obj)/,$(subdir-ym))
obj-dirs := $(addprefix $(obj)/,$(obj-dirs))
# These flags are needed for modversions and compiling, so we define them here
-# already
# $(modname_flags) #defines KBUILD_MODNAME as the name of the module it will
# end up in (or would, if it gets compiled in)
# Note: Files that end up in two or more modules are compiled without the
--
2.1.0
^ permalink raw reply related [flat|nested] 5+ messages in thread
* [PATCH] kbuild: comments cleanup in Makefile.lib
@ 2017-09-19 11:36 ` Cao jin
0 siblings, 0 replies; 5+ messages in thread
From: Cao jin @ 2017-09-19 11:36 UTC (permalink / raw)
To: linux-kbuild, linux-kernel; +Cc: yamada.masahiro, mmarek
It has:
1. Move comments close to what it want to comment.
2. Comments cleanup & improvement.
Signed-off-by: Cao jin <caoj.fnst@cn.fujitsu.com>
---
scripts/Makefile.lib | 19 ++++++-------------
1 file changed, 6 insertions(+), 13 deletions(-)
diff --git a/scripts/Makefile.lib b/scripts/Makefile.lib
index 58c05e5..7de9c08 100644
--- a/scripts/Makefile.lib
+++ b/scripts/Makefile.lib
@@ -4,8 +4,7 @@ ccflags-y += $(EXTRA_CFLAGS)
cppflags-y += $(EXTRA_CPPFLAGS)
ldflags-y += $(EXTRA_LDFLAGS)
-#
-# flags that take effect in sub directories
+# flags that take effect in current and sub directories
export KBUILD_SUBDIR_ASFLAGS := $(KBUILD_SUBDIR_ASFLAGS) $(subdir-asflags-y)
export KBUILD_SUBDIR_CCFLAGS := $(KBUILD_SUBDIR_CCFLAGS) $(subdir-ccflags-y)
@@ -14,14 +13,16 @@ export KBUILD_SUBDIR_CCFLAGS := $(KBUILD_SUBDIR_CCFLAGS) $(subdir-ccflags-y)
# When an object is listed to be built compiled-in and modular,
# only build the compiled-in version
-
obj-m := $(filter-out $(obj-y),$(obj-m))
# Libraries are always collected in one lib file.
# Filter out objects already built-in
-
lib-y := $(filter-out $(obj-y), $(sort $(lib-y) $(lib-m)))
+# Determine modorder.
+# Unfortunately, we don't have information about ordering between -y
+# and -m subdirs. Just put -y's first.
+modorder := $(patsubst %/,%/modules.order, $(filter %/, $(obj-y)) $(obj-m:.o=.ko))
# Handle objects in subdirs
# ---------------------------------------------------------------------------
@@ -29,12 +30,6 @@ lib-y := $(filter-out $(obj-y), $(sort $(lib-y) $(lib-m)))
# and add the directory to the list of dirs to descend into: $(subdir-y)
# o if we encounter foo/ in $(obj-m), remove it from $(obj-m)
# and add the directory to the list of dirs to descend into: $(subdir-m)
-
-# Determine modorder.
-# Unfortunately, we don't have information about ordering between -y
-# and -m subdirs. Just put -y's first.
-modorder := $(patsubst %/,%/modules.order, $(filter %/, $(obj-y)) $(obj-m:.o=.ko))
-
__subdir-y := $(patsubst %/,%,$(filter %/, $(obj-y)))
subdir-y += $(__subdir-y)
__subdir-m := $(patsubst %/,%,$(filter %/, $(obj-m)))
@@ -43,10 +38,9 @@ obj-y := $(patsubst %/, %/built-in.o, $(obj-y))
obj-m := $(filter-out %/, $(obj-m))
# Subdirectories we need to descend into
-
subdir-ym := $(sort $(subdir-y) $(subdir-m))
-# if $(foo-objs) exists, foo.o is a composite object
+# if $(foo-objs) or $(foo-y) or $(foo-m) exists, foo.o is a composite object
multi-used-y := $(sort $(foreach m,$(obj-y), $(if $(strip $($(m:.o=-objs)) $($(m:.o=-y))), $(m))))
multi-used-m := $(sort $(foreach m,$(obj-m), $(if $(strip $($(m:.o=-objs)) $($(m:.o=-y)) $($(m:.o=-m))), $(m))))
multi-used := $(multi-used-y) $(multi-used-m)
@@ -90,7 +84,6 @@ subdir-ym := $(addprefix $(obj)/,$(subdir-ym))
obj-dirs := $(addprefix $(obj)/,$(obj-dirs))
# These flags are needed for modversions and compiling, so we define them here
-# already
# $(modname_flags) #defines KBUILD_MODNAME as the name of the module it will
# end up in (or would, if it gets compiled in)
# Note: Files that end up in two or more modules are compiled without the
--
2.1.0
^ permalink raw reply related [flat|nested] 5+ messages in thread
* Re: [PATCH] kbuild: comments cleanup in Makefile.lib
2017-09-19 11:36 ` Cao jin
(?)
@ 2017-10-04 4:58 ` Masahiro Yamada
2017-10-09 3:43 ` Cao jin
-1 siblings, 1 reply; 5+ messages in thread
From: Masahiro Yamada @ 2017-10-04 4:58 UTC (permalink / raw)
To: Cao jin
Cc: Linux Kbuild mailing list, Linux Kernel Mailing List, Michal Marek
Hi Cao,
2017-09-19 20:36 GMT+09:00 Cao jin <caoj.fnst@cn.fujitsu.com>:
> It has:
> 1. Move comments close to what it want to comment.
> 2. Comments cleanup & improvement.
>
> Signed-off-by: Cao jin <caoj.fnst@cn.fujitsu.com>
> ---
> scripts/Makefile.lib | 19 ++++++-------------
> 1 file changed, 6 insertions(+), 13 deletions(-)
>
> diff --git a/scripts/Makefile.lib b/scripts/Makefile.lib
> index 58c05e5..7de9c08 100644
> --- a/scripts/Makefile.lib
> +++ b/scripts/Makefile.lib
> @@ -4,8 +4,7 @@ ccflags-y += $(EXTRA_CFLAGS)
> cppflags-y += $(EXTRA_CPPFLAGS)
> ldflags-y += $(EXTRA_LDFLAGS)
>
> -#
> -# flags that take effect in sub directories
> +# flags that take effect in current and sub directories
> export KBUILD_SUBDIR_ASFLAGS := $(KBUILD_SUBDIR_ASFLAGS) $(subdir-asflags-y)
> export KBUILD_SUBDIR_CCFLAGS := $(KBUILD_SUBDIR_CCFLAGS) $(subdir-ccflags-y)
>
> @@ -14,14 +13,16 @@ export KBUILD_SUBDIR_CCFLAGS := $(KBUILD_SUBDIR_CCFLAGS) $(subdir-ccflags-y)
>
> # When an object is listed to be built compiled-in and modular,
> # only build the compiled-in version
> -
> obj-m := $(filter-out $(obj-y),$(obj-m))
>
> # Libraries are always collected in one lib file.
> # Filter out objects already built-in
> -
> lib-y := $(filter-out $(obj-y), $(sort $(lib-y) $(lib-m)))
>
> +# Determine modorder.
> +# Unfortunately, we don't have information about ordering between -y
> +# and -m subdirs. Just put -y's first.
> +modorder := $(patsubst %/,%/modules.order, $(filter %/, $(obj-y)) $(obj-m:.o=.ko))
>
> # Handle objects in subdirs
> # ---------------------------------------------------------------------------
> @@ -29,12 +30,6 @@ lib-y := $(filter-out $(obj-y), $(sort $(lib-y) $(lib-m)))
> # and add the directory to the list of dirs to descend into: $(subdir-y)
> # o if we encounter foo/ in $(obj-m), remove it from $(obj-m)
> # and add the directory to the list of dirs to descend into: $(subdir-m)
> -
> -# Determine modorder.
> -# Unfortunately, we don't have information about ordering between -y
> -# and -m subdirs. Just put -y's first.
> -modorder := $(patsubst %/,%/modules.order, $(filter %/, $(obj-y)) $(obj-m:.o=.ko))
> -
> __subdir-y := $(patsubst %/,%,$(filter %/, $(obj-y)))
> subdir-y += $(__subdir-y)
> __subdir-m := $(patsubst %/,%,$(filter %/, $(obj-m)))
> @@ -43,10 +38,9 @@ obj-y := $(patsubst %/, %/built-in.o, $(obj-y))
> obj-m := $(filter-out %/, $(obj-m))
>
> # Subdirectories we need to descend into
> -
> subdir-ym := $(sort $(subdir-y) $(subdir-m))
>
> -# if $(foo-objs) exists, foo.o is a composite object
> +# if $(foo-objs) or $(foo-y) or $(foo-m) exists, foo.o is a composite object
Nit:
"if $(foo-objs), $(foo-y), or $(foo-m) exists" will be better.
> multi-used-y := $(sort $(foreach m,$(obj-y), $(if $(strip $($(m:.o=-objs)) $($(m:.o=-y))), $(m))))
> multi-used-m := $(sort $(foreach m,$(obj-m), $(if $(strip $($(m:.o=-objs)) $($(m:.o=-y)) $($(m:.o=-m))), $(m))))
> multi-used := $(multi-used-y) $(multi-used-m)
> @@ -90,7 +84,6 @@ subdir-ym := $(addprefix $(obj)/,$(subdir-ym))
> obj-dirs := $(addprefix $(obj)/,$(obj-dirs))
>
> # These flags are needed for modversions and compiling, so we define them here
> -# already
> # $(modname_flags) #defines KBUILD_MODNAME as the name of the module it will
I am not sure if "#defines" is intentional or not.
I think "#" is unnecessary.
--
Best Regards
Masahiro Yamada
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [PATCH] kbuild: comments cleanup in Makefile.lib
2017-10-04 4:58 ` Masahiro Yamada
@ 2017-10-09 3:43 ` Cao jin
0 siblings, 0 replies; 5+ messages in thread
From: Cao jin @ 2017-10-09 3:43 UTC (permalink / raw)
To: Masahiro Yamada
Cc: Linux Kbuild mailing list, Linux Kernel Mailing List, Michal Marek
Masahiro-san,
On 10/04/2017 12:58 PM, Masahiro Yamada wrote:
> Hi Cao,
>
>
> 2017-09-19 20:36 GMT+09:00 Cao jin <caoj.fnst@cn.fujitsu.com>:
>> It has:
>> 1. Move comments close to what it want to comment.
>> 2. Comments cleanup & improvement.
>>
>> Signed-off-by: Cao jin <caoj.fnst@cn.fujitsu.com>
>>
>> -# if $(foo-objs) exists, foo.o is a composite object
>> +# if $(foo-objs) or $(foo-y) or $(foo-m) exists, foo.o is a composite object
>
>
> Nit:
>
> "if $(foo-objs), $(foo-y), or $(foo-m) exists" will be better.
>
Yes, true.
>> multi-used-y := $(sort $(foreach m,$(obj-y), $(if $(strip $($(m:.o=-objs)) $($(m:.o=-y))), $(m))))
>> multi-used-m := $(sort $(foreach m,$(obj-m), $(if $(strip $($(m:.o=-objs)) $($(m:.o=-y)) $($(m:.o=-m))), $(m))))
>> multi-used := $(multi-used-y) $(multi-used-m)
>> @@ -90,7 +84,6 @@ subdir-ym := $(addprefix $(obj)/,$(subdir-ym))
>> obj-dirs := $(addprefix $(obj)/,$(obj-dirs))
>>
>> # These flags are needed for modversions and compiling, so we define them here
>> -# already
>> # $(modname_flags) #defines KBUILD_MODNAME as the name of the module it will
>
>
> I am not sure if "#defines" is intentional or not.
> I think "#" is unnecessary.
>
Yes, agree with you
--
Sincerely,
Cao jin
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [PATCH] kbuild: comments cleanup in Makefile.lib
2017-09-19 11:36 ` Cao jin
(?)
(?)
@ 2017-10-10 11:44 ` Masahiro Yamada
-1 siblings, 0 replies; 5+ messages in thread
From: Masahiro Yamada @ 2017-10-10 11:44 UTC (permalink / raw)
To: Cao jin
Cc: Linux Kbuild mailing list, Linux Kernel Mailing List, Michal Marek
2017-09-19 20:36 GMT+09:00 Cao jin <caoj.fnst@cn.fujitsu.com>:
> It has:
> 1. Move comments close to what it want to comment.
> 2. Comments cleanup & improvement.
>
> Signed-off-by: Cao jin <caoj.fnst@cn.fujitsu.com>
> ---
Applied to linux-kbuild/kbuild.
--
Best Regards
Masahiro Yamada
^ permalink raw reply [flat|nested] 5+ messages in thread
end of thread, other threads:[~2017-10-10 11:45 UTC | newest]
Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2017-09-19 11:36 [PATCH] kbuild: comments cleanup in Makefile.lib Cao jin
2017-09-19 11:36 ` Cao jin
2017-10-04 4:58 ` Masahiro Yamada
2017-10-09 3:43 ` Cao jin
2017-10-10 11:44 ` Masahiro Yamada
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.