kconfig: use long options in conf
[sfrench/cifs-2.6.git] / scripts / kconfig / Makefile
index 80599e3a7994107cfa06f04e6a70c2d3ff2acbda..549e50e49cbf0f1a263ba519b935819db638c02e 100644 (file)
@@ -21,40 +21,44 @@ menuconfig: $(obj)/mconf
        $< $(Kconfig)
 
 config: $(obj)/conf
+       $< --oldaskconfig $(Kconfig)
+
+nconfig: $(obj)/nconf
        $< $(Kconfig)
 
 oldconfig: $(obj)/conf
-       $< -o $(Kconfig)
+       $< --$@ $(Kconfig)
 
 silentoldconfig: $(obj)/conf
-       $< -s $(Kconfig)
+       $(Q)mkdir -p include/generated
+       $< --$@ $(Kconfig)
 
 localmodconfig: $(obj)/streamline_config.pl $(obj)/conf
        $(Q)perl $< $(srctree) $(Kconfig) > .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
 
 localyesconfig: $(obj)/streamline_config.pl $(obj)/conf
        $(Q)perl $< $(srctree) $(Kconfig) > .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
 
@@ -81,34 +85,31 @@ 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
-
-randconfig: $(obj)/conf
-       $< -r $(Kconfig)
+PHONY += allnoconfig allyesconfig allmodconfig randconfig
 
-allyesconfig: $(obj)/conf
-       $< -y $(Kconfig)
+allnoconfig allyesconfig allmodconfig randconfig: $(obj)/conf
+       $< --$@ $(Kconfig)
 
-allnoconfig: $(obj)/conf
-       $< -n $(Kconfig)
+PHONY += nonint_oldconfig loose_nonint_oldconfig defconfig
 
-allmodconfig: $(obj)/conf
-       $< -m $(Kconfig)
+nonint_oldconfig loose_nonint_oldconfig: $(obj)/conf
+       $< --$@ $(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'
@@ -121,6 +122,10 @@ help:
        @echo  '  allmodconfig    - New config selecting modules when possible'
        @echo  '  allyesconfig    - New config where all options are accepted with yes'
        @echo  '  allnoconfig     - New config where all options are answered with no'
+       @echo  '  nonint_oldconfig - Checks the current configuration and fails if an option is '
+       @echo  '                    not set'
+       @echo  '  loose_nonint_oldconfig - Same as nonint_oldconfig, but updates the config file with '
+       @echo  '                    missing config options as unset'
 
 # lxdialog stuff
 check-lxdialog  := $(srctree)/$(src)/lxdialog/check-lxdialog.sh
@@ -136,6 +141,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
@@ -148,11 +155,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
@@ -176,7 +188,7 @@ 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)
@@ -201,6 +213,7 @@ HOSTLOADLIBES_gconf = `pkg-config --libs gtk+-2.0 gmodule-2.0 libglade-2.0`
 HOSTCFLAGS_gconf.o     = `pkg-config --cflags gtk+-2.0 gmodule-2.0 libglade-2.0` \
                           -D LKC_DIRECT_LINK
 
+HOSTLOADLIBES_nconf    = -lmenu -lpanel -lncurses
 $(obj)/qconf.o: $(obj)/.tmp_qtcheck
 
 ifeq ($(qconf-target),1)