1. Autogenerate target : Kconfig in apps, apps/examples, apps/netutils, apps/system
2. Add empty preconfig rules at leaf Makefiles
3. Move entry Kconfig
4. Autogenerate Kconfig_ENTRY
-/Kconfig
+/Kconfig*
/bin
/external
/.context
-include $(TOPDIR)/.config # Current configuration
include $(APPDIR)/Make.defs
+include $(APPDIR)/import/Make.defs
# Sub-directories
$(Q) $(MAKE) -C $(1) $(2) TOPDIR="$(TOPDIR)" APPDIR="$(APPDIR)"
endef
+$(foreach SDIR, $(SUBDIRS), $(eval $(call SDIR_template,$(SDIR),preconfig)))
$(foreach SDIR, $(SUBDIRS), $(eval $(call SDIR_template,$(SDIR),context)))
$(foreach SDIR, $(SUBDIRS), $(eval $(call SDIR_template,$(SDIR),depend)))
$(foreach SDIR, $(SUBDIRS), $(eval $(call SDIR_template,$(SDIR),clean)))
install:
+preconfig: $(foreach SDIR, $(SUBDIRS), $(SDIR)_preconfig)
+ $(Q) $(MKKCONFIG) -m $(MENUDESC)
+ $(Q) $(MKKCONFIG) -o Kconfig_ENTRY
+
context: $(foreach SDIR, $(SUBDIRS), $(SDIR)_context)
depend: $(foreach SDIR, $(SUBDIRS), $(SDIR)_depend)
clean: $(foreach SDIR, $(SUBDIRS), $(SDIR)_clean)
distclean: $(foreach SDIR, $(SUBDIRS), $(SDIR)_distclean)
+ $(call DELFILE, Kconfig*)
-include Make.dep
# Build targets
all: $(BIN)
-.PHONY: import install context context_serialize context_rest .depdirs depend clean distclean
+.PHONY: import install context context_serialize context_rest .depdirs preconfig depend clean distclean
+
+define MAKE_template
+ $(Q) $(MAKE) -C $(1) $(2) TOPDIR="$(TOPDIR)" APPDIR="$(APPDIR)" BIN_DIR="$(BIN_DIR)"
+
+endef
define SDIR_template
$(1)_$(2):
$(Q) $(MAKE) -C $(1) $(2) TOPDIR="$(TOPDIR)" APPDIR="$(APPDIR)" BIN_DIR="$(BIN_DIR)"
+
endef
$(foreach SDIR, $(CONFIGURED_APPS), $(eval $(call SDIR_template,$(SDIR),all)))
context: context_serialize
-Kconfig:
+preconfig:
$(foreach SDIR, $(BUILDIRS), $(call MAKE_template,$(SDIR),preconfig))
$(Q) $(MKKCONFIG)
-
-preconfig: Kconfig
+ $(Q) $(MKKCONFIG) -o Kconfig_ENTRY
.depdirs: $(foreach SDIR, $(CONFIGURED_APPS), $(SDIR)_depend)
clean: $(foreach SDIR, $(CLEANDIRS), $(SDIR)_clean)
$(call DELFILE, $(BIN))
- $(call DELFILE, Kconfig)
$(call DELDIR, $(BIN_DIR))
$(call CLEAN)
endif
$(call DELFILE, .depend)
$(call DELFILE, $(BIN))
- $(call DELFILE, Kconfig)
+ $(call DELFILE, Kconfig*)
$(call DELDIR, $(BIN_DIR))
$(call CLEAN)
--- /dev/null
+#
+# For a description of the syntax of this configuration file,
+# see kconfig-language at https://www.kernel.org/doc/Documentation/kbuild/kconfig-language.txt
+#
+
+if INIT_ENTRYPOINT
+choice
+ prompt "Application entry point"
+config ENTRY_MANUAL
+ bool "Set entry point manually"
+ ---help---
+ If you select this, you should add a function name as an application entry point
+ at "Entry point function name".
+
+comment "Application entry point list"
+source "$APPSDIR/Kconfig_ENTRY"
+endchoice
+
+config USER_ENTRYPOINT
+ string "Entry point function name" if ENTRY_MANUAL
+ ---help---
+ The name of the entry point for user applications.
+endif # INIT_ENTRYPOINT
+
--- /dev/null
+/Kconfig*
+
+++ /dev/null
-#
-# For a description of the syntax of this configuration file,
-# see kconfig-language at https://www.kernel.org/doc/Documentation/kbuild/kconfig-language.txt
-#
-
-menu "Examples"
-if INIT_ENTRYPOINT
-choice
- prompt "Application entry point"
-
-config ENTRY_MANUAL
- bool "manual entry"
-
-source "$APPSDIR/examples/artik_demo/Kconfig_ENTRY"
-source "$APPSDIR/examples/dnsclient_test/Kconfig_ENTRY"
-source "$APPSDIR/examples/dtls_client/Kconfig_ENTRY"
-source "$APPSDIR/examples/dtls_server/Kconfig_ENTRY"
-source "$APPSDIR/examples/fota_sample/Kconfig_ENTRY"
-source "$APPSDIR/examples/hello/Kconfig_ENTRY"
-source "$APPSDIR/examples/hello_tash/Kconfig_ENTRY"
-source "$APPSDIR/examples/helloxx/Kconfig_ENTRY"
-source "$APPSDIR/examples/iperf/Kconfig_ENTRY"
-source "$APPSDIR/examples/kernel_sample/Kconfig_ENTRY"
-source "$APPSDIR/examples/mdns_test/Kconfig_ENTRY"
-source "$APPSDIR/examples/mpu/Kconfig_ENTRY"
-source "$APPSDIR/examples/nettest/Kconfig_ENTRY"
-source "$APPSDIR/examples/ntpclient_test/Kconfig_ENTRY"
-source "$APPSDIR/examples/proc_test/Kconfig_ENTRY"
-source "$APPSDIR/examples/select_test/Kconfig_ENTRY"
-source "$APPSDIR/examples/sysio_test/Kconfig_ENTRY"
-source "$APPSDIR/examples/telnetd/Kconfig_ENTRY"
-source "$APPSDIR/examples/testcase/Kconfig_ENTRY"
-source "$APPSDIR/examples/tls_client/Kconfig_ENTRY"
-source "$APPSDIR/examples/tls_selftest/Kconfig_ENTRY"
-source "$APPSDIR/examples/tls_server/Kconfig_ENTRY"
-source "$APPSDIR/examples/wakaama_client/Kconfig_ENTRY"
-source "$APPSDIR/examples/webclient/Kconfig_ENTRY"
-source "$APPSDIR/examples/webserver/Kconfig_ENTRY"
-source "$APPSDIR/examples/websocket/Kconfig_ENTRY"
-source "$APPSDIR/examples/workqueue/Kconfig_ENTRY"
-
-endchoice
-
-config USER_ENTRYPOINT
- string "Application entry point" if ENTRY_MANUAL
- ---help---
- The name of the entry point for user applications.
-
-endif # INIT_ENTRYPOINT
-
-source "$APPSDIR/examples/dnsclient_test/Kconfig"
-source "$APPSDIR/examples/dtls_client/Kconfig"
-source "$APPSDIR/examples/dtls_server/Kconfig"
-source "$APPSDIR/examples/fota_sample/Kconfig"
-source "$APPSDIR/examples/hello/Kconfig"
-source "$APPSDIR/examples/hello_tash/Kconfig"
-source "$APPSDIR/examples/helloxx/Kconfig"
-source "$APPSDIR/examples/iperf/Kconfig"
-source "$APPSDIR/examples/kernel_sample/Kconfig"
-source "$APPSDIR/examples/mdns_test/Kconfig"
-source "$APPSDIR/examples/mpu/Kconfig"
-source "$APPSDIR/examples/nettest/Kconfig"
-source "$APPSDIR/examples/ntpclient_test/Kconfig"
-source "$APPSDIR/examples/slsiwifi/Kconfig"
-source "$APPSDIR/examples/proc_test/Kconfig"
-source "$APPSDIR/examples/select_test/Kconfig"
-source "$APPSDIR/examples/sysio_test/Kconfig"
-source "$APPSDIR/examples/telnetd/Kconfig"
-source "$APPSDIR/examples/testcase/Kconfig"
-source "$APPSDIR/examples/tls_client/Kconfig"
-source "$APPSDIR/examples/tls_selftest/Kconfig"
-source "$APPSDIR/examples/tls_server/Kconfig"
-source "$APPSDIR/examples/wakaama_client/Kconfig"
-source "$APPSDIR/examples/webclient/Kconfig"
-source "$APPSDIR/examples/webserver/Kconfig"
-source "$APPSDIR/examples/websocket/Kconfig"
-source "$APPSDIR/examples/workqueue/Kconfig"
-source "$APPSDIR/examples/artik_demo/Kconfig"
-source "$APPSDIR/examples/slsiwifi/Kconfig"
-source "$APPSDIR/examples/mqtt_test/Kconfig"
-source "$APPSDIR/examples/eeprom_test/Kconfig"
-source "$APPSDIR/examples/sensorbd_demo/Kconfig"
-endmenu
#
############################################################################
+MENUDESC = "Examples"
+
include $(APPDIR)/Directory.mk
$(call DELFILE, .depend)
-include Make.dep
+.PHONY: preconfig
+preconfig:
$(call DELFILE, .depend)
-include Make.dep
+.PHONY: preconfig
+preconfig:
$(call DELFILE, .depend)
-include Make.dep
+.PHONY: preconfig
+preconfig:
$(call DELFILE, .depend)
-include Make.dep
+.PHONY: preconfig
+preconfig:
$(call DELFILE, .depend)
-include Make.dep
+.PHONY: preconfig
+preconfig:
$(call DELFILE, .depend)
-include Make.dep
+.PHONY: preconfig
+preconfig:
$(call DELFILE, .depend)
-include Make.dep
+.PHONY: preconfig
+preconfig:
$(call DELFILE, .depend)
-include Make.dep
+.PHONY: preconfig
+preconfig:
$(call DELFILE, .depend)
-include Make.dep
+.PHONY: preconfig
+preconfig:
$(call DELFILE, .depend)
-include Make.dep
+.PHONY: preconfig
+preconfig:
$(call DELFILE, .depend)
-include Make.dep
+.PHONY: preconfig
+preconfig:
$(call DELFILE, .depend)
-include Make.dep
+.PHONY: preconfig
+preconfig:
+
$(call DELFILE, .depend)
-include Make.dep
+.PHONY: preconfig
+preconfig:
$(call DELFILE, .depend)
-include Make.dep
+.PHONY: preconfig
+preconfig:
$(call DELFILE, .depend)
-include Make.dep
+.PHONY: preconfig
+preconfig:
$(call DELFILE, .depend)
-include Make.dep
+.PHONY: preconfig
+preconfig:
$(call DELFILE, .depend)
-include Make.dep
+.PHONY: preconfig
+preconfig:
$(call DELFILE, .depend)
-include Make.dep
+.PHONY: preconfig
+preconfig:
$(call DELFILE, .depend)
-include Make.dep
+.PHONY: preconfig
+preconfig:
$(call DELFILE, .depend)
-include Make.dep
-
+.PHONY: preconfig
+preconfig:
$(call DELFILE, .depend)
-include Make.dep
+.PHONY: preconfig
+preconfig:
$(call DELFILE, .depend)
-include Make.dep
+.PHONY: preconfig
+preconfig:
-include Make.dep
-
+.PHONY: preconfig
+preconfig:
$(call DELFILE, .depend)
-include Make.dep
+.PHONY: preconfig
+preconfig:
$(call DELFILE, .depend)
-include Make.dep
+.PHONY: preconfig
+preconfig:
$(call DELFILE, .depend)
-include Make.dep
+.PHONY: preconfig
+preconfig:
$(call DELFILE, .depend)
-include Make.dep
+.PHONY: preconfig
+preconfig:
$(call DELFILE, .depend)
-include Make.dep
+.PHONY: preconfig
+preconfig:
$(call DELFILE, .depend)
-include Make.dep
-
+.PHONY: preconfig
+preconfig:
$(call DELFILE, .depend)
-include Make.dep
+.PHONY: preconfig
+preconfig:
$(call DELFILE, .depend)
-include Make.dep
+.PHONY: preconfig
+preconfig:
#
############################################################################
-include $(TOPDIR)/.config
-include $(TOPDIR)/build/Make.defs
+-include $(TOPDIR)/.config
+-include $(TOPDIR)/build/Make.defs
# Control build verbosity
#
*.adb
*.lib
*.src
+/Kconfig*
+++ /dev/null
-#
-# For a description of the syntax of this configuration file,
-# see kconfig-language at https://www.kernel.org/doc/Documentation/kbuild/kconfig-language.txt
-#
-
-menu "Network Utilities"
-source "$APPSDIR/netutils/codecs/Kconfig"
-source "$APPSDIR/netutils/dhcpc/Kconfig"
-source "$APPSDIR/netutils/dhcpd/Kconfig"
-source "$APPSDIR/netutils/ftpc/Kconfig"
-source "$APPSDIR/netutils/ftpd/Kconfig"
-source "$APPSDIR/netutils/json/Kconfig"
-source "$APPSDIR/netutils/smtp/Kconfig"
-source "$APPSDIR/netutils/telnetd/Kconfig"
-source "$APPSDIR/netutils/tftpc/Kconfig"
-source "$APPSDIR/netutils/netlib/Kconfig"
-source "$APPSDIR/netutils/webclient/Kconfig"
-source "$APPSDIR/netutils/webserver/Kconfig"
-source "$APPSDIR/netutils/websocket/Kconfig"
-source "$APPSDIR/netutils/ntpclient/Kconfig"
-source "$APPSDIR/netutils/xmlrpc/Kconfig"
-source "$APPSDIR/netutils/mdns/Kconfig"
-source "$APPSDIR/netutils/wifi/Kconfig"
-source "$APPSDIR/netutils/mqtt/Kconfig"
-source "$APPSDIR/netutils/er-coap/Kconfig"
-endmenu
#
############################################################################
+MENUDESC = "Network Utilities"
+
include $(APPDIR)/Directory.mk
$(call DELFILE, .depend)
-include Make.dep
+.PHONY: preconfig
+preconfig:
+
$(call DELFILE, .depend)
-include Make.dep
+.PHONY: preconfig
+preconfig:
$(call DELFILE, .depend)
-include Make.dep
+.PHONY: preconfig
+preconfig:
$(call DELFILE, .depend)
-include Make.dep
+.PHONY: preconfig
+preconfig:
$(call DELFILE, .depend)
-include Make.dep
+.PHONY: preconfig
+preconfig:
$(call DELFILE, .depend)
-include Make.dep
+.PHONY: preconfig
+preconfig:
$(call DELFILE, .depend)
-include Make.dep
+.PHONY: preconfig
+preconfig:
$(call DELFILE, .depend)
-include Make.dep
+.PHONY: preconfig
+preconfig:
$(call DELFILE, .depend)
-include Make.dep
+.PHONY: preconfig
+preconfig:
$(call DELFILE, .depend)
-include Make.dep
+.PHONY: preconfig
+preconfig:
$(call DELFILE, .depend)
-include Make.dep
+.PHONY: preconfig
+preconfig:
$(call DELFILE, .depend)
-include Make.dep
+.PHONY: preconfig
+preconfig:
$(call DELFILE, .depend)
-include Make.dep
+.PHONY: preconfig
+preconfig:
$(call DELFILE, .depend)
-include Make.dep
+.PHONY: preconfig
+preconfig:
$(call DELFILE, .depend)
-include Make.dep
+.PHONY: preconfig
+preconfig:
$(call DELFILE, .depend)
-include Make.dep
+.PHONY: preconfig
+preconfig:
$(call DELFILE, .depend)
-include Make.dep
+.PHONY: preconfig
+preconfig:
context:
-include Make.dep
+.PHONY: preconfig
+preconfig:
$(call DELFILE, .depend)
-include Make.dep
+.PHONY: preconfig
+preconfig:
$(Q) $(DIRUNLINK) $(PLATFORMDIR)
-include Make.dep
-
+.PHONY: preconfig
+preconfig:
$(call DELFILE, .depend)
-include Make.dep
+.PHONY: preconfig
+preconfig:
--- /dev/null
+/Kconfig*
+
+++ /dev/null
-#
-# For a description of the syntax of this configuration file,
-# see kconfig-language at https://www.kernel.org/doc/Documentation/kbuild/kconfig-language.txt
-#
-
-menu "System Libraries"
-menu "EMACS-like Command Line Editor"
-source "$APPSDIR/system/cle/Kconfig"
-endmenu
-
-menu "CU Minimal Terminal"
-source "$APPSDIR/system/cu/Kconfig"
-endmenu
-
-menu "FLASH Erase-all Command"
-source "$APPSDIR/system/flash_eraseall/Kconfig"
-endmenu
-
-menu "FOTA HAL Application Library"
-source "$APPSDIR/system/fota_hal/Kconfig"
-endmenu
-
-menu "I2C tool"
-source "$APPSDIR/system/i2c/Kconfig"
-endmenu
-
-menu "INI File Parser"
-source "$APPSDIR/system/inifile/Kconfig"
-endmenu
-
-menu "FLASH Program Installation"
-source "$APPSDIR/system/install/Kconfig"
-endmenu
-
-menu "PHY Tool"
-source "$APPSDIR/system/mdio/Kconfig"
-endmenu
-
-menu "System netdb Interface"
-source "$APPSDIR/system/netdb/Kconfig"
-endmenu
-
-menu "Power Off"
-source "$APPSDIR/system/poweroff/Kconfig"
-endmenu
-
-menu "P-Code Support"
-source "$APPSDIR/system/prun/Kconfig"
-endmenu
-
-menu "RAM test"
-source "$APPSDIR/system/ramtest/Kconfig"
-endmenu
-
-menu "RAMTRON"
-source "$APPSDIR/system/ramtron/Kconfig"
-endmenu
-
-menu "readline()"
-source "$APPSDIR/system/readline/Kconfig"
-endmenu
-
-menu "Sysinfo"
-source "$APPSDIR/system/sysinfo/Kconfig"
-endmenu
-
-menu "Utils"
-source "$APPSDIR/system/utils/Kconfig"
-endmenu
-
-menu "VI Work-Alike Editor"
-source "$APPSDIR/system/vi/Kconfig"
-endmenu
-endmenu
-
#
############################################################################
+MENUDESC = "System Libraries and Add-Ons"
+
include $(APPDIR)/Directory.mk
$(call DELFILE, .depend)
-include Make.dep
-
+.PHONY: preconfig
+preconfig:
$(call DELFILE, .depend)
-include Make.dep
-
+.PHONY: preconfig
+preconfig:
$(call DELFILE, .depend)
-include Make.dep
+.PHONY: preconfig
+preconfig:
$(call DELFILE, .depend)
-include Make.dep
+.PHONY: preconfig
+preconfig:
$(call DELFILE, .depend)
-include Make.dep
-
+.PHONY: preconfig
+preconfig:
$(call DELFILE, .depend)
-include Make.dep
-
+.PHONY: preconfig
+preconfig:
$(call DELFILE, .depend)
-include Make.dep
+.PHONY: preconfig
+preconfig:
$(call DELFILE, .depend)
-include Make.dep
+.PHONY: preconfig
+preconfig:
$(call DELFILE, .depend)
-include Make.dep
+.PHONY: preconfig
+preconfig:
$(call DELFILE, .depend)
-include Make.dep
+.PHONY: preconfig
+preconfig:
$(call DELFILE, .depend)
-include Make.dep
+.PHONY: preconfig
+preconfig:
$(call DELFILE, .depend)
-include Make.dep
+.PHONY: preconfig
+preconfig:
$(call DELFILE, .depend)
-include Make.dep
+.PHONY: preconfig
+preconfig:
$(call DELFILE, .depend)
-include Make.dep
+.PHONY: preconfig
+preconfig:
$(call DELFILE, .depend)
-include Make.dep
+.PHONY: preconfig
+preconfig:
$(call DELFILE, .depend)
-include Make.dep
+.PHONY: preconfig
+preconfig:
$(call DELFILE, .depend)
-include Make.dep
+.PHONY: preconfig
+preconfig:
$(call DELFILE, .depend)
-include Make.dep
+.PHONY: preconfig
+preconfig:
echo mkkconfig in $PWD
-KCONFIG_LIST=`ls -1 $PWD/*/Kconfig`
+KCONFIG_LIST=`ls -1 $PWD/*/${KCONFIG}`
echo "#" > ${KCONFIG}
echo "# For a description of the syntax of this configuration file," >> ${KCONFIG}
$(call DELFILE, .depend)
-include Make.dep
+.PHONY: preconfig
+preconfig: