Message ID | 20130709054341.14007.99736.sendpatchset@w520 (mailing list archive) |
---|---|
State | New, archived |
Headers | show |
On Tuesday 09 July 2013, Magnus Damm wrote:
> +obj-y += $(clk-y$(CONFIG_COMMON_CLK))
It took me a bit to understand the Makefile trick you are using here.
I assume other readers will have the same problem. How about just
doing
+ifndef CONFIG_COMMON_CLK
obj-$(CONFIG_ARCH_SH7372) += setup-sh7372.o intc-sh7372.o
obj-$(CONFIG_ARCH_SH73A0) += setup-sh73a0.o intc-sh73a0.o
obj-$(CONFIG_ARCH_R8A73A4) += setup-r8a73a4.o
obj-$(CONFIG_ARCH_R8A7740) += setup-r8a7740.o intc-r8a7740.o
obj-$(CONFIG_ARCH_R8A7778) += setup-r8a7778.o
obj-$(CONFIG_ARCH_R8A7779) += setup-r8a7779.o intc-r8a7779.o
obj-$(CONFIG_ARCH_R8A7790) += setup-r8a7790.o
obj-$(CONFIG_ARCH_EMEV2) += setup-emev2.o
+endif
Arnd
Hi Arnd and Magnus, On Tuesday 09 July 2013 09:43:07 Arnd Bergmann wrote: > On Tuesday 09 July 2013, Magnus Damm wrote: > > +obj-y += $(clk-y$(CONFIG_COMMON_CLK)) > > It took me a bit to understand the Makefile trick you are using here. > I assume other readers will have the same problem. How about just > doing > > +ifndef CONFIG_COMMON_CLK > obj-$(CONFIG_ARCH_SH7372) += setup-sh7372.o intc-sh7372.o > obj-$(CONFIG_ARCH_SH73A0) += setup-sh73a0.o intc-sh73a0.o > obj-$(CONFIG_ARCH_R8A73A4) += setup-r8a73a4.o > obj-$(CONFIG_ARCH_R8A7740) += setup-r8a7740.o intc-r8a7740.o > obj-$(CONFIG_ARCH_R8A7778) += setup-r8a7778.o > obj-$(CONFIG_ARCH_R8A7779) += setup-r8a7779.o intc-r8a7779.o > obj-$(CONFIG_ARCH_R8A7790) += setup-r8a7790.o > obj-$(CONFIG_ARCH_EMEV2) += setup-emev2.o > +endif I was about to mention the same, so I think that would be a good idea.
Hi Laurent and Arnd, On Tue, Jul 9, 2013 at 4:45 PM, Laurent Pinchart <laurent.pinchart@ideasonboard.com> wrote: > Hi Arnd and Magnus, > > On Tuesday 09 July 2013 09:43:07 Arnd Bergmann wrote: >> On Tuesday 09 July 2013, Magnus Damm wrote: >> > +obj-y += $(clk-y$(CONFIG_COMMON_CLK)) >> >> It took me a bit to understand the Makefile trick you are using here. >> I assume other readers will have the same problem. How about just >> doing >> >> +ifndef CONFIG_COMMON_CLK >> obj-$(CONFIG_ARCH_SH7372) += setup-sh7372.o intc-sh7372.o >> obj-$(CONFIG_ARCH_SH73A0) += setup-sh73a0.o intc-sh73a0.o >> obj-$(CONFIG_ARCH_R8A73A4) += setup-r8a73a4.o >> obj-$(CONFIG_ARCH_R8A7740) += setup-r8a7740.o intc-r8a7740.o >> obj-$(CONFIG_ARCH_R8A7778) += setup-r8a7778.o >> obj-$(CONFIG_ARCH_R8A7779) += setup-r8a7779.o intc-r8a7779.o >> obj-$(CONFIG_ARCH_R8A7790) += setup-r8a7790.o >> obj-$(CONFIG_ARCH_EMEV2) += setup-emev2.o >> +endif > > I was about to mention the same, so I think that would be a good idea. Sure, that may be a more common way to handle this. =) To be clear, I assume you wanted that ifndef to cover the clock-xxx.c files instead of setup-xxx.c. So I will do that in next version. Thanks for your comments! Cheers, / magnus
On Tuesday 09 July 2013, Magnus Damm wrote: > >> > >> +ifndef CONFIG_COMMON_CLK > >> obj-$(CONFIG_ARCH_SH7372) += setup-sh7372.o intc-sh7372.o > >> obj-$(CONFIG_ARCH_SH73A0) += setup-sh73a0.o intc-sh73a0.o > >> obj-$(CONFIG_ARCH_R8A73A4) += setup-r8a73a4.o > >> obj-$(CONFIG_ARCH_R8A7740) += setup-r8a7740.o intc-r8a7740.o > >> obj-$(CONFIG_ARCH_R8A7778) += setup-r8a7778.o > >> obj-$(CONFIG_ARCH_R8A7779) += setup-r8a7779.o intc-r8a7779.o > >> obj-$(CONFIG_ARCH_R8A7790) += setup-r8a7790.o > >> obj-$(CONFIG_ARCH_EMEV2) += setup-emev2.o > >> +endif > > > > I was about to mention the same, so I think that would be a good idea. > > Sure, that may be a more common way to handle this. =) > > To be clear, I assume you wanted that ifndef to cover the clock-xxx.c > files instead of setup-xxx.c. So I will do that in next version. > Yes, that's right, sorry for screwing up the example. Arnd
--- 0002/arch/arm/mach-shmobile/Makefile +++ work/arch/arm/mach-shmobile/Makefile 2013-07-09 12:21:29.000000000 +0900 @@ -3,17 +3,28 @@ # # Common objects -obj-y := timer.o console.o clock.o +obj-y := timer.o console.o # CPU objects -obj-$(CONFIG_ARCH_SH7372) += setup-sh7372.o clock-sh7372.o intc-sh7372.o -obj-$(CONFIG_ARCH_SH73A0) += setup-sh73a0.o clock-sh73a0.o intc-sh73a0.o -obj-$(CONFIG_ARCH_R8A73A4) += setup-r8a73a4.o clock-r8a73a4.o -obj-$(CONFIG_ARCH_R8A7740) += setup-r8a7740.o clock-r8a7740.o intc-r8a7740.o -obj-$(CONFIG_ARCH_R8A7778) += setup-r8a7778.o clock-r8a7778.o -obj-$(CONFIG_ARCH_R8A7779) += setup-r8a7779.o clock-r8a7779.o intc-r8a7779.o -obj-$(CONFIG_ARCH_R8A7790) += setup-r8a7790.o clock-r8a7790.o -obj-$(CONFIG_ARCH_EMEV2) += setup-emev2.o clock-emev2.o +obj-$(CONFIG_ARCH_SH7372) += setup-sh7372.o intc-sh7372.o +obj-$(CONFIG_ARCH_SH73A0) += setup-sh73a0.o intc-sh73a0.o +obj-$(CONFIG_ARCH_R8A73A4) += setup-r8a73a4.o +obj-$(CONFIG_ARCH_R8A7740) += setup-r8a7740.o intc-r8a7740.o +obj-$(CONFIG_ARCH_R8A7778) += setup-r8a7778.o +obj-$(CONFIG_ARCH_R8A7779) += setup-r8a7779.o intc-r8a7779.o +obj-$(CONFIG_ARCH_R8A7790) += setup-r8a7790.o +obj-$(CONFIG_ARCH_EMEV2) += setup-emev2.o + +# Clock objects +clk-y := clock.o +clk-$(CONFIG_ARCH_SH7372) += clock-sh7372.o +clk-$(CONFIG_ARCH_SH73A0) += clock-sh73a0.o +clk-$(CONFIG_ARCH_R8A73A4) += clock-r8a73a4.o +clk-$(CONFIG_ARCH_R8A7740) += clock-r8a7740.o +clk-$(CONFIG_ARCH_R8A7778) += clock-r8a7778.o +clk-$(CONFIG_ARCH_R8A7779) += clock-r8a7779.o +clk-$(CONFIG_ARCH_R8A7790) += clock-r8a7790.o +clk-$(CONFIG_ARCH_EMEV2) += clock-emev2.o # SMP objects smp-y := platsmp.o headsmp.o @@ -53,3 +64,4 @@ obj-$(CONFIG_MACH_KZM9G_REFERENCE) += bo # Framework support obj-$(CONFIG_SMP) += $(smp-y) +obj-y += $(clk-y$(CONFIG_COMMON_CLK))