Re: [kbuild-devel] Query regarding extra-y targets

2004-01-22 Thread Hariprasad Nellitheertha
Hi Sam,

Thanks much for your help. I think I'll go for solution 2 - option 1.

Regards, Hari

On Wed, Jan 21, 2004 at 10:46:28PM +0100, Sam Ravnborg wrote:
 On Wed, Jan 21, 2004 at 12:13:06PM +0530, Hariprasad Nellitheertha wrote:
  The problem with this is that the target is not built when we build LKCD
  as a module, as CONFIG_CRASH_DUMP is set to m. I read the kbuild 
  documentation and there does not seem to be anything equivalent to 
  extra-y when it comes to modules.
  
  In order to overcome the problem, I used an ifdef-endif wrapper as below.
  
  ifdef CONFIG_CRASH_DUMP
  extra-y:= kerntypes.o
  endif
 
 Two type of solutions exits.
 You can always define a symbol in your Kconfig file with the bool type
 and use that in the Makefile.
 
 So it looks like:
 extra-$(CONFIG_KERN_TYPES)+= kerntypes.o
 
 Note: I prefer '+=', which allow you to just add an extra line
 anywhere in the file.
 
 The second type of solution is simply to replace the m with an y.
 Several syntaxes are supported:
 extra-$(patsubst,m,y,$(CONFIG_CRASH_DUMP))+= kerntypes.o
 extra-$(subst,m,y,$(CONFIG_CRASH_DUMP))   += kerntypes.o
 extra-$(CONFIG_CRASH_DUMP:m=y)+= kerntypes.o
 
 The first one is the most widely used construction. So if you
 go for solution 2, then use patsubst.
 
   Sam

-- 
Hariprasad Nellitheertha
Linux Technology Center
India Software Labs
IBM India, Bangalore


---
The SF.Net email is sponsored by EclipseCon 2004
Premiere Conference on Open Tools Development and Integration
See the breadth of Eclipse activity. February 3-5 in Anaheim, CA.
http://www.eclipsecon.org/osdn
___
kbuild-devel mailing list
[EMAIL PROTECTED]
https://lists.sourceforge.net/lists/listinfo/kbuild-devel


Re: [kbuild-devel] Query regarding extra-y targets

2004-01-21 Thread Sam Ravnborg
On Wed, Jan 21, 2004 at 12:13:06PM +0530, Hariprasad Nellitheertha wrote:
 The problem with this is that the target is not built when we build LKCD
 as a module, as CONFIG_CRASH_DUMP is set to m. I read the kbuild 
 documentation and there does not seem to be anything equivalent to 
 extra-y when it comes to modules.
 
 In order to overcome the problem, I used an ifdef-endif wrapper as below.
 
 ifdef CONFIG_CRASH_DUMP
 extra-y  := kerntypes.o
 endif

Two type of solutions exits.
You can always define a symbol in your Kconfig file with the bool type
and use that in the Makefile.

So it looks like:
extra-$(CONFIG_KERN_TYPES)  += kerntypes.o

Note: I prefer '+=', which allow you to just add an extra line
anywhere in the file.

The second type of solution is simply to replace the m with an y.
Several syntaxes are supported:
extra-$(patsubst,m,y,$(CONFIG_CRASH_DUMP))  += kerntypes.o
extra-$(subst,m,y,$(CONFIG_CRASH_DUMP)) += kerntypes.o
extra-$(CONFIG_CRASH_DUMP:m=y)  += kerntypes.o

The first one is the most widely used construction. So if you
go for solution 2, then use patsubst.

Sam


---
The SF.Net email is sponsored by EclipseCon 2004
Premiere Conference on Open Tools Development and Integration
See the breadth of Eclipse activity. February 3-5 in Anaheim, CA.
http://www.eclipsecon.org/osdn
___
kbuild-devel mailing list
[EMAIL PROTECTED]
https://lists.sourceforge.net/lists/listinfo/kbuild-devel


[kbuild-devel] Query regarding extra-y targets

2004-01-20 Thread Hariprasad Nellitheertha
Hello All,

I work on the LKCD project and am facing a problem with extra-y. 

LKCD requires an additional target (kerntypes.o) built every time we 
build LKCD. Our patch adds this line into init/Makefile

extra-$(CONFIG_CRASH_DUMP) := kerntypes.o

The problem with this is that the target is not built when we build LKCD
as a module, as CONFIG_CRASH_DUMP is set to m. I read the kbuild 
documentation and there does not seem to be anything equivalent to 
extra-y when it comes to modules.

In order to overcome the problem, I used an ifdef-endif wrapper as below.

ifdef CONFIG_CRASH_DUMP
extra-y:= kerntypes.o
endif

This works fine but I believe the use of ifdefs in Makefiles is frowned 
upon.

Could someone kindly let me know a better way to handle this problem.

Thanks in advance!

-- 
Regards, Hari
Hariprasad Nellitheertha
Linux Technology Center
India Software Labs
IBM India, Bangalore


---
The SF.Net email is sponsored by EclipseCon 2004
Premiere Conference on Open Tools Development and Integration
See the breadth of Eclipse activity. February 3-5 in Anaheim, CA.
http://www.eclipsecon.org/osdn
___
kbuild-devel mailing list
[EMAIL PROTECTED]
https://lists.sourceforge.net/lists/listinfo/kbuild-devel