Re: Usage of files for config

2008-10-30 Thread Dag-Erling Smørgrav
Srinivas [EMAIL PROTECTED] writes:
 I would like to know the usage of files and files.[arch] in sys/conf.

files and options are used to determine which source files should be
included and which preprocessor macros should be defined according to
the device and option lines in the kernel config.

However, as a beginner of freebsd kernel, I would recommend that you
spend your time reading (and writing or modifying) source code, not
trying to understand the Makefiles.

DES
-- 
Dag-Erling Smørgrav - [EMAIL PROTECTED]
___
freebsd-hackers@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-hackers
To unsubscribe, send any mail to [EMAIL PROTECTED]


Re: Usage of files for config

2008-10-28 Thread Eygene Ryabinkin
Srinivas, good day.

Tue, Oct 28, 2008 at 03:52:35AM +0530, Srinivas wrote:
 I would like to know the usage of files and files.[arch] in sys/conf.
 Basically, I didnt get the advantage of having a common file for
 compilation(like files) rather than an individual Makefile in each
 subdirectory.

'files' and 'files.$ARCH' are the input directives for the config(8)
utility.  Makefile is produced with the help of these files.  The
rationale for having 'files' and 'files.$ARCH' is simple: there are
platform-specific directives and common directives.

 
 I have read makefile(of mkmakefile.c in config). What is the usage of
 standard, optional and mandatory and why it is followed by
 device.

Read comments from 'mkmakefile.c':
-
/*
 * If an entry is marked mandatory, config will abort if it's
 * not called by a configuration line in the config file.  Apart
 * from this, the device is handled like one marked optional.
 */
-

 What are .m files? What are they used for?

They define module interfaces and are processed by the AWK script
/sys/tools/makeobjops.awk.  The output will be source and header files,
named m-file-name.c and m-file-name.h.  You can do 'ls *_if.[ch]' in
the kernel build directory and examine some files to get a hint on
what's going on.  M-files are processed with the help of
/sys/conf/kern.post.mk and /sys/conf/kmod.mk.

 Why are some of the rules in the generated makefile *.ln like scsi_all.ln?

These files are lint(1)'ed: see /sys/conf/kern.post.mk, search for
LNFILES.

 What is ${NORMAL_LINT} and ${NORMAL_C} in the generated makefile mean?

'make -V NORMAL_LINT' and 'make -V NORMAL_C' invoked from the kernel
compilation directory should tell you about the values of these
variables.  They are defined by /sys/conf/kern.pre.mk, so you can
examine it as well.
-- 
Eygene
 ____   _.--.   #
 \`.|\.....-'`   `-._.-'_.-'`   #  Remember that it is hard
 /  ' ` ,   __.--'  #  to read the on-line manual   
 )/' _/ \   `-_,   /#  while single-stepping the kernel.
 `-' `\_  ,_.-;_.-\_ ',  fsc/as   #
 _.-'_./   {_.'   ; /   #-- FreeBSD Developers handbook 
{_.-``-' {_/#


pgpBOoMn3hgfL.pgp
Description: PGP signature


Re: Usage of files for config

2008-10-28 Thread Srinivas
Eygene, Your reply is very helpful. Thank you very much.

On Tue, Oct 28, 2008 at 1:16 PM, Eygene Ryabinkin [EMAIL PROTECTED] wrote:
 I would like to know the usage of files and files.[arch] in sys/conf.
 Basically, I didnt get the advantage of having a common file for
 compilation(like files) rather than an individual Makefile in each
 subdirectory.

 'files' and 'files.$ARCH' are the input directives for the config(8)
 utility.  Makefile is produced with the help of these files.  The
 rationale for having 'files' and 'files.$ARCH' is simple: there are
 platform-specific directives and common directives.

Still, I didnt get the purpose of having a common files file for the
kernel to generate Makefile.

I am trying to understand the advantage of this approach with the
conventional way of having a makefile for each sub-directory(device or
module) and recurse from top of kernel with a configuration file
dictating what features need to be included in the kernel.

Thanks,
Srinivas
___
freebsd-hackers@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-hackers
To unsubscribe, send any mail to [EMAIL PROTECTED]


Re: Usage of files for config

2008-10-28 Thread John Baldwin
On Tuesday 28 October 2008 05:31:36 am Srinivas wrote:
 Eygene, Your reply is very helpful. Thank you very much.
 
 On Tue, Oct 28, 2008 at 1:16 PM, Eygene Ryabinkin [EMAIL PROTECTED] 
wrote:
  I would like to know the usage of files and files.[arch] in sys/conf.
  Basically, I didnt get the advantage of having a common file for
  compilation(like files) rather than an individual Makefile in each
  subdirectory.
 
  'files' and 'files.$ARCH' are the input directives for the config(8)
  utility.  Makefile is produced with the help of these files.  The
  rationale for having 'files' and 'files.$ARCH' is simple: there are
  platform-specific directives and common directives.
 
 Still, I didnt get the purpose of having a common files file for the
 kernel to generate Makefile.
 
 I am trying to understand the advantage of this approach with the
 conventional way of having a makefile for each sub-directory(device or
 module) and recurse from top of kernel with a configuration file
 dictating what features need to be included in the kernel.

The usage of config goes back to BSD itself prior to FreeBSD for one.  
However, I find the 'files' format a lot easier to parse and work with then 
the mess of .ifdef's, etc. that would end up in 'kern/Makefile' for example.

-- 
John Baldwin
___
freebsd-hackers@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-hackers
To unsubscribe, send any mail to [EMAIL PROTECTED]