build: add nconfig
[openwrt/staging/rmilecki.git] / scripts / config / Makefile
index d98f15c393779dbdb8f8e63e976402d32ab3c8c8..3082a65ceb96d4fae5d20d7f5b8150dc13691edc 100644 (file)
@@ -5,7 +5,7 @@
 .PHONY: clean all
 all: conf mconf
 clean:
-       rm -f *.o lxdialog/*.o *.moc $(clean-files) conf mconf qconf
+       rm -f *.o lxdialog/*.o *.moc $(clean-files) conf mconf qconf nconf
 
 # This clean-files definition is here to ensure that temporary files from the
 # previous version are removed by make config-clean.
@@ -52,6 +52,16 @@ HOSTCFLAGS_parser.tab.o      := -I $(srctree)/$(src)
 hostprogs-y    += conf
 conf-objs      := conf.o $(common-objs)
 
+# nconf: Used for the nconfig target based on ncurses
+hostprogs-y    += nconf
+nconf-objs     := nconf.o nconf.gui.o $(common-objs)
+
+HOSTLDLIBS_nconf       = $(shell . $(obj)/nconf-cfg && echo $$libs)
+HOSTCFLAGS_nconf.o     = $(shell . $(obj)/nconf-cfg && echo $$cflags)
+HOSTCFLAGS_nconf.gui.o = $(shell . $(obj)/nconf-cfg && echo $$cflags)
+
+$(obj)/nconf.o $(obj)/nconf.gui.o: $(obj)/nconf-cfg
+
 # mconf: Used for the menuconfig target based on lxdialog
 hostprogs-y    += mconf
 lxdialog       := $(addprefix lxdialog/, \
@@ -123,5 +133,8 @@ conf: $(conf-objs)
 mconf: mconf-cfg $(mconf-objs)
        $(CC) -o $@ $(filter-out mconf-cfg,$^) $(HOSTLDLIBS_mconf)
 
+nconf: nconf-cfg $(nconf-objs)
+       $(CC) -o $@ $(filter-out nconf-cfg,$^) $(HOSTLDLIBS_nconf)
+
 qconf: qconf-cfg $(qconf-cxxobjs) $(qconf-objs)
        $(CXX) -o $@ $(filter-out qconf-cfg,$^) $(HOSTLDLIBS_qconf)