Message ID | CAK7LNATmjTi4Odp5AfbVHCemn7S_tB9nKvgNOf5sp8BiVJma7Q@mail.gmail.com (mailing list archive) |
---|---|
State | New, archived |
Headers | show |
> > > +macros: $(obj)/macros.s > > + @: > > If you add a phony target, it should be added to 'PHONY'. Or this part: > +archmacros: > + $(Q)$(MAKE) $(build)=arch/x86/kernel macros could be modified to specify the exact filename so this indirection is not needed. PS. Only one file posted to kbuild, so impossible to review as context is missing. Sam -- To unsubscribe from this list: send the line "unsubscribe linux-kbuild" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html
Thanks for your comment! I am certainly Makefile-challenged, so your help is highly appreciated. Please see my responses/questions inline. at 10:43 AM, Masahiro Yamada <yamada.masahiro@socionext.com> wrote: > 2018-06-12 20:50 GMT+09:00 Nadav Amit <namit@vmware.com>: >> Using macros for inline assembly improves both readability and >> compilation decisions that are distorted by big assembly blocks that use >> alternative sections. Compile macros.S and use it to assemble all C >> files. Currently, only x86 will use it. >> >> Cc: Masahiro Yamada <yamada.masahiro@socionext.com> >> Cc: Michal Marek <michal.lkml@markovi.net> >> Cc: Thomas Gleixner <tglx@linutronix.de> >> Cc: Ingo Molnar <mingo@redhat.com> >> Cc: "H. Peter Anvin" <hpa@zytor.com> >> Cc: x86@kernel.org >> Cc: linux-kbuild@vger.kernel.org >> >> Signed-off-by: Nadav Amit <namit@vmware.com> > > > I have not fully understood this series yet. > > I do not have enough skill in x86 architecture, > but just some comments from the build system point of view. > > > > I guess this will probably break the parallel building. > > Kbuild can build 'prepare' and 'scripts' simultaneously. > > > I locally modified the following line: > > > diff --git a/Makefile b/Makefile > index 2dea909440..6ad484a 100644 > --- a/Makefile > +++ b/Makefile > @@ -1030,7 +1030,7 @@ $(sort $(vmlinux-deps)): $(vmlinux-dirs) ; > # Error messages still appears in the original language > > PHONY += $(vmlinux-dirs) > -$(vmlinux-dirs): prepare scripts > +$(vmlinux-dirs): scripts prepare > $(Q)$(MAKE) $(build)=$@ need-builtin=1 > > define filechk_kernel.release > > > > masahiro@grover:~/workspace/linux-kbuild$ make defconfig > HOSTCC scripts/basic/fixdep > HOSTCC scripts/kconfig/conf.o > YACC scripts/kconfig/zconf.tab.c > LEX scripts/kconfig/zconf.lex.c > HOSTCC scripts/kconfig/zconf.tab.o > HOSTLD scripts/kconfig/conf > *** Default configuration is based on 'x86_64_defconfig' > # > # configuration written to .config > # > masahiro@grover:~/workspace/linux-kbuild$ make all > scripts/kconfig/conf --syncconfig Kconfig > WRAP arch/x86/include/generated/uapi/asm/bpf_perf_event.h > WRAP arch/x86/include/generated/uapi/asm/poll.h > WRAP arch/x86/include/generated/asm/dma-contiguous.h > WRAP arch/x86/include/generated/asm/early_ioremap.h > WRAP arch/x86/include/generated/asm/mcs_spinlock.h > WRAP arch/x86/include/generated/asm/mm-arch-hooks.h > CC scripts/mod/empty.o > Assembler messages: > Error: can't open arch/x86/kernel/macros.s for reading: No such file > or directory > make[2]: *** [scripts/Makefile.build:318: scripts/mod/empty.o] Error 1 > make[1]: *** [scripts/Makefile.build:558: scripts/mod] Error 2 > make: *** [Makefile:1050: scripts] Error 2 You are right. I tried to filter out the use of the switch (exported as ASM_MACRO_FLAGS) for empty.o. Any suggestions on how to do it properly? > Are you planning to support for all architectures, or x86-specific? Not right now. But I think that other architectures will also prefer to separate the inline assembly chunks in a similar manner, for better compilation, easier readability, and better code maintainability. Thanks again, Nadav -- To unsubscribe from this list: send the line "unsubscribe linux-kbuild" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html
2018-06-14 5:36 GMT+09:00 Sam Ravnborg <sam@ravnborg.org>: >> >> > +macros: $(obj)/macros.s >> > + @: >> >> If you add a phony target, it should be added to 'PHONY'. > > Or this part: >> +archmacros: >> + $(Q)$(MAKE) $(build)=arch/x86/kernel macros > > could be modified to specify the exact filename so this indirection is not needed. Yes, it could work. Actually, two styles co-exist in arch/x86/Makefile. (archprepare vs archscripts)
diff --git a/Makefile b/Makefile index 2dea909440..6ad484a 100644 --- a/Makefile +++ b/Makefile @@ -1030,7 +1030,7 @@ $(sort $(vmlinux-deps)): $(vmlinux-dirs) ; # Error messages still appears in the original language PHONY += $(vmlinux-dirs) -$(vmlinux-dirs): prepare scripts +$(vmlinux-dirs): scripts prepare $(Q)$(MAKE) $(build)=$@ need-builtin=1 define filechk_kernel.release