Tuesday, December 26, 2006

Configuration in uClinux

Everything starts from uClinux-dist/Makefile. Let's make a trip from
typing "make menuconfig"

0. make menuconfig:

1. ".PHONY: menuconfig
menuconfig: config.in "

A phony target is one that is not really the name of a file. It is just
a name for some commands to be executed when you make an explicit
request. There are two reasons to use a phony target: to avoid a
conflict with a file of the same name, and to improve performance.

2. ".PHONY: config.tk config.in
config/mkconfig > config.in
config/mkconfig is a script to dynamicly create menuconfig items
according to vender/AnalogDevices/<dirs>
It create configuration for the first two level menu

3. menuconfig: config.in
$(MAKE) -C $(SCRIPTSDIR)/lxdialog all
@HELP_FILE=config/Configure.help $(CONFIG_SHELL) $(SCRIPTSDIR)/Menuconfig
Displays the first two level of menu - then the user choose save
and .config is created.

@if [ ! -f .config ]; then echo; \ echo "You have not saved your
config, please re-run make config"; \
echo; \ exit 1; fi
@config/setconfig defaults
Use the default configuation for the applications, uClibc and Linux
That is, configuration filese in vendors/AnalogDevices/<boards> are
copied as configuration files.

@if egrep "^CONFIG_DEFAULTS_KERNEL=y" .config > /dev/null; then
$(MAKE) linux_menuconfig; fi
@if egrep "^CONFIG_DEFAULTS_MODULES=y" .config > /dev/null; then
$(MAKE) modules_menuconfig; fi
@if egrep "^CONFIG_DEFAULTS_VENDOR=y" .config > /dev/null; then
$(MAKE) config_menuconfig; fi
User has choosed to change above settings - so invoke the next level of
config menu

@config/setconfig final
Check whether user has choose to save the updated configuration as

4. For above, if to use configure the applications:

" @if egrep "^CONFIG_DEFAULTS_VENDOR=y" .config > /dev/null; then
$(MAKE) config_menuconfig; fi
$(MAKEARCH) -C config menuconfig


@$(CONFIG_SHELL) -n config.in
$(MAKE) -C $(SCRIPTSDIR)/lxdialog all
@HELP_FILE=Configure.help AUTOCONF_FILE=autoconf.h $(CONFIG_SHELL) $(SCRIPTSDIR)/Menuconfig config.in

So as a result, we see the bellow facts:

1. config/* contains config scrips, like mkconfig, setconfig. It also
contains Makefiles and config files for

2. vendos/AnalogDevices/<boards>/* contains the default configuration

Blog Archive