* Re: Linux 2.4.17-pre5
2001-12-07 11:55 ` Stephan von Krawczynski
@ 2001-12-07 13:35 ` Keith Owens
2001-12-07 14:25 ` Stephan von Krawczynski
2001-12-07 16:39 ` Linux 2.4.17-pre5 / Have fun with make Stephan von Krawczynski
2 siblings, 0 replies; 8+ messages in thread
From: Keith Owens @ 2001-12-07 13:35 UTC (permalink / raw)
To: Stephan von Krawczynski; +Cc: m.luca, linux-kernel
On Fri, 7 Dec 2001 12:55:30 +0100,
Stephan von Krawczynski <skraw@ithnet.com> wrote:
>There is a problem: I made a (really small) patch to Config.in saying:
>
> int ' Maximum number of cards supported by HiSax' CONFIG_HISAX_MAX_CARDS 8
>
>If I check this in the source, it gives me CONFIG_HISAX_MAX_CARDS as (8)
Yuck! CML1 outputs integers as #define CONFIG_foo (number) instead of
just number. CML2 does not do that, I was looking at CML2. Add this
to drivers/isdn/Makefile
CFLAGS_foo.o += -DMAX_CARDS=$(subst (,,$(subst ),,$(CONFIG_HISAX_MAX_CARDS)))
In foo.c, use MAX_CARDS instead of CONFIG_HISAX_MAX_CARDS. Change foo
to the name of the object that you are working on. When you build, it
should say -DMAX_CARDS=8.
^ permalink raw reply [flat|nested] 8+ messages in thread
* Re: Linux 2.4.17-pre5
2001-12-07 11:55 ` Stephan von Krawczynski
2001-12-07 13:35 ` Keith Owens
@ 2001-12-07 14:25 ` Stephan von Krawczynski
2001-12-07 16:39 ` Linux 2.4.17-pre5 / Have fun with make Stephan von Krawczynski
2 siblings, 0 replies; 8+ messages in thread
From: Stephan von Krawczynski @ 2001-12-07 14:25 UTC (permalink / raw)
To: Keith Owens; +Cc: m.luca, linux-kernel
On Sat, 08 Dec 2001 00:35:14 +1100
Keith Owens <kaos@ocs.com.au> wrote:
> On Fri, 7 Dec 2001 12:55:30 +0100,
> Stephan von Krawczynski <skraw@ithnet.com> wrote:
> >There is a problem: I made a (really small) patch to Config.in saying:
> >
> > int ' Maximum number of cards supported by HiSax'
CONFIG_HISAX_MAX_CARDS 8
> >
> >If I check this in the source, it gives me CONFIG_HISAX_MAX_CARDS as (8)
>
> Yuck! CML1 outputs integers as #define CONFIG_foo (number) instead of
> just number. CML2 does not do that, I was looking at CML2. Add this
> to drivers/isdn/Makefile
>
> CFLAGS_foo.o += -DMAX_CARDS=$(subst (,,$(subst ),,$(CONFIG_HISAX_MAX_CARDS)))
>
> In foo.c, use MAX_CARDS instead of CONFIG_HISAX_MAX_CARDS. Change foo
> to the name of the object that you are working on. When you build, it
> should say -DMAX_CARDS=8.
Thanks for this hint, but it is not all that easy. Problem is the definition is
needed for _all_ files in the hisax-subtree, to be more precise for all
currently including hisax.h. I am not very fond of the idea to add additional
conditions to the availability of the HISAX_MAX_CARDS symbol, especially if
they are located in the Makefile.
Anyway, how would you generate this additional -D for all files inside a
certain directory? Obviously the stuff should at least be put inside the
hisax-Makefile, and not one layer above in isdn-Makefile.
I tried "CFLAGS += ..." but that does not work.
Thanks for help,
Stephan
^ permalink raw reply [flat|nested] 8+ messages in thread
* Re: Linux 2.4.17-pre5 / Have fun with make
2001-12-07 11:55 ` Stephan von Krawczynski
2001-12-07 13:35 ` Keith Owens
2001-12-07 14:25 ` Stephan von Krawczynski
@ 2001-12-07 16:39 ` Stephan von Krawczynski
2001-12-07 22:21 ` Keith Owens
2 siblings, 1 reply; 8+ messages in thread
From: Stephan von Krawczynski @ 2001-12-07 16:39 UTC (permalink / raw)
To: Keith Owens; +Cc: m.luca, linux-kernel, alan
On Sat, 08 Dec 2001 00:35:14 +1100
Keith Owens <kaos@ocs.com.au> wrote:
>
> CFLAGS_foo.o += -DMAX_CARDS=$(subst (,,$(subst ),,$(CONFIG_HISAX_MAX_CARDS)))
>
> In foo.c, use MAX_CARDS instead of CONFIG_HISAX_MAX_CARDS. Change foo
> to the name of the object that you are working on. When you build, it
> should say -DMAX_CARDS=8.
Keith, it is getting weird right now. Your above suggestion does not work, it
does not even execute, because the braces obviously confuse it.
Now I come up with a _working_ solution, but to be honest, I don't dare to give
away the patch, because it looks like this:
EXTRA_CFLAGS += -DHISAX_MAX_CARDS=$(subst ,,$(CONFIG_HISAX_MAX_CARDS))
You read it right, no substition is going on. BUT my test shows this executes
to e.g. "8" and not "(8)". This is what I wanted, but it looks like bs.
Alan would you please tell me if this looks like clean make usage to you, or
how you would drop "()" around integer definitions coming from CONFIG. Warning:
if you think this is ok, I will send the patch ;-) I only want a confirmation
from "Mr. Clean Code" ;-))
Regards,
Stephan
^ permalink raw reply [flat|nested] 8+ messages in thread
* Re: Linux 2.4.17-pre5 / Have fun with make
2001-12-07 16:39 ` Linux 2.4.17-pre5 / Have fun with make Stephan von Krawczynski
@ 2001-12-07 22:21 ` Keith Owens
0 siblings, 0 replies; 8+ messages in thread
From: Keith Owens @ 2001-12-07 22:21 UTC (permalink / raw)
To: Stephan von Krawczynski; +Cc: m.luca, linux-kernel, alan
On Fri, 7 Dec 2001 17:39:54 +0100,
Stephan von Krawczynski <skraw@ithnet.com> wrote:
>On Sat, 08 Dec 2001 00:35:14 +1100
>Keith Owens <kaos@ocs.com.au> wrote:
>>
>> CFLAGS_foo.o += -DMAX_CARDS=$(subst (,,$(subst ),,$(CONFIG_HISAX_MAX_CARDS)))
>>
>> In foo.c, use MAX_CARDS instead of CONFIG_HISAX_MAX_CARDS. Change foo
>> to the name of the object that you are working on. When you build, it
>> should say -DMAX_CARDS=8.
>
>Keith, it is getting weird right now. Your above suggestion does not work, it
>does not even execute, because the braces obviously confuse it.
That's what I get for typing code late at night and not testing it.
The correct implementation of that line is probably
lp:=(
rp:=)
CFLAGS_foo.o += -DMAX_CARDS=$(subst $(lp),,$(subst $(rp),,$(CONFIG_HISAX_MAX_CARDS)))
But as you found, you don't need that anyway.
>Now I come up with a _working_ solution, but to be honest, I don't dare to give
>away the patch, because it looks like this:
>
>EXTRA_CFLAGS += -DHISAX_MAX_CARDS=$(subst ,,$(CONFIG_HISAX_MAX_CARDS))
EXTRA_CFLAGS += -DHISAX_MAX_CARDS=$(CONFIG_HISAX_MAX_CARDS)
will work just as well. The reason that you do not get '(8)' that way
is because CML1 generates inconsistent output. In .config the line
says CONFIG_HISAX_MAX_CARDS=8, in include/linux/autoconf.h it says
#define CONFIG_HISAX_MAX_CARDS (8). The makefiles use .config, the
source code uses autoconf.h.
Inconsistency of inconsistencies, saith the preacher; all is inconsistency.
^ permalink raw reply [flat|nested] 8+ messages in thread