kbuild: don't include `check-lxdialog' ldflags in global HOST_LOADLIBES
[cascardo/linux.git] / scripts / kconfig / Makefile
index 186c466..7522a8b 100644 (file)
@@ -21,14 +21,17 @@ menuconfig: $(obj)/mconf
        $< $(Kconfig)
 
 config: $(obj)/conf
+       $< --oldaskconfig $(Kconfig)
+
+nconfig: $(obj)/nconf
        $< $(Kconfig)
 
 oldconfig: $(obj)/conf
-       $< -o $(Kconfig)
+       $< --$@ $(Kconfig)
 
 silentoldconfig: $(obj)/conf
        $(Q)mkdir -p include/generated
-       $< -s $(Kconfig)
+       $< --$@ $(Kconfig)
 
 # if no path is given, then use src directory to find file
 ifdef LSMOD
@@ -41,15 +44,15 @@ endif
 localmodconfig: $(obj)/streamline_config.pl $(obj)/conf
        $(Q)mkdir -p include/generated
        $(Q)perl $< $(srctree) $(Kconfig) $(LSMOD_F) > .tmp.config
-       $(Q)if [ -f .config ]; then                             \
-                       cmp -s .tmp.config .config ||           \
-                       (mv -f .config .config.old.1;           \
-                        mv -f .tmp.config .config;             \
-                        $(obj)/conf -s $(Kconfig);             \
-                        mv -f .config.old.1 .config.old)       \
-       else                                                    \
-                       mv -f .tmp.config .config;              \
-                       $(obj)/conf -s $(Kconfig);              \
+       $(Q)if [ -f .config ]; then                                     \
+                       cmp -s .tmp.config .config ||                   \
+                       (mv -f .config .config.old.1;                   \
+                        mv -f .tmp.config .config;                     \
+                        $(obj)/conf --silentoldconfig $(Kconfig);      \
+                        mv -f .config.old.1 .config.old)               \
+       else                                                            \
+                       mv -f .tmp.config .config;                      \
+                       $(obj)/conf --silentoldconfig $(Kconfig);       \
        fi
        $(Q)rm -f .tmp.config
 
@@ -57,15 +60,15 @@ localyesconfig: $(obj)/streamline_config.pl $(obj)/conf
        $(Q)mkdir -p include/generated
        $(Q)perl $< $(srctree) $(Kconfig) $(LSMOD_F) > .tmp.config
        $(Q)sed -i s/=m/=y/ .tmp.config
-       $(Q)if [ -f .config ]; then                             \
-                       cmp -s .tmp.config .config ||           \
-                       (mv -f .config .config.old.1;           \
-                        mv -f .tmp.config .config;             \
-                        $(obj)/conf -s $(Kconfig);             \
-                        mv -f .config.old.1 .config.old)       \
-       else                                                    \
-                       mv -f .tmp.config .config;              \
-                       $(obj)/conf -s $(Kconfig);              \
+       $(Q)if [ -f .config ]; then                                     \
+                       cmp -s .tmp.config .config ||                   \
+                       (mv -f .config .config.old.1;                   \
+                        mv -f .tmp.config .config;                     \
+                        $(obj)/conf --silentoldconfig $(Kconfig);      \
+                        mv -f .config.old.1 .config.old)               \
+       else                                                            \
+                       mv -f .tmp.config .config;                      \
+                       $(obj)/conf --silentoldconfig $(Kconfig);       \
        fi
        $(Q)rm -f .tmp.config
 
@@ -92,34 +95,34 @@ update-po-config: $(obj)/kxgettext $(obj)/gconf.glade.h
        $(Q)rm -f arch/um/Kconfig.arch
        $(Q)rm -f $(obj)/config.pot
 
-PHONY += randconfig allyesconfig allnoconfig allmodconfig defconfig
+PHONY += allnoconfig allyesconfig allmodconfig alldefconfig randconfig
 
-randconfig: $(obj)/conf
-       $< -r $(Kconfig)
+allnoconfig allyesconfig allmodconfig alldefconfig randconfig: $(obj)/conf
+       $< --$@ $(Kconfig)
 
-allyesconfig: $(obj)/conf
-       $< -y $(Kconfig)
+PHONY += listnewconfig oldnoconfig savedefconfig defconfig
 
-allnoconfig: $(obj)/conf
-       $< -n $(Kconfig)
+listnewconfig oldnoconfig: $(obj)/conf
+       $< --$@ $(Kconfig)
 
-allmodconfig: $(obj)/conf
-       $< -m $(Kconfig)
+savedefconfig: $(obj)/conf
+       $< --$@=defconfig $(Kconfig)
 
 defconfig: $(obj)/conf
 ifeq ($(KBUILD_DEFCONFIG),)
-       $< -d $(Kconfig)
+       $< --defconfig $(Kconfig)
 else
        @echo "*** Default configuration is based on '$(KBUILD_DEFCONFIG)'"
-       $(Q)$< -arch/$(SRCARCH)/configs/$(KBUILD_DEFCONFIG) $(Kconfig)
+       $(Q)$< --defconfig=arch/$(SRCARCH)/configs/$(KBUILD_DEFCONFIG) $(Kconfig)
 endif
 
 %_defconfig: $(obj)/conf
-       $(Q)$< -arch/$(SRCARCH)/configs/$@ $(Kconfig)
+       $(Q)$< --defconfig=arch/$(SRCARCH)/configs/$@ $(Kconfig)
 
 # Help text used by make help
 help:
        @echo  '  config          - Update current config utilising a line-oriented program'
+       @echo  '  nconfig         - Update current config utilising a ncurses menu based program'
        @echo  '  menuconfig      - Update current config utilising a menu based program'
        @echo  '  xconfig         - Update current config utilising a QT based front-end'
        @echo  '  gconfig         - Update current config utilising a GTK based front-end'
@@ -127,11 +130,15 @@ help:
        @echo  '  localmodconfig  - Update current config disabling modules not loaded'
        @echo  '  localyesconfig  - Update current config converting local mods to core'
        @echo  '  silentoldconfig - Same as oldconfig, but quietly, additionally update deps'
-       @echo  '  randconfig      - New config with random answer to all options'
-       @echo  '  defconfig       - New config with default answer to all options'
-       @echo  '  allmodconfig    - New config selecting modules when possible'
-       @echo  '  allyesconfig    - New config where all options are accepted with yes'
+       @echo  '  defconfig       - New config with default from ARCH supplied defconfig'
+       @echo  '  savedefconfig   - Save current config as ./defconfig (minimal config)'
        @echo  '  allnoconfig     - New config where all options are answered with no'
+       @echo  '  allyesconfig    - New config where all options are accepted with yes'
+       @echo  '  allmodconfig    - New config selecting modules when possible'
+       @echo  '  alldefconfig    - New config with all symbols set to default'
+       @echo  '  randconfig      - New config with random answer to all options'
+       @echo  '  listnewconfig   - List new options'
+       @echo  '  oldnoconfig     - Same as silentoldconfig but set new symbols to n (unset)'
 
 # lxdialog stuff
 check-lxdialog  := $(srctree)/$(src)/lxdialog/check-lxdialog.sh
@@ -139,7 +146,6 @@ check-lxdialog  := $(srctree)/$(src)/lxdialog/check-lxdialog.sh
 # Use recursively expanded variables so we do not call gcc unless
 # we really need to do so. (Do not call gcc as part of make mrproper)
 HOST_EXTRACFLAGS = $(shell $(CONFIG_SHELL) $(check-lxdialog) -ccflags)
-HOST_LOADLIBES   = $(shell $(CONFIG_SHELL) $(check-lxdialog) -ldflags $(HOSTCC))
 
 HOST_EXTRACFLAGS += -DLOCALE
 
@@ -147,6 +153,8 @@ HOST_EXTRACFLAGS += -DLOCALE
 # ===========================================================================
 # Shared Makefile for the various kconfig executables:
 # conf:          Used for defconfig, oldconfig and related targets
+# nconf:  Used for the nconfig target.
+#         Utilizes ncurses
 # mconf:  Used for the menuconfig target
 #         Utilizes the lxdialog package
 # qconf:  Used for the xconfig target
@@ -159,11 +167,16 @@ lxdialog := lxdialog/checklist.o lxdialog/util.o lxdialog/inputbox.o
 lxdialog += lxdialog/textbox.o lxdialog/yesno.o lxdialog/menubox.o
 
 conf-objs      := conf.o  zconf.tab.o
-mconf-objs     := mconf.o zconf.tab.o $(lxdialog)
+mconf-objs     := mconf.o zconf.tab.o $(lxdialog)
+nconf-objs     := nconf.o zconf.tab.o nconf.gui.o
 kxgettext-objs := kxgettext.o zconf.tab.o
 
 hostprogs-y := conf qconf gconf kxgettext
 
+ifeq ($(MAKECMDGOALS),nconfig)
+       hostprogs-y += nconf
+endif
+
 ifeq ($(MAKECMDGOALS),menuconfig)
        hostprogs-y += mconf
 endif
@@ -187,14 +200,14 @@ endif
 
 clean-files    := lkc_defs.h qconf.moc .tmp_qtcheck \
                   .tmp_gtkcheck zconf.tab.c lex.zconf.c zconf.hash.c gconf.glade.h
-clean-files     += mconf qconf gconf
+clean-files     += mconf qconf gconf nconf
 clean-files     += config.pot linux.pot
 
 # Check that we have the required ncurses stuff installed for lxdialog (menuconfig)
 PHONY += $(obj)/dochecklxdialog
 $(addprefix $(obj)/,$(lxdialog)): $(obj)/dochecklxdialog
 $(obj)/dochecklxdialog:
-       $(Q)$(CONFIG_SHELL) $(check-lxdialog) -check $(HOSTCC) $(HOST_EXTRACFLAGS) $(HOST_LOADLIBES)
+       $(Q)$(CONFIG_SHELL) $(check-lxdialog) -check $(HOSTCC) $(HOST_EXTRACFLAGS) $(HOSTLOADLIBES_mconf)
 
 always := dochecklxdialog
 
@@ -208,10 +221,13 @@ HOSTCFLAGS_zconf.tab.o    := -I$(src)
 HOSTLOADLIBES_qconf    = $(KC_QT_LIBS) -ldl
 HOSTCXXFLAGS_qconf.o   = $(KC_QT_CFLAGS) -D LKC_DIRECT_LINK
 
-HOSTLOADLIBES_gconf    = `pkg-config --libs gtk+-2.0 gmodule-2.0 libglade-2.0`
+HOSTLOADLIBES_gconf    = `pkg-config --libs gtk+-2.0 gmodule-2.0 libglade-2.0` -ldl
 HOSTCFLAGS_gconf.o     = `pkg-config --cflags gtk+-2.0 gmodule-2.0 libglade-2.0` \
                           -D LKC_DIRECT_LINK
 
+HOSTLOADLIBES_mconf   = $(shell $(CONFIG_SHELL) $(check-lxdialog) -ldflags $(HOSTCC))
+
+HOSTLOADLIBES_nconf    = -lmenu -lpanel -lncurses
 $(obj)/qconf.o: $(obj)/.tmp_qtcheck
 
 ifeq ($(qconf-target),1)