On Wed, 17 Aug 2016 11:56:33 +0200 Sam Ravnborg <sam@xxxxxxxxxxxx> wrote: > > diff --git a/Makefile b/Makefile > > index 1d26fdb..20d3bfd 100644 > > --- a/Makefile > > +++ b/Makefile > > @@ -954,8 +954,14 @@ include/generated/autoksyms.h: FORCE > > cmd_link-vmlinux = $(CONFIG_SHELL) $< $(LD) $(LDFLAGS) $(LDFLAGS_vmlinux) > > quiet_cmd_link-vmlinux = LINK $@ > > > > +# Optional arch pass after final link > > +ARCH_POSTLINK := $(wildcard $(srctree)/arch/$(SRCARCH)/Makefile.postlink) > > + cmd_postlink-vmlinux = \ > > + $(if $(ARCH_POSTLINK), $(MAKE) -f $(ARCH_POSTLINK) $@, true) > > + > > vmlinux: scripts/link-vmlinux.sh vmlinux_prereq $(vmlinux-deps) FORCE > > +$(call if_changed,link-vmlinux) > > + +$(call if_changed,postlink-vmlinux) > > > > # Build samples along the rest of the kernel > > ifdef CONFIG_SAMPLES > > @@ -1279,6 +1285,7 @@ $(clean-dirs): > > > > vmlinuxclean: > > $(Q)$(CONFIG_SHELL) $(srctree)/scripts/link-vmlinux.sh clean > > + $(Q)$(if $(ARCH_POSTLINK), $(MAKE) -f $(ARCH_POSTLINK) clean) > > > > clean: archclean vmlinuxclean > > > Another option would be to embed the logic in the link-vmlinux shell script. > It is much simpler for normal humans to read and understand shell scripts, > and it would be simpler too. I did that in the previous patch. I struggle with Makefiles too, but considering that we need the same recipe for modules, I thought just doing it the same for both was a bit nicer. But I really can go either way on it so whatever maintainers prefer I can respin. Thanks, Nick -- To unsubscribe from this list: send the line "unsubscribe linux-kbuild" in the body of a message to majordomo@xxxxxxxxxxxxxxx More majordomo info at http://vger.kernel.org/majordomo-info.html