kconfig/kconfig.mk
changeset 2454 c70da6c50bdb
parent 2448 a103abae1560
child 2564 5d4e91c0343e
     1.1 --- a/kconfig/kconfig.mk	Sun May 08 14:14:40 2011 +0200
     1.2 +++ b/kconfig/kconfig.mk	Thu May 12 19:45:30 2011 +0200
     1.3 @@ -11,7 +11,7 @@
     1.4  #-----------------------------------------------------------
     1.5  # The configurators rules
     1.6  
     1.7 -configurators = menuconfig oldconfig
     1.8 +configurators = menuconfig nconfig oldconfig
     1.9  PHONY += $(configurators)
    1.10  
    1.11  $(configurators): config_files
    1.12 @@ -20,6 +20,10 @@
    1.13  	@$(ECHO) "  CONF  $(KCONFIG_TOP)"
    1.14  	$(SILENT)$< $(KCONFIG_TOP)
    1.15  
    1.16 +nconfig: $(obj)/nconf
    1.17 +	@$(ECHO) "  CONF  $(KCONFIG_TOP)"
    1.18 +	$(SILENT)$< $(KCONFIG_TOP)
    1.19 +
    1.20  oldconfig: $(obj)/conf .config
    1.21  	@$(ECHO) "  CONF  $(KCONFIG_TOP)"
    1.22  	$(SILENT)$< --silent$@ $(KCONFIG_TOP)
    1.23 @@ -103,13 +107,24 @@
    1.24  mconf_DEP = $(patsubst %.c,%.dep,$(mconf_SRC))
    1.25  $(mconf_OBJ) $(mconf_DEP): CFLAGS += $(NCURSES_CFLAGS) $(INTL_CFLAGS)
    1.26  $(obj)/mconf: LDFLAGS += $(NCURSES_LDFLAGS)
    1.27 +
    1.28 +# What's needed to build 'nconf'
    1.29 +nconf_SRC = kconfig/nconf.c kconfig/nconf.gui.c
    1.30 +nconf_OBJ = $(patsubst %.c,%.o,$(nconf_SRC))
    1.31 +nconf_DEP = $(patsubst %.c,%.dep,$(nconf_SRC))
    1.32 +$(nconf_OBJ) $(nconf_DEP): CFLAGS += $(INTL_CFLAGS)
    1.33 +$(obj)/nconf: LDFLAGS += -lmenu -lpanel -lncurses
    1.34 +
    1.35 +# Under Cygwin, we need to auto-import some libs (which ones, exactly?)
    1.36 +# for mconf and nconf to lin properly.
    1.37  ifeq ($(shell uname -o 2>/dev/null || echo unknown),Cygwin)
    1.38  $(obj)/mconf: LDFLAGS += -Wl,--enable-auto-import
    1.39 +$(obj)/nconf: LDFLAGS += -Wl,--enable-auto-import
    1.40  endif
    1.41  
    1.42  # These are generated files:
    1.43 -ALL_OBJS = $(sort $(COMMON_OBJ) $(LX_OBJ) $(conf_OBJ) $(mconf_OBJ))
    1.44 -ALL_DEPS = $(sort $(COMMON_DEP) $(LX_DEP) $(conf_DEP) $(mconf_DEP))
    1.45 +ALL_OBJS = $(sort $(COMMON_OBJ) $(LX_OBJ) $(conf_OBJ) $(mconf_OBJ) $(nconf_OBJ))
    1.46 +ALL_DEPS = $(sort $(COMMON_DEP) $(LX_DEP) $(conf_DEP) $(mconf_DEP) $(nconf_DEP))
    1.47  
    1.48  # Cheesy auto-dependencies
    1.49  # Only parse the following if a configurator was called, to avoid building
    1.50 @@ -133,6 +148,9 @@
    1.51  $(LX_OBJ) $(LX_DEP): |dochecklxdialog
    1.52  $(mconf_OBJ) $(mconf_DEP): |dochecklxdialog
    1.53  endif
    1.54 +ifneq ($(strip $(filter nconfig,$(MAKECMDGOALS))),)
    1.55 +DEPS += $(nconf_DEP)
    1.56 +endif
    1.57  
    1.58  -include $(DEPS)
    1.59  
    1.60 @@ -170,6 +188,10 @@
    1.61  	@$(ECHO) '  LD    $@'
    1.62  	$(SILENT)$(HOST_LD) -o $@ $^ $(LDFLAGS) $(EXTRA_LDFLAGS)
    1.63  
    1.64 +$(obj)/nconf: $(COMMON_OBJ) $(nconf_OBJ)
    1.65 +	@$(ECHO) '  LD    $@'
    1.66 +	$(SILENT)$(HOST_LD) -o $@ $^ $(LDFLAGS) $(EXTRA_LDFLAGS)
    1.67 +
    1.68  $(obj)/conf: $(COMMON_OBJ) $(conf_OBJ)
    1.69  	@$(ECHO) '  LD    $@'
    1.70  	$(SILENT)$(HOST_LD) -o $@ $^ $(LDFLAGS) $(EXTRA_LDFLAGS)
    1.71 @@ -179,5 +201,5 @@
    1.72  
    1.73  clean::
    1.74  	@$(ECHO) "  CLEAN kconfig"
    1.75 -	$(SILENT)rm -f kconfig/{,m}conf{,.exe} $(ALL_OBJS) $(ALL_DEPS)
    1.76 +	$(SILENT)rm -f kconfig/{,m,n}conf{,.exe} $(ALL_OBJS) $(ALL_DEPS)
    1.77  	$(SILENT)rmdir --ignore-fail-on-non-empty kconfig{/lxdialog,} 2>/dev/null || true