[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <CAK7LNAQsw2u4AYKg74GYaz3n4gvbTdF3dn9OUYWxCGXGjP5sQA@mail.gmail.com>
Date: Fri, 2 Sep 2022 18:41:01 +0900
From: Masahiro Yamada <masahiroy@...nel.org>
To: Linux Kbuild mailing list <linux-kbuild@...r.kernel.org>
Cc: Linux Kernel Mailing List <linux-kernel@...r.kernel.org>,
linux-arch <linux-arch@...r.kernel.org>
Subject: Re: [PATCH 05/15] kbuild: build init/built-in.a just once
On Sun, Aug 28, 2022 at 11:40 AM Masahiro Yamada <masahiroy@...nel.org> wrote:
> --- a/init/Makefile
> +++ b/init/Makefile
> @@ -19,20 +19,47 @@ mounts-y := do_mounts.o
> mounts-$(CONFIG_BLK_DEV_RAM) += do_mounts_rd.o
> mounts-$(CONFIG_BLK_DEV_INITRD) += do_mounts_initrd.o
>
> -# dependencies on generated files need to be listed explicitly
> -$(obj)/version.o: include/generated/compile.h
> +#
> +# UTS_VERSION
> +#
> +
> +smp-flag-$(CONFIG_SMP) := SMP
> +preempt-flag-$(CONFIG_PREEMPT_BUILD) := PREEMPT
> +preempt-flag-$(CONFIG_PREEMPT_DYNAMIC) := PREEMPT_DYNAMIC
> +preempt-flag-$(CONFIG_PREEMPT_RT) := PREEMPT_RT
> +
> +build-version = $(or $(KBUILD_BUILD_VERSION), $(build-version-auto))
> +build-timestamp = $(or $(KBUILD_BUILD_TIMESTAMP), $(build-timestamp-auto))
> +
> +# Maximum length of UTS_VERSION is 64 chars
> +filechk_uts_version = \
> + utsver=$$(echo '$(pound)'"$(build-version)" $(smp-flag-y) $(preempt-flag-y) "$(build-timestamp)" | cut -b -64); \
> + echo '$(pound)'define UTS_VERSION \""$${utsver}"\"
> +
> +#
> +# Build version.c with temporary UTS_VERSION
> +#
> +
> +$(obj)/utsversion-tmp.h: FORCE
> + $(call filechk,uts_version)
I missed to clean up init/utsversion-tmp.h.
I patched like follows, and also added it to init/.gitignore.
diff --git a/init/Makefile b/init/Makefile
index 63f53d210cad..ba90eb817185 100644
--- a/init/Makefile
+++ b/init/Makefile
@@ -43,6 +43,8 @@ filechk_uts_version = \
$(obj)/utsversion-tmp.h: FORCE
$(call filechk,uts_version)
+clean-files += utsversion-tmp.h
+
$(obj)/version.o: include/generated/compile.h $(obj)/utsversion-tmp.h
CFLAGS_version.o := -include $(obj)/utsversion-tmp.h
--
Best Regards
Masahiro Yamada
Powered by blists - more mailing lists