diff -r a103abae1560 -r c70da6c50bdb kconfig/kconfig.mk --- a/kconfig/kconfig.mk Sun May 08 14:14:40 2011 +0200 +++ b/kconfig/kconfig.mk Thu May 12 19:45:30 2011 +0200 @@ -11,7 +11,7 @@ #----------------------------------------------------------- # The configurators rules -configurators = menuconfig oldconfig +configurators = menuconfig nconfig oldconfig PHONY += $(configurators) $(configurators): config_files @@ -20,6 +20,10 @@ @$(ECHO) " CONF $(KCONFIG_TOP)" $(SILENT)$< $(KCONFIG_TOP) +nconfig: $(obj)/nconf + @$(ECHO) " CONF $(KCONFIG_TOP)" + $(SILENT)$< $(KCONFIG_TOP) + oldconfig: $(obj)/conf .config @$(ECHO) " CONF $(KCONFIG_TOP)" $(SILENT)$< --silent$@ $(KCONFIG_TOP) @@ -103,13 +107,24 @@ mconf_DEP = $(patsubst %.c,%.dep,$(mconf_SRC)) $(mconf_OBJ) $(mconf_DEP): CFLAGS += $(NCURSES_CFLAGS) $(INTL_CFLAGS) $(obj)/mconf: LDFLAGS += $(NCURSES_LDFLAGS) + +# What's needed to build 'nconf' +nconf_SRC = kconfig/nconf.c kconfig/nconf.gui.c +nconf_OBJ = $(patsubst %.c,%.o,$(nconf_SRC)) +nconf_DEP = $(patsubst %.c,%.dep,$(nconf_SRC)) +$(nconf_OBJ) $(nconf_DEP): CFLAGS += $(INTL_CFLAGS) +$(obj)/nconf: LDFLAGS += -lmenu -lpanel -lncurses + +# Under Cygwin, we need to auto-import some libs (which ones, exactly?) +# for mconf and nconf to lin properly. ifeq ($(shell uname -o 2>/dev/null || echo unknown),Cygwin) $(obj)/mconf: LDFLAGS += -Wl,--enable-auto-import +$(obj)/nconf: LDFLAGS += -Wl,--enable-auto-import endif # These are generated files: -ALL_OBJS = $(sort $(COMMON_OBJ) $(LX_OBJ) $(conf_OBJ) $(mconf_OBJ)) -ALL_DEPS = $(sort $(COMMON_DEP) $(LX_DEP) $(conf_DEP) $(mconf_DEP)) +ALL_OBJS = $(sort $(COMMON_OBJ) $(LX_OBJ) $(conf_OBJ) $(mconf_OBJ) $(nconf_OBJ)) +ALL_DEPS = $(sort $(COMMON_DEP) $(LX_DEP) $(conf_DEP) $(mconf_DEP) $(nconf_DEP)) # Cheesy auto-dependencies # Only parse the following if a configurator was called, to avoid building @@ -133,6 +148,9 @@ $(LX_OBJ) $(LX_DEP): |dochecklxdialog $(mconf_OBJ) $(mconf_DEP): |dochecklxdialog endif +ifneq ($(strip $(filter nconfig,$(MAKECMDGOALS))),) +DEPS += $(nconf_DEP) +endif -include $(DEPS) @@ -170,6 +188,10 @@ @$(ECHO) ' LD $@' $(SILENT)$(HOST_LD) -o $@ $^ $(LDFLAGS) $(EXTRA_LDFLAGS) +$(obj)/nconf: $(COMMON_OBJ) $(nconf_OBJ) + @$(ECHO) ' LD $@' + $(SILENT)$(HOST_LD) -o $@ $^ $(LDFLAGS) $(EXTRA_LDFLAGS) + $(obj)/conf: $(COMMON_OBJ) $(conf_OBJ) @$(ECHO) ' LD $@' $(SILENT)$(HOST_LD) -o $@ $^ $(LDFLAGS) $(EXTRA_LDFLAGS) @@ -179,5 +201,5 @@ clean:: @$(ECHO) " CLEAN kconfig" - $(SILENT)rm -f kconfig/{,m}conf{,.exe} $(ALL_OBJS) $(ALL_DEPS) + $(SILENT)rm -f kconfig/{,m,n}conf{,.exe} $(ALL_OBJS) $(ALL_DEPS) $(SILENT)rmdir --ignore-fail-on-non-empty kconfig{/lxdialog,} 2>/dev/null || true